/*
 * shop.css — shared shop-shell styles previously inlined in templates/base.html.
 * Topbar / navbar, global cart, size-suggestion and mobile-actions components.
 * Design tokens come from tokens.css / the page :root blocks (with sensible fallbacks).
 */

/*
     * =========================
     * Fixed / Sticky Topbar
     * =========================
     * Keeps `.top-header` pinned to the viewport.
     *
     * IMPORTANT:
     * `position: fixed` will behave like "fixed within a container" if any ancestor
     * has `transform`/`filter` applied. Keep the header OUTSIDE transformed wrappers.
     */

    /* Optional UX improvement: smoother anchor jumps. */
    html {
        scroll-behavior: smooth;
    }

    /* Page offset so content doesn't hide under the fixed header.
       These values assume the category/shop pages use 2rem (desktop) and 1rem (mobile) body padding. */
    :root {
        --topbar-height: 84px;
        --topbar-height-mobile: 72px;
        --topbar-max-width: 1280px;
        --page-gutter: 2rem;
        --page-gutter-mobile: 1rem;
        --topbar-content-gap: 0px;
        --topbar-content-gap-mobile: 12px;
        --topbar-inner-bg-default: rgba(255, 255, 255, 0.65);
        --topbar-inner-border-default: rgba(148, 163, 184, 0.25);
    }

    html[data-theme="dark"] {
        --topbar-inner-bg-default: rgba(2, 6, 23, 0.65);
        --topbar-inner-border-default: rgba(148, 163, 184, 0.18);
    }

    body.has-fixed-topbar {
        padding-top: calc(var(--page-gutter) + var(--topbar-height) + var(--topbar-content-gap) + env(safe-area-inset-top));
    }

    @media (max-width: 768px) {
        body.has-fixed-topbar {
            padding-top: calc(var(--page-gutter-mobile) + var(--topbar-height-mobile) + var(--topbar-content-gap-mobile) + env(safe-area-inset-top));
        }
    }

    .top-header {
        position: fixed;
        top: var(--page-gutter);
        left: 50%;
        transform: translateX(-50%);
        width: min(var(--topbar-max-width), calc(100vw - (var(--page-gutter) * 2)));
        z-index: 10045; /* Above content, below cart modal (10050) */
        display: block;
        margin: 0;
        pointer-events: auto;
    }

    .top-header__inner {
        width: 100%;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: relative;
        background: var(--topbar-bg, var(--toggle-bg, var(--topbar-inner-bg-default)));
        border: 1px solid var(--card-border, var(--topbar-inner-border-default));
        border-radius: 24px;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    html[data-theme="light"] .top-header__inner {
        background: rgb(255 255 255 / 48%);
    }

    @media (max-width: 768px) {
        .top-header {
            top: var(--page-gutter-mobile);
            width: min(var(--topbar-max-width), calc(100vw - (var(--page-gutter-mobile) * 2)));
        }
    }

    .top-header__left,
    .top-header__right {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }

    .top-header__left {
        gap: 0.5rem;
    }

    .top-header__center {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        justify-content: center;
    }

    .top-header__center > * {
        min-width: 0;
        max-width: 100%;
    }

    /*
     * Shared navbar element styling.
     * These classes come from `templates/navbar.html` and are now reused on product pages too.
     */
    .top-header .back-link,
    .top-header .theme-toggle,
    .top-header .mobile-actions-link,
    .top-header .top-header-menu-btn {
        font-size: 1rem;
        color: var(--text-secondary, #475569);
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 500;
        padding: 0.6rem 1.5rem;
        background: var(--toggle-bg, rgba(255, 255, 255, 0.8));
        border-radius: 2rem;
        border: 1px solid var(--card-border, rgba(148, 163, 184, 0.35));
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: var(--shadow-soft, 0 10px 30px -10px rgba(0, 0, 0, 0.05));
        transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
        cursor: pointer;
    }

    .top-header .back-link:hover,
    .top-header .theme-toggle:hover,
    .top-header .mobile-actions-link:hover,
    .top-header .top-header-menu-btn:hover {
        transform: translateY(-2px);
        color: var(--text-primary, #0f172a);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }

    .top-header .logout-link {
        margin-left: 0;
    }

    .top-header .shop-center {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        background: var(--toggle-bg, rgba(255, 255, 255, 0.8));
        padding: 0.5rem 1.5rem 0.5rem 0.8rem;
        border-radius: 3rem;
        box-shadow: var(--shadow-soft, 0 10px 30px -10px rgba(0, 0, 0, 0.05));
        border: 1px solid var(--card-border, rgba(148, 163, 184, 0.35));
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        max-width: 100%;
    }

    .top-header .shop-logo {
        width: 3.2rem;
        height: 3.2rem;
        padding: 0;
        border-radius: 50%;
        object-fit: cover;
        object-position: center;
        border: 1px solid var(--card-border, rgba(148, 163, 184, 0.35));
        background: rgba(255, 255, 255, 0.96);
        flex: 0 0 auto;
        box-shadow: 0 8px 18px -14px rgba(15, 23, 42, 0.55);
    }

    .shop-logo.shop-logo--square {
        object-fit: cover;
        padding: 0;
    }

    .top-header .shop-text {
        display: flex;
        flex-direction: column;
    }

    .top-header .shop-name {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--text-primary, #0f172a);
    }

    .top-header .branch {
        font-size: 0.85rem;
        color: var(--text-secondary, #475569);
    }

    /* Prevent icon cropping and layout shifts inside the fixed header. */
    .top-header i {
        line-height: 1;
        display: inline-block;
    }

    .top-header svg {
        display: block;
    }

    /* Truncate long shop/branch names instead of overlapping the back button. */
    .top-header .shop-text {
        min-width: 0;
    }

    .top-header .shop-name,
    .top-header .branch {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-header .top-header-menu-btn {
        width: 46px;
        height: 46px;
        min-width: 46px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
    }

    .top-header .mobile-actions-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0.25rem;
        left: auto;
        min-width: 190px;
        padding: 0.5rem;
        border-radius: 14px;
        border: 1px solid var(--card-border, rgba(148, 163, 184, 0.35));
        background: var(--toggle-bg, rgba(255, 255, 255, 0.92));
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        z-index: 10060;
        display: none;
        flex-direction: column;
        gap: 0.45rem;
    }

    .top-header .mobile-actions-menu.is-open {
        display: flex;
    }

    .top-header .mobile-actions-menu .theme-toggle,
    .top-header .mobile-actions-menu .mobile-actions-link,
    .top-header .mobile-actions-menu .logout-link {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        border-radius: 12px;
        padding: 0.6rem 0.85rem;
        height: auto;
        font-size: 0.9rem;
    }

    .top-header .size-suggestion-nav {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .top-header .size-suggestion-trigger {
        width: 46px;
        height: 46px;
        min-width: 46px;
        padding: 0;
        gap: 0;
    }

    .top-header .size-suggestion-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        min-width: 250px;
        padding: 0.45rem;
        border-radius: 14px;
        border: 1px solid var(--card-border, rgba(148, 163, 184, 0.35));
        background: var(--toggle-bg, rgba(255, 255, 255, 0.92));
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        z-index: 10065;
        display: none;
        flex-direction: column;
        gap: 0.3rem;
    }

    .top-header .size-suggestion-dropdown.is-open {
        display: flex;
    }

    .top-header .size-suggestion-dropdown__item {
        width: 100%;
        border: 1px solid transparent;
        border-radius: 10px;
        background: transparent;
        color: var(--text-primary, #0f172a);
        text-align: left;
        padding: 0.55rem 0.7rem;
        font-size: 0.88rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .top-header .size-suggestion-dropdown__item:hover {
        background: rgba(79, 70, 229, 0.1);
        border-color: rgba(79, 70, 229, 0.2);
    }

    .top-header .size-suggestion-dropdown__item.is-disabled,
    .top-header .size-suggestion-dropdown__item:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    @media (min-width: 769px) {
        .top-header .back-link .hide-mobile {
            display: none !important;
        }
    }

    @media (max-width: 768px) {
        .hide-mobile {
            display: none !important;
        }

        .top-header__inner {
            padding: 0.6rem 0.8rem;
            gap: 0.5rem;
            justify-content: space-between;
        }

        .top-header__left,
        .top-header__right {
            position: relative;
            z-index: 2;
        }

        .top-header__center {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            width: calc(100% - 250px);
            max-width: calc(100% - 250px);
            justify-content: center;
            z-index: 1;
            pointer-events: none;
        }

        .top-header__center > * {
            pointer-events: none;
        }

        .top-actions {
            gap: 0.5rem;
        }

        /* Reduce topbar element sizing only on small screens. */
        .top-header .back-link {
            font-size: 0.92rem;
            padding: 0.45rem 0.9rem;
        }

        .top-header .top-header-menu-btn,
        .top-header .global-cart-btn.global-cart-btn--inline,
        .top-header #mobileActionsToggle.global-cart-btn.global-cart-btn--inline,
        .top-header .size-suggestion-trigger {
            width: 42px;
            height: 42px;
            padding: 0;
            min-width: 42px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
        }

        .top-header .top-header__center {
            justify-content: center;
        }

        .top-header .shop-center {
            gap: 0.55rem;
            padding: 0.4rem 0.9rem 0.4rem 0.65rem;
        }

        .top-header .shop-logo {
            width: 2.2rem;
            height: 2.2rem;
        }

        .top-header .shop-name {
            font-size: 0.98rem;
        }

        .top-header .branch {
            font-size: 0.78rem;
        }

        .top-header .mobile-actions-menu {
            position: absolute;
            top: calc(100% + 8px);
            right: 0.25rem;
            left: auto;
            min-width: 180px;
            padding: 0.5rem;
            border-radius: 14px;
            border: 1px solid var(--card-border, rgba(148, 163, 184, 0.35));
            background: var(--toggle-bg, rgba(255, 255, 255, 0.92));
            box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            z-index: 10060;
            flex-direction: column;
            gap: 0.45rem;
        }

        .top-header .mobile-actions-menu.is-open {
            display: flex;
        }

        .top-header .mobile-actions-menu .theme-toggle,
        .top-header .mobile-actions-menu .mobile-actions-link,
        .top-header .mobile-actions-menu .logout-link {
            width: 100%;
            min-width: 0;
            justify-content: flex-start;
            border-radius: 12px;
            padding: 0.6rem 0.85rem;
            height: auto;
            font-size: 0.9rem;
        }

        .top-header .size-suggestion-dropdown {
            left: 0;
            right: auto;
            min-width: 215px;
        }
    }

    @media (max-width: 380px) {
        .top-header__inner {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr) auto;
            align-items: center;
            gap: 0.35rem;
            padding: 0.5rem 0.6rem;
        }

        .top-header__left,
        .top-header__right {
            min-width: 0;
        }

        .top-header__right {
            justify-content: flex-end;
        }

        .top-header__center {
            position: static;
            left: auto;
            transform: none;
            width: auto;
            max-width: 100%;
            min-width: 0;
            justify-self: stretch;
            z-index: auto;
            pointer-events: auto;
        }

        .top-header__center > * {
            pointer-events: auto;
            width: 100%;
            min-width: 0;
        }

        .top-header .shop-center {
            gap: 0.4rem;
            padding: 0.3rem 0.55rem 0.3rem 0.45rem;
            min-width: 0;
        }

        .top-header .shop-logo {
            width: 1.9rem;
            height: 1.9rem;
            border-width: 2px;
        }

        .top-header .shop-text {
            min-width: 0;
            max-width: 100%;
        }

        .top-header .shop-name {
            font-size: 0.92rem;
        }

        .top-header .branch {
            font-size: 0.72rem;
        }

        .top-actions {
            gap: 0.35rem;
        }

        .top-header .top-header-menu-btn,
        .top-header .global-cart-btn.global-cart-btn--inline,
        .top-header #mobileActionsToggle.global-cart-btn.global-cart-btn--inline {
            width: 36px;
            height: 36px;
            min-width: 36px;
            padding: 0;
        }

        .top-header .top-header-menu-btn i,
        .top-header .global-cart-btn.global-cart-btn--inline i,
        .top-header #mobileActionsToggle.global-cart-btn.global-cart-btn--inline i {
            font-size: 0.9rem;
        }

        .top-header .global-cart-btn.global-cart-btn--inline svg,
        .top-header #mobileActionsToggle.global-cart-btn.global-cart-btn--inline svg {
            width: 16px;
            height: 16px;
        }
    }

    @media (max-width: 768px) {
        .theme-toggle .control-label,
        .theme-toggle .theme-label {
            display: none !important;
        }

        .mobile-actions-menu .theme-toggle .control-label,
        .mobile-actions-menu .theme-toggle .theme-label {
            display: inline !important;
        }
    }

    .top-actions {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
    }

    .global-cart-btn {
        position: fixed;
        top: 18px;
        right: 18px;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        border: 1px solid rgba(148, 163, 184, 0.35);
        background: rgba(255, 255, 255, 0.85);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.15);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10040;
        /* Ensure SVG uses a visible color in both light + dark themes. */
        color: #0f172a;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    html[data-theme="dark"] .global-cart-btn {
        color: #f8fafc;
    }

    /* When the cart button is placed inside a header/nav, don't float it over the page. */
    .global-cart-btn.global-cart-btn--inline,
    #mobileActionsToggle.global-cart-btn.global-cart-btn--inline,
    #sizeSuggestionToggle.size-suggestion-trigger.top-header-menu-btn {
        position: relative;
        top: auto;
        right: auto;
        width: auto;
        height: auto;
        border-radius: 2rem;
        padding: 0.6rem 1.2rem;
        z-index: auto;
        background: var(--toggle-bg, rgba(255, 255, 255, 0.85));
        border: 1px solid var(--card-border, rgba(148, 163, 184, 0.35));
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .global-cart-btn.global-cart-btn--inline svg,
    #mobileActionsToggle.global-cart-btn.global-cart-btn--inline svg,
    #sizeSuggestionToggle.size-suggestion-trigger.top-header-menu-btn i {
        width: 18px;
        height: 18px;
        line-height: 18px;
    }

    .global-cart-btn.global-cart-btn--inline:hover,
    #mobileActionsToggle.global-cart-btn.global-cart-btn--inline:hover,
    #sizeSuggestionToggle.size-suggestion-trigger.top-header-menu-btn:hover {
        box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.1);
    }

    @media (max-width: 768px) {
        .global-cart-btn.global-cart-btn--inline,
        #mobileActionsToggle.global-cart-btn.global-cart-btn--inline,
        #sizeSuggestionToggle.size-suggestion-trigger.top-header-menu-btn {
            padding: 0.6rem;
            min-width: 42px;
            justify-content: center;
        }
    }

    .global-cart-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    }

    .global-cart-btn svg {
        width: 22px;
        height: 22px;
        color: currentColor;
    }

    .global-cart-count {
        position: absolute;
        top: -4px;
        right: -2px;
        min-width: 18px;
        height: 18px;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        padding: 0 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.9);
    }

    .global-cart-modal {
        position: fixed;
        inset: 0;
        display: none;
        z-index: 10050;
    }

    .swal2-container {
        z-index: 20000 !important;
    }

    .size-suggestion-popup {
        text-align: left;
        display: grid;
        gap: 10px;
    }

    .size-suggestion-popup__card {
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid rgba(148, 163, 184, 0.36);
        background: rgba(248, 250, 252, 0.9);
    }

    .size-suggestion-popup__card-title {
        margin: 0 0 8px;
        font-size: 0.92rem;
        font-weight: 700;
        color: #1e293b;
    }

    .size-suggestion-popup__row {
        display: grid;
        grid-template-columns: minmax(120px, 1fr) minmax(100px, 1fr);
        align-items: baseline;
        column-gap: 18px;
        font-size: 0.88rem;
        line-height: 1.45;
        color: #334155;
    }

    .size-suggestion-popup__label {
        font-weight: 600;
        color: #475569;
        white-space: normal;
    }

    .size-suggestion-popup__value {
        text-align: right;
        color: #0f172a;
        font-weight: 600;
        white-space: normal;
        word-break: break-word;
    }

    .size-suggestion-popup--saved .size-suggestion-popup__row {
        grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr);
        column-gap: 20px;
    }

    .size-suggestion-popup--saved .size-suggestion-popup__label {
        text-align: left;
    }

    .size-suggestion-popup--saved .size-suggestion-popup__value {
        text-align: right;
    }

    .size-suggestion-popup__empty {
        color: #64748b;
        font-size: 0.88rem;
        margin: 0;
    }

    .swal2-popup.size-suggestion-swal-popup {
        border-radius: 16px !important;
        border: 1px solid rgba(148, 163, 184, 0.35) !important;
        box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2) !important;
        padding-bottom: 1.25rem !important;
    }

    .swal2-popup.size-suggestion-swal-popup .swal2-title {
        color: #0f172a !important;
        font-size: 1.5rem !important;
        margin-bottom: 0.8rem !important;
    }

    .swal2-popup.size-suggestion-swal-popup .swal2-html-container {
        margin-top: 0.2rem !important;
        max-height: min(64vh, 560px);
        overflow: auto;
        overflow-x: hidden;
        padding: 0 2px;
    }

    .size-suggestion-form {
        text-align: left;
        display: grid;
        gap: 8px;
    }

    .size-suggestion-form__label {
        font-weight: 600;
        color: #334155;
        margin-top: 2px;
    }

    .size-choice-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .size-choice-btn {
        border: 1px solid rgba(148, 163, 184, 0.5);
        border-radius: 999px;
        background: rgba(248, 250, 252, 0.92);
        color: #0f172a;
        font-size: 0.86rem;
        font-weight: 600;
        line-height: 1;
        padding: 0.5rem 0.8rem;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

    .size-choice-btn:hover {
        border-color: rgba(79, 70, 229, 0.45);
        background: rgba(99, 102, 241, 0.1);
    }

    .size-choice-btn:focus-visible {
        outline: 2px solid rgba(99, 102, 241, 0.5);
        outline-offset: 1px;
    }

    .size-choice-btn.is-active {
        background: #6366f1;
        border-color: #6366f1;
        color: #ffffff;
    }

    .size-upload-row {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .size-upload-btn {
        border: 1px solid rgba(99, 102, 241, 0.45);
        border-radius: 10px;
        background: rgba(99, 102, 241, 0.12);
        color: #3730a3;
        font-weight: 700;
        font-size: 0.86rem;
        padding: 0.48rem 0.75rem;
        cursor: pointer;
    }

    .size-upload-name {
        font-size: 0.84rem;
        color: #475569;
        font-weight: 600;
    }

    @media (max-width: 640px) {
        .swal2-popup.size-suggestion-swal-popup {
            width: min(96vw, 420px) !important;
            padding: 1rem 0.85rem 1.1rem !important;
        }

        .swal2-popup.size-suggestion-swal-popup .swal2-title {
            font-size: 1.25rem !important;
            margin-bottom: 0.6rem !important;
        }

        .swal2-popup.size-suggestion-swal-popup .swal2-html-container {
            max-height: min(68vh, 540px);
        }

        .size-suggestion-popup {
            gap: 12px;
        }

        .size-suggestion-popup__card {
            padding: 12px;
        }

        .size-suggestion-popup__card-title {
            margin-bottom: 10px;
            font-size: 0.98rem;
        }

        .size-suggestion-popup__row {
            gap: 8px;
            padding-bottom: 6px;
            grid-template-columns: minmax(108px, 1fr) minmax(100px, 1fr);
        }

        .size-suggestion-popup__label {
            font-size: 0.93rem;
        }

        .size-suggestion-popup__value {
            text-align: right;
            font-size: 0.93rem;
        }

        .size-suggestion-popup--saved .size-suggestion-popup__label {
            text-align: left;
        }

        .size-choice-btn {
            padding: 0.54rem 0.78rem;
            font-size: 0.84rem;
        }
    }

    .global-cart-modal.is-open {
        display: block;
    }

    .global-cart-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(2, 6, 23, 0.45);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }

    .global-cart-panel {
        position: absolute;
        top: 76px;
        right: 18px;
        width: min(440px, calc(100vw - 24px));
        max-height: calc(100vh - 96px);
        display: flex;
        flex-direction: column;
        border-radius: 18px;
        border: 1px solid rgba(148, 163, 184, 0.35);
        background: rgba(255, 255, 255, 0.97);
        box-shadow: 0 20px 50px rgba(2, 6, 23, 0.28);
        overflow: hidden;
    }

    .global-cart-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.26);
        color: #0f172a;
    }

    .global-cart-header h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
    }

    .global-cart-close {
        border: none;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        cursor: pointer;
        background: rgba(15, 23, 42, 0.08);
        color: #0f172a;
        font-size: 1.1rem;
    }

    .global-cart-items {
        flex: 1;
        overflow-y: auto;
        padding: 10px 14px 4px;
    }

    .global-cart-empty {
        margin: 18px 4px;
        padding: 18px;
        border-radius: 14px;
        text-align: center;
        color: #475569;
        background: rgba(148, 163, 184, 0.12);
        font-size: 0.95rem;
    }

    /* ── Cart item: compact card ── */
    .global-cart-item {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px;
        border-radius: 14px;
        border: 1px solid rgba(148, 163, 184, 0.28);
        background: rgba(248, 250, 252, 0.9);
        margin-bottom: 8px;
    }

    /* Top row: image + text info */
    .global-cart-item-top {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .global-cart-image {
        flex-shrink: 0;
        width: 56px;
        height: 56px;
        border-radius: 10px;
        object-fit: cover;
        background: rgba(148, 163, 184, 0.12);
    }

    .global-cart-item-info {
        flex: 1;
        min-width: 0;
    }

    .global-cart-item-name {
        font-size: 0.88rem;
        font-weight: 600;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 3px;
    }

    .global-cart-meta {
        font-size: 0.78rem;
        color: #64748b;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Bottom row: qty stepper + total price + remove — all one line */
    .global-cart-item-bottom {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .global-cart-qty-row {
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    .global-cart-qty-btn {
        width: 24px;
        height: 24px;
        border: none;
        border-radius: 7px;
        background: rgba(15, 23, 42, 0.08);
        color: #0f172a;
        font-weight: 700;
        font-size: 0.85rem;
        cursor: pointer;
        line-height: 1;
        flex-shrink: 0;
    }

    .global-cart-qty-input {
        width: 38px;
        height: 26px;
        border-radius: 7px;
        border: 1px solid rgba(148, 163, 184, 0.5);
        text-align: center;
        font-size: 0.85rem;
        color: #0f172a;
        background: #fff;
        flex-shrink: 0;
    }

    .global-cart-item-total {
        flex: 1;
        font-size: 0.88rem;
        font-weight: 700;
        color: #0f172a;
        text-align: center;
        white-space: nowrap;
    }

    .global-cart-remove-btn {
        flex-shrink: 0;
        border: none;
        background: rgba(239, 68, 68, 0.12);
        color: #b91c1c;
        border-radius: 8px;
        font-size: clamp(0.68rem, 2.2vw, 0.75rem);
        font-weight: 600;
        padding: 4px clamp(6px, 2vw, 9px);
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s ease;
    }

    /* Unused legacy classes — kept for safety */
    .global-cart-price { display: none; }
    .global-cart-item-side { display: none; }

    .global-cart-footer {
        border-top: 1px solid rgba(148, 163, 184, 0.26);
        padding: 14px;
        background: rgba(248, 250, 252, 0.95);
    }

    .global-cart-total-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
        color: #0f172a;
        font-weight: 700;
    }

    .global-cart-purchase-btn {
        width: 100%;
        border: none;
        padding: 12px;
        border-radius: 12px;
        background: #4f46e5;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 700;
        cursor: pointer;
    }

    @media (max-width: 768px) {
        .global-cart-btn {
            top: 14px;
            right: 14px;
            width: 46px;
            height: 46px;
        }

        .global-cart-panel {
            right: 8px;
            top: 66px;
            width: calc(100vw - 16px);
            max-height: calc(100vh - 74px);
        }

        .global-cart-image {
            width: 48px;
            height: 48px;
        }

        .global-cart-item-name {
            font-size: 0.83rem;
        }

        .global-cart-meta {
            font-size: 0.74rem;
        }
    }

    /* ── Dark Mode support for Global Cart Selection ── */
    html[data-theme="dark"] .global-cart-panel {
        background: rgba(15, 23, 42, 0.98);
        border-color: rgba(148, 163, 184, 0.2);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    }
    html[data-theme="dark"] .global-cart-header {
        border-bottom-color: rgba(148, 163, 184, 0.15);
        color: #f8fafc;
    }
    html[data-theme="dark"] .global-cart-close {
        background: rgba(255, 255, 255, 0.08);
        color: #f8fafc;
    }
    html[data-theme="dark"] .global-cart-close:hover {
        background: rgba(255, 255, 255, 0.16);
    }
    html[data-theme="dark"] .global-cart-empty {
        color: #94a3b8;
        background: rgba(148, 163, 184, 0.06);
    }
    html[data-theme="dark"] .global-cart-item {
        border-color: rgba(148, 163, 184, 0.15);
        background: rgba(30, 41, 59, 0.45);
    }
    html[data-theme="dark"] .global-cart-item-name {
        color: #f8fafc;
    }
    html[data-theme="dark"] .global-cart-meta {
        color: #94a3b8;
    }
    html[data-theme="dark"] .global-cart-qty-btn {
        background: rgba(255, 255, 255, 0.08);
        color: #f8fafc;
    }
    html[data-theme="dark"] .global-cart-qty-btn:hover {
        background: rgba(255, 255, 255, 0.16);
    }
    html[data-theme="dark"] .global-cart-qty-input {
        border-color: rgba(148, 163, 184, 0.25);
        color: #f8fafc;
        background: #1e293b;
    }
    html[data-theme="dark"] .global-cart-item-total {
        color: #f8fafc;
    }
    html[data-theme="dark"] .global-cart-footer {
        border-top-color: rgba(148, 163, 184, 0.15);
        background: rgba(15, 23, 42, 0.96);
    }
    html[data-theme="dark"] .global-cart-total-row {
        color: #f8fafc;
    }

    /* ==========================================================================
     * Centralized Ambient Mesh Gradients & Floating Blobs
     * ========================================================================== */
    .ambient-bg {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -1;
        overflow: hidden;
        pointer-events: none;
        filter: blur(120px);
    }

    .blob {
        position: absolute;
        border-radius: 50%;
        animation: vtrFloat 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0.6;
        transition: background 0.8s ease;
    }

    .blob-1 {
        top: -10%;
        left: -10%;
        width: 50vw;
        height: 50vw;
        background: var(--blob-1, #c7d2fe);
        animation-delay: 0s;
    }

    .blob-2 {
        bottom: -20%;
        right: -10%;
        width: 60vw;
        height: 60vw;
        background: var(--blob-2, #ddd6fe);
        animation-delay: -5s;
    }

    .blob-3 {
        top: 40%;
        left: 40%;
        width: 40vw;
        height: 40vw;
        background: var(--blob-3, #fbcfe8);
        animation-delay: -10s;
    }

    @keyframes vtrFloat {
        0% { transform: translate(0, 0) scale(1); }
        100% { transform: translate(10vw, -10vh) scale(1.12); }
    }

    /* ==========================================================================
     * Enhanced Before / After Comparison Slider
     * ========================================================================== */
    .tryon-compare-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .compare-mode-tabs {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin-bottom: 12px;
        background: rgba(148, 163, 184, 0.12);
        padding: 4px;
        border-radius: 999px;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .compare-mode-tab {
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-size: 0.82rem;
        font-weight: 600;
        padding: 5px 14px;
        border-radius: 999px;
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .compare-mode-tab.is-active {
        background: var(--card-solid, #fff);
        color: var(--brand-500, #6366f1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    html[data-theme="dark"] .compare-mode-tab.is-active {
        background: #1e293b;
        color: #818cf8;
    }

    .tryon-compare {
        --pos: 50%;
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
        border-radius: 20px;
        user-select: none;
        touch-action: pan-y;
        cursor: ew-resize;
        background: rgba(15, 23, 42, 0.04);
        box-shadow: inset 0 0 0 1px var(--card-border);
    }

    .tryon-compare .compare-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        pointer-events: none;
    }

    .tryon-compare .compare-img.after {
        clip-path: polygon(var(--pos) 0, 100% 0, 100% 100%, var(--pos) 100%);
        transition: clip-path 0.04s ease;
    }

    .tryon-compare .compare-divider {
        position: absolute;
        top: 0;
        bottom: 0;
        left: var(--pos);
        width: 3px;
        transform: translateX(-50%);
        background: #ffffff;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
        pointer-events: none;
        z-index: 4;
        transition: left 0.04s ease;
    }

    .tryon-compare .compare-handle {
        position: absolute;
        top: 50%;
        left: var(--pos);
        transform: translate(-50%, -50%);
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: #ffffff;
        border: 3px solid var(--brand-500);
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        pointer-events: none;
        transition: left 0.04s ease, transform 0.2s ease;
    }

    .tryon-compare:hover .compare-handle {
        transform: translate(-50%, -50%) scale(1.08);
        box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
    }

    .tryon-compare .compare-handle i {
        font-size: 14px;
        color: var(--brand-500);
    }

    .tryon-compare .compare-label {
        position: absolute;
        top: 14px;
        z-index: 3;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: #ffffff;
        background: rgba(15, 23, 42, 0.68);
        backdrop-filter: blur(8px);
        padding: 4px 10px;
        border-radius: 999px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .tryon-compare .compare-label.before { left: 14px; }
    .tryon-compare .compare-label.after { right: 14px; }

    /* Side-by-Side Mode */
    .tryon-compare.mode-side-by-side {
        display: flex;
        cursor: default;
    }
    .tryon-compare.mode-side-by-side .compare-img.before {
        position: relative;
        width: 50%;
        height: 100%;
        clip-path: none;
    }
    .tryon-compare.mode-side-by-side .compare-img.after {
        position: relative;
        width: 50%;
        height: 100%;
        clip-path: none;
        border-left: 1px solid var(--card-border);
    }
    .tryon-compare.mode-side-by-side .compare-divider,
    .tryon-compare.mode-side-by-side .compare-handle {
        display: none !important;
    }

    /* ==========================================================================
     * In-Store Kiosk "Send to My Phone" QR Modal
     * ========================================================================== */
    .vtr-kiosk-modal-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.65);
        backdrop-filter: blur(10px);
        z-index: 10080;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .vtr-kiosk-modal-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .vtr-kiosk-modal {
        background: var(--card-solid, #ffffff);
        border: 1px solid var(--card-border);
        border-radius: 28px;
        padding: 32px 28px;
        max-width: 420px;
        width: 100%;
        text-align: center;
        box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
        transform: scale(0.92) translateY(20px);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
    }

    .vtr-kiosk-modal-backdrop.is-open .vtr-kiosk-modal {
        transform: scale(1) translateY(0);
    }

    html[data-theme="dark"] .vtr-kiosk-modal {
        background: #0f172a;
        color: #f8fafc;
    }

    .vtr-kiosk-modal-close {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: rgba(148, 163, 184, 0.16);
        color: var(--text-primary);
        font-size: 1.1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s ease, background 0.2s ease;
    }

    .vtr-kiosk-modal-close:hover {
        transform: scale(1.1);
        background: rgba(148, 163, 184, 0.28);
    }

    .vtr-kiosk-qr-box {
        margin: 20px auto;
        padding: 16px;
        background: #ffffff;
        border-radius: 20px;
        width: 220px;
        height: 220px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        border: 1px solid #e2e8f0;
    }

    .vtr-kiosk-qr-box canvas,
    .vtr-kiosk-qr-box img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain;
    }

    /* ==========================================================================
     * Fit Sentiment / Micro-Reactions Bar
     * ========================================================================== */
    .vtr-reactions-bar {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin: 20px 0 12px;
        padding: 16px;
        background: var(--toggle-bg, rgba(255, 255, 255, 0.6));
        border: 1px solid var(--card-border);
        border-radius: 20px;
        backdrop-filter: blur(8px);
    }

    .vtr-reactions-title {
        font-size: 0.88rem;
        font-weight: 600;
        color: var(--text-secondary);
    }

    .vtr-reactions-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .vtr-reaction-btn {
        background: var(--card-solid, #ffffff);
        border: 1px solid var(--card-border);
        color: var(--text-primary);
        font-size: 0.86rem;
        font-weight: 600;
        padding: 7px 14px;
        border-radius: 999px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    }

    html[data-theme="dark"] .vtr-reaction-btn {
        background: #1e293b;
        color: #f8fafc;
    }

    .vtr-reaction-btn:hover {
        transform: translateY(-2px) scale(1.05);
        border-color: var(--brand-500);
        box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.3);
    }

    .vtr-reaction-btn.is-active {
        background: var(--brand-gradient);
        color: #ffffff;
        border-color: transparent;
        transform: scale(1.04);
        box-shadow: 0 6px 20px -4px rgba(99, 102, 241, 0.45);
    }

    /* ==========================================================================
     * Cart Spring Bounce & Fly Animation
     * ========================================================================== */
    @keyframes vtrCartBounce {
        0% { transform: scale(1); }
        30% { transform: scale(1.35) rotate(-10deg); }
        50% { transform: scale(0.9) rotate(8deg); }
        70% { transform: scale(1.15) rotate(-4deg); }
        100% { transform: scale(1) rotate(0deg); }
    }

    .cart-spring-bounce {
        animation: vtrCartBounce 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    }

    /* Free Delivery / Alteration Milestone Progress */
    .vtr-cart-milestone {
        padding: 12px 14px;
        margin: 0 0 14px;
        background: rgba(99, 102, 241, 0.08);
        border-radius: 14px;
        border: 1px solid rgba(99, 102, 241, 0.18);
    }

    .vtr-cart-milestone-text {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--brand-500);
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .vtr-cart-milestone-bar {
        height: 6px;
        width: 100%;
        background: rgba(148, 163, 184, 0.25);
        border-radius: 999px;
        overflow: hidden;
    }

    .vtr-cart-milestone-fill {
        height: 100%;
        width: 60%;
        background: var(--brand-gradient);
        border-radius: 999px;
        transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Floating Toast Alerts */
    .vtr-toast-container {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10090;
        display: flex;
        flex-direction: column;
        gap: 8px;
        pointer-events: none;
    }

    .vtr-toast {
        pointer-events: auto;
        background: rgba(15, 23, 42, 0.92);
        color: #ffffff;
        backdrop-filter: blur(16px);
        padding: 12px 20px;
        border-radius: 999px;
        font-size: 0.9rem;
        font-weight: 500;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        display: flex;
        align-items: center;
        gap: 12px;
        animation: vtrToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes vtrToastIn {
        from { opacity: 0; transform: translateY(20px) scale(0.9); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .vtr-toast-undo {
        background: transparent;
        border: none;
        color: #818cf8;
        font-weight: 700;
        font-size: 0.85rem;
        cursor: pointer;
        text-decoration: underline;
        padding: 0;
    }

