/* ==========================================================================
   Modern design: the shared widgets of the store (Help Center, Live Chat, AI Assistant, cookie banner).
   Copied from assets/frontend/css/style.css so these widgets look the same in both designs.
   ========================================================================== */

/* Tokens the widgets use */
:root {
    --sf-primary: #f25c05;
    --sf-primary-600: #d94f02;
    --sf-primary-soft: #fff1e8;
    --sf-primary-rgb: 242, 92, 5;
    --sf-dark: #111827;
    --sf-dark-2: #1f2937;
    --sf-text: #1f2937;
    --sf-muted: #6b7280;
    --sf-light: #9ca3af;
    --sf-border: #e8eaef;
    --sf-bg: #f6f7fb;
    --sf-surface: #ffffff;
    --sf-surface-2: #f9fafb;
    --sf-surface-3: #f3f4f6;
    --sf-border-2: #dfe3ea;
    --sf-border-soft: #f3f4f6;
    --sf-heading: #111827;
    --sf-contrast: #111827;
    --sf-contrast-text: #ffffff;
    --sf-star-empty: #e5e7eb;
    --sf-success: #16a34a;
    --sf-danger: #e11d48;
    --sf-warning: #f59e0b;
    --sf-star: #fbbf24;
    --sf-radius-sm: 8px;
    --sf-radius: 12px;
    --sf-radius-lg: 18px;
    --sf-shadow-sm: 0 1px 3px rgba(17, 24, 39, .06);
    --sf-shadow: 0 10px 30px -12px rgba(17, 24, 39, .18);
    --sf-shadow-lg: 0 24px 50px -20px rgba(17, 24, 39, .3);
    --sf-transition: .22s cubic-bezier(.4, 0, .2, 1);
    --sf-font: 'Inter', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Bootstrap overrides */
    --bs-primary: var(--sf-primary);
    --bs-primary-rgb: var(--sf-primary-rgb);
    --bs-link-color: var(--sf-primary);
    --bs-link-hover-color: var(--sf-primary-600);
    --bs-body-font-family: var(--sf-font);
    --bs-body-color: var(--sf-text);
    --bs-border-color: var(--sf-border);
}

/* Floating Help Center "?" + WhatsApp / Messenger buttons (Admin → Settings → Chat & Support) */
.sf-fab { position: fixed; bottom: var(--sf-fab-bottom, 24px); z-index: 1025; display: flex; flex-direction: column; gap: 12px; transition: bottom var(--sf-transition); }
.sf-fab-right { right: 20px; align-items: flex-end; }
.sf-fab-left { left: 20px; align-items: flex-start; }
.sf-fab-btn { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; font-size: 24px; background: var(--sf-fab-color, var(--sf-primary)); box-shadow: 0 10px 24px -8px rgba(17, 24, 39, .45); transition: transform var(--sf-transition), filter var(--sf-transition); }
.sf-fab-btn:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.06); }
.sf-fab-green { background: #25d366; font-size: 27px; }
.sf-fab-blue { background: #0084ff; }
/* Hover title */
.sf-fab-btn[data-tip]::after { content: attr(data-tip); position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; background: #111827; color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--sf-transition); }
.sf-fab-right .sf-fab-btn[data-tip]::after { right: calc(100% + 10px); }
.sf-fab-left .sf-fab-btn[data-tip]::after { left: calc(100% + 10px); }
.sf-fab-btn[data-tip]:hover::after { opacity: 1; visibility: visible; }
.sf-help.is-open .sf-fab-btn[data-tip]::after { display: none; }
/* Help Center panel */
.sf-help { position: relative; }
.sf-help-toggle .fa-xmark, .sf-help.is-open .sf-help-toggle .fa-question { display: none; }
.sf-help.is-open .sf-help-toggle .fa-xmark { display: block; }
.sf-help-panel { position: absolute; bottom: calc(100% + 12px); width: 310px; max-width: calc(100vw - 40px); background: var(--sf-surface); border: 1px solid var(--sf-border); border-radius: 16px; box-shadow: 0 24px 48px -16px rgba(17, 24, 39, .35); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all var(--sf-transition); }
.sf-fab-right .sf-help-panel { right: 0; }
.sf-fab-left .sf-help-panel { left: 0; }
.sf-help.is-open .sf-help-panel { opacity: 1; visibility: visible; transform: none; }
.sf-help-head { background: var(--sf-fab-color, var(--sf-primary)); color: #fff; padding: 16px 18px; }
.sf-help-head strong { display: block; font-size: 16px; }
.sf-help-head small { opacity: .85; font-size: 12.5px; }
.sf-help-links { padding: 8px; max-height: 60vh; overflow-y: auto; }
.sf-help-links a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--sf-heading); font-weight: 600; font-size: 14px; }
.sf-help-links a:hover { background: var(--sf-surface-2); }
.sf-help-links a > i { width: 36px; height: 36px; border-radius: 10px; background: var(--sf-primary-soft); color: var(--sf-primary); display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.sf-help-links small { display: block; font-weight: 400; font-size: 12px; color: var(--sf-muted); }

/* Cookie consent banner (Settings → Marketing Tools) */
.sf-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1080; max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--sf-surface, #fff); color: var(--sf-text, #1f2937); border: 1px solid var(--sf-border, #e5e7eb); border-radius: 14px; box-shadow: 0 12px 40px rgba(15, 23, 42, .18); }
.sf-consent[hidden] { display: none; }
.sf-consent-text { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; flex: 1; }
.sf-consent-text i { color: #a16207; font-size: 18px; margin-top: 2px; }
.sf-consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 575.98px) {
    .sf-consent { flex-direction: column; align-items: stretch; }
    .sf-consent-actions { justify-content: flex-end; }
}

/* Chat & Support: middle left / right (vertically centred); the panel opens to the side */
.sf-fab.sf-fab-middle, .sf-up-visible .sf-fab.sf-fab-middle { top: 50%; bottom: auto; transform: translateY(-50%); }
.sf-fab-middle .sf-help-panel { bottom: auto; top: 50%; transform: translateY(-50%) translateX(10px); }
.sf-fab-middle.sf-fab-right .sf-help-panel { right: calc(100% + 12px); }
.sf-fab-middle.sf-fab-left .sf-help-panel { left: calc(100% + 12px); transform: translateY(-50%) translateX(-10px); }
.sf-fab-middle .sf-help.is-open .sf-help-panel { transform: translateY(-50%); }
@media (max-width: 767.98px) {
    /* Phones: a button in the middle covers the page, so it sits in the bottom corner */
    .sf-fab.sf-fab-middle, .sf-up-visible .sf-fab.sf-fab-middle { top: auto; bottom: calc(var(--sf-fab-bottom, 24px) + 60px); transform: none; }
    .sf-fab-middle .sf-help-panel { top: auto; bottom: calc(100% + 12px); transform: translateY(10px); }
    .sf-fab-middle.sf-fab-right .sf-help-panel { right: 0; }
    .sf-fab-middle.sf-fab-left .sf-help-panel { left: 0; transform: translateY(10px); }
    .sf-fab-middle .sf-help.is-open .sf-help-panel { transform: none; }
}

/* Live Chat (Settings → Chat & Support → Live Chat) */
.sf-live-toggle { position: relative; }
.sf-live-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.sf-live-badge[hidden] { display: none; }
.sf-live { position: fixed; bottom: 90px; z-index: 1040; width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; background: var(--sf-surface, #fff); border: 1px solid var(--sf-border, #e5e7eb); border-radius: 18px; box-shadow: 0 24px 60px -18px rgba(17, 24, 39, .45); overflow: hidden; }
.sf-live[hidden] { display: none; }
.sf-live-right { right: 20px; }
.sf-live-left { left: 20px; }
.sf-live-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--sf-live-color, #4f46e5); color: #fff; }
.sf-live-head strong { display: block; font-size: 15px; }
.sf-live-head small { opacity: .9; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.sf-live-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.sf-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
.sf-live-dot.is-off { background: #f59e0b; }
.sf-live-close { margin-left: auto; border: 0; background: rgba(255, 255, 255, .15); color: #fff; width: 32px; height: 32px; border-radius: 50%; }
.sf-live-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--sf-surface-2, #f8fafc); }
.sf-live-msg { display: flex; flex-direction: column; align-items: flex-end; max-width: 82%; align-self: flex-end; }
.sf-live-msg.is-agent { align-self: flex-start; align-items: flex-start; }
.sf-live-bubble { padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--sf-live-color, #4f46e5); color: #fff; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sf-live-msg.is-agent .sf-live-bubble { background: var(--sf-surface, #fff); color: var(--sf-text, #1f2937); border: 1px solid var(--sf-border, #e5e7eb); border-radius: 14px 14px 14px 4px; }
.sf-live-msg small { font-size: 11px; color: var(--sf-muted, #6b7280); margin-top: 2px; }
.sf-live-note { align-self: center; text-align: center; font-size: 12.5px; color: var(--sf-muted, #6b7280); background: var(--sf-surface, #fff); border: 1px dashed var(--sf-border, #e5e7eb); border-radius: 10px; padding: 8px 12px; }
.sf-live-form { padding: 10px; border-top: 1px solid var(--sf-border, #e5e7eb); display: flex; flex-direction: column; gap: 8px; }
.sf-live-who { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sf-live-who[hidden] { display: none; }
.sf-live-who [name="name"] { grid-column: 1 / -1; }
.sf-live-write { display: flex; gap: 8px; align-items: flex-end; }
.sf-live-write textarea { resize: none; max-height: 110px; }
.sf-live-send { background: var(--sf-live-color, #4f46e5); color: #fff; width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; padding: 0; }
.sf-live-send:hover { color: #fff; filter: brightness(1.08); }
.sf-live-error { font-size: 12.5px; color: #dc2626; }
.sf-live-error[hidden] { display: none; }
@media (max-width: 575.98px) {
    /* Phones: the chat fills the screen */
    .sf-live { left: 0; right: 0; bottom: 0; top: 0; width: 100%; max-width: none; height: auto; max-height: none; border-radius: 0; }
}
/* Send button keeps its color on hover / click / focus (Bootstrap .btn would clear it) */
.sf-live .sf-live-send, .sf-live .sf-live-send:hover, .sf-live .sf-live-send:focus, .sf-live .sf-live-send:active, .sf-live .sf-live-send:disabled { background: var(--sf-live-color, #4f46e5) !important; color: #fff !important; border: 0 !important; }
.sf-live .sf-live-send:hover { filter: brightness(1.1); transform: translateY(-1px); }
.sf-live .sf-live-send:disabled { opacity: .6; }
.sf-live .sf-live-send:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sf-live-color, #4f46e5) 35%, transparent) !important; }
/* Live Chat button: chat icon ↔ close icon while the window is open */
.sf-live-toggle .fa-xmark, .sf-live-toggle.is-open .fa-comment-dots { display: none; }
.sf-live-toggle.is-open .fa-xmark { display: block; }
.sf-live-toggle.is-open .sf-live-badge { display: none; }
@media (max-width: 575.98px) {
    .sf-live { top: 0 !important; bottom: 0 !important; left: 0 !important; right: 0 !important; }
}

/* Live Chat: pictures / files, typing */
.sf-live-image { display: block; max-width: 220px; border-radius: 12px; overflow: hidden; border: 1px solid var(--sf-border, #e5e7eb); margin-bottom: 2px; }
.sf-live-image img { display: block; width: 100%; height: auto; }
.sf-live-file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--sf-surface, #fff); border: 1px solid var(--sf-border, #e5e7eb); color: var(--sf-text, #1f2937); max-width: 240px; margin-bottom: 2px; }
.sf-live-file i { font-size: 20px; color: var(--sf-live-color, #4f46e5); }
.sf-live-file span { display: flex; flex-direction: column; font-size: 13px; overflow-wrap: anywhere; }
.sf-live-file small { color: var(--sf-muted, #6b7280); font-size: 11px; }
.sf-live-attach { width: 38px; height: 42px; display: grid; place-items: center; flex-shrink: 0; color: var(--sf-muted, #6b7280); cursor: pointer; border-radius: 10px; margin: 0; }
.sf-live-attach:hover { color: var(--sf-live-color, #4f46e5); background: var(--sf-surface-2, #f1f5f9); }
.sf-live-chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; padding: 3px 6px 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--sf-live-color, #4f46e5) 12%, transparent); color: var(--sf-live-color, #4f46e5); font-size: 12.5px; }
.sf-live-chip[hidden] { display: none; }
.sf-live-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.sf-live-chip button { border: 0; background: transparent; color: inherit; padding: 0 4px; }
.sf-live-typing { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--sf-muted, #6b7280); }
.sf-live-typing[hidden] { display: none; }
.sf-live-typing em { font-style: normal; margin-left: 4px; }
.sf-live-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--sf-muted, #9ca3af); animation: sf-typing 1s infinite ease-in-out; }
.sf-live-typing span:nth-child(2) { animation-delay: .15s; }
.sf-live-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes sf-typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }


/* AI Assistant (Settings → Chat & Support → AI Agent): the window uses the Live Chat styles */
.sf-ai-toggle { position: relative; }
.sf-ai-toggle .fa-xmark, .sf-ai-toggle.is-open .fa-wand-magic-sparkles { display: none; }
.sf-ai-toggle.is-open .fa-xmark { display: block; }
.sf-ai { height: 560px; }
.sf-ai-head-btn { border: 0; background: rgba(255, 255, 255, .15); color: #fff; width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.sf-ai-head-btn:first-of-type { margin-left: auto; }
.sf-ai .sf-live-close { margin-left: 0; }
.sf-ai-head-btn:hover, .sf-ai .sf-live-close:hover { background: rgba(255, 255, 255, .28); }
.sf-ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-ai-suggest[hidden] { display: none; }
.sf-ai-suggest button { border: 1px solid color-mix(in srgb, var(--sf-live-color) 40%, transparent); background: var(--sf-surface, #fff); color: var(--sf-live-color); border-radius: 99px; padding: 5px 12px; font-size: 13px; }
.sf-ai-suggest button:hover { background: color-mix(in srgb, var(--sf-live-color) 10%, transparent); }
.sf-ai .sf-live-bubble a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }
.sf-ai-about { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; padding: 3px 6px 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--sf-live-color) 12%, transparent); color: var(--sf-live-color); font-size: 12.5px; }
.sf-ai-about[hidden] { display: none; }
.sf-ai-about button { border: 0; background: none; color: inherit; padding: 0 2px; }
.sf-ai-note { font-size: 11px; color: var(--sf-muted, #6b7280); text-align: center; }
.sf-ai-person { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-top: 1px solid var(--sf-border, #e5e7eb); background: color-mix(in srgb, var(--sf-live-color) 6%, var(--sf-surface, #fff)); }
.sf-ai-person[hidden] { display: none; }
.sf-ai-person small { color: var(--sf-muted, #6b7280); font-size: 12px; }
.sf-ai-person-actions { display: flex; justify-content: flex-end; gap: 6px; }
.sf-ai .sf-ai-btn, .sf-ai .sf-ai-btn:hover, .sf-ai .sf-ai-btn:focus { background: var(--sf-live-color) !important; color: #fff !important; border: 0; }

/* AI answer: product cards (Add to cart / Buy now) in the chat windows */
.sf-chat-cards { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 6px; margin-top: 6px; scroll-snap-type: x mandatory; max-width: 100%; }
.sf-chat-card { flex: 0 0 168px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--sf-border, #e5e7eb); border-radius: 12px; background: var(--sf-surface, #fff); box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
.sf-chat-card-img { display: block; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: var(--sf-surface-2, #f3f4f6); }
.sf-chat-card-img img { width: 100%; height: 100%; object-fit: cover; }
.sf-chat-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: inherit; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.sf-chat-card-name:hover { color: var(--sf-primary, #4f46e5); }
.sf-chat-card-price { font-size: 13px; }
.sf-chat-card-price strong { color: var(--sf-primary, #4f46e5); }
.sf-chat-card-price del { color: #9ca3af; font-size: 12px; }
.sf-chat-card-option { font-size: 12px; padding: 3px 26px 3px 8px; }
.sf-chat-card .btn { font-size: 12.5px; padding: 5px 8px; }
.sf-chat-card .btn .spinner-border { display: none; width: 12px; height: 12px; margin-right: 4px; }
.sf-chat-card .btn.is-loading .spinner-border { display: inline-block; }
.sf-chat-card-out { font-size: 12px; text-align: center; color: #b91c1c; background: rgba(220, 38, 38, .08); border-radius: 8px; padding: 6px; }
.sf-chat-cards-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin: 2px 2px 6px; }


/* The few Bootstrap classes inside the widgets (the Modern design has no Bootstrap) */
.sf-live .form-control, .sf-ai .form-control, .sf-consent .form-control { display: block; width: 100%; padding: 8px 12px; font: inherit; font-size: 14px; color: var(--sf-text); background: #fff; border: 1px solid var(--sf-border); border-radius: 10px; outline: 0; }
.sf-live .form-control:focus, .sf-ai .form-control:focus { border-color: var(--sf-primary); box-shadow: 0 0 0 3px rgba(var(--sf-primary-rgb), .15); }
.sf-live .form-control-sm, .sf-ai .form-control-sm { padding: 6px 10px; font-size: 13px; }
.sf-live .btn, .sf-ai .btn, .sf-consent .btn, .sf-chat-card .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.sf-live .btn-light, .sf-ai .btn-light, .sf-consent .btn-light { background: #f3f4f6; color: #111827; }
.sf-consent .btn-primary, .sf-chat-card .btn-primary { background: var(--sf-primary); color: #fff; }
.sf-chat-card .btn-dark { background: #111827; color: #fff; }
.sf-chat-card .w-100 { width: 100%; }
.sf-chat-card .form-select { width: 100%; padding: 6px 10px; border: 1px solid var(--sf-border); border-radius: 8px; font: inherit; font-size: 13px; }
.sf-chat-card .spinner-border { display: none; }
