@font-face {
    font-family: "Alk Sanet UI";
    src: url(/fonts/alk-sanet.woff2) format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: optional;
}

.site-header .main-nav a,
.ft {
    font-family: "Alk Sanet UI", sans-serif;
}

.mobile-nav-actions,
.cart-sidebar-actions,
.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-nav:not(.is-open) .theme-toggle,
.cart-sidebar:not(.is-open) .theme-toggle {
    visibility: hidden;
}

.site-header,
main,
.ft {
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

.site-header { padding-top: var(--safe-area-top); }
.ft { padding-bottom: var(--safe-area-bottom); }

.site-header .logo img {
    box-sizing: content-box;
    width: 150px;
    aspect-ratio: 300 / 82;
}

.site-header .header-right :is(.profile-icon, .cart-icon) {
    display: grid;
    place-items: center;
    flex: none;
    width: 1.125em;
    height: 1.7em;
}

.ft-logo-img {
    width: 161px;
    height: 44px;
    object-fit: contain;
}

.ft-pay img {
    flex: none;
    height: 18px;
    object-fit: contain;
}

@media (max-width: 576px) {
    .header-right { gap: 12px; }
    .site-header .logo img { max-width: 126px; }
}

@media (min-width: 1121px) {
    .header-right { gap: clamp(12px, 1.3vw, 26px); }
    .header-center { min-width: 150px; padding-inline: clamp(16px, 2vw, 32px); }
    .main-nav ul { gap: clamp(12px, 1.25vw, 24px); }
    .main-nav a { white-space: nowrap; }
}

/* Keep drawer controls clear of the screen cutout and home indicator. */
.mobile-nav,
.cart-sidebar,
.filter-panel {
    height: 100dvh;
    padding-top: var(--safe-area-top);
    padding-right: var(--safe-area-right);
    padding-bottom: var(--safe-area-bottom);
}

.mobile-nav-body,
.cart-sidebar-body,
.panel-content,
.chat-body {
    min-height: 0;
}

.filter-panel .panel-footer { padding-bottom: 18px; }

@media (max-width: 480px) {
    .cart-sidebar,
    .filter-panel { padding-left: var(--safe-area-left); }
}

.cm-overlay {
    height: 100dvh;
    padding: var(--safe-area-top) var(--safe-area-right)
        var(--safe-area-bottom) var(--safe-area-left);
}

.cm-overlay .cm-modal {
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hto-overlay {
    height: 100dvh;
    padding: var(--safe-area-top) var(--safe-area-right) 0 var(--safe-area-left);
}

.hto-modal {
    max-height: min(92dvh, calc(100dvh - var(--safe-area-top)));
    padding-bottom: var(--safe-area-bottom);
}

.hto-head,
.hto-dots,
.hto-nav { flex-shrink: 0; }

.hto-carousel { overflow-y: auto; }

@media (min-width: 480px) {
    .hto-overlay {
        --hto-top-gap: max(16px, var(--safe-area-top));
        --hto-bottom-gap: max(16px, var(--safe-area-bottom));
        padding: var(--hto-top-gap) max(16px, var(--safe-area-right))
            var(--hto-bottom-gap) max(16px, var(--safe-area-left));
    }

    .hto-modal {
        max-height: min(90dvh, calc(100dvh - var(--hto-top-gap) - var(--hto-bottom-gap)));
        padding-bottom: 0;
    }
}

#chat-toggle-btn {
    right: calc(30px + var(--safe-area-right));
    bottom: calc(30px + var(--safe-area-bottom));
    transition-property: transform, box-shadow;
}

#chat-box {
    right: calc(30px + var(--safe-area-right));
    bottom: calc(110px + var(--safe-area-bottom));
    max-height: calc(100dvh - 126px - var(--safe-area-top) - var(--safe-area-bottom));
}

#toast-container {
    top: calc(90px + var(--safe-area-top));
    right: calc(20px + var(--safe-area-right));
}

@media (max-width: 768px) {
    #chat-toggle-btn {
        right: calc(25px + var(--safe-area-right));
        bottom: calc(25px + var(--safe-area-bottom));
    }

    #chat-box {
        height: 100dvh !important;
        max-height: none;
    }

    .chat-header {
        padding-top: calc(15px + var(--safe-area-top));
    }

    .chat-header,
    .chat-body {
        padding-left: calc(20px + var(--safe-area-left));
        padding-right: calc(20px + var(--safe-area-right));
    }

    .chat-footer--bot {
        padding-right: calc(14px + var(--safe-area-right));
        padding-bottom: calc(8px + var(--safe-area-bottom));
        padding-left: calc(14px + var(--safe-area-left));
    }

    .chat-footer::after { display: none; }

    #toast-container {
        top: auto;
        right: calc(16px + var(--safe-area-right));
        bottom: calc(20px + var(--safe-area-bottom));
        left: calc(16px + var(--safe-area-left));
        width: auto;
        margin-inline: auto;
        transform: none;
    }
}

/* Storefront palette aliases used by the existing layout and page styles. */
html[data-theme="dark"] {
    --background-color: var(--theme-bg);
    --text-light: var(--theme-muted);
    --border-color: var(--theme-border);
    --c-text: var(--theme-text);
    --c-text-2: var(--theme-text);
    --c-text-3: var(--theme-muted);
    --c-text-muted: var(--theme-muted);
    --c-bg: var(--theme-surface);
    --c-bg-soft: var(--theme-raised);
    --c-bg-subtle: var(--theme-hover);
    --c-border: var(--theme-border);
}

html[data-theme="dark"] body {
    background-color: var(--theme-viewport-color);
    color: var(--theme-text);
}

html[data-theme="dark"],
html[data-theme="dark"] * {
    scrollbar-color: var(--theme-border) var(--theme-bg);
}

html[data-theme="dark"]::-webkit-scrollbar-track,
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--theme-bg); }

html[data-theme="dark"]::-webkit-scrollbar-thumb,
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--theme-border); }

html[data-theme="dark"] .site-header {
    background: rgba(25, 27, 29, .94);
    border-color: var(--theme-border);
    box-shadow: 0 2px 18px rgba(0, 0, 0, .3);
}

@media (max-width: 1120px), (any-pointer: coarse) {
    .site-header,
    html[data-theme="dark"] .site-header {
        /* Safari samples the full-width sticky header for its status bar tint. */
        background: var(--theme-viewport-color);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        transform: none;
    }
}

@media (any-pointer: coarse), (max-width: 767px) {
    .ft {
        background-color: var(--theme-viewport-color);
        border-top-color: var(--border-color);
    }

    html[data-theme="light"] .ft :is(.ft-desc, .ft-col ul a, .ft-bar) { color: #555; }
    html[data-theme="light"] .ft .ft-col-title { color: #222; }
    html[data-theme="light"] .ft .ft-body { border-bottom-color: var(--border-color); }
    html[data-theme="light"] .ft :is(.ft-col ul a i, .ft-col ul a:hover, .ft-bar a) { color: #963e0c; }
    html[data-theme="light"] .ft .ft-socials a { background: #f7f7f7; border-color: var(--border-color); color: #333; }
    html[data-theme="light"] .ft :is(.ft-logo-img, .ft-pay img[alt="Apple Pay"]) { filter: none; }
}

html[data-theme="dark"] :is(.site-header, .mobile-nav) .logo img {
    filter: brightness(0) invert(1);
}

html[data-theme="dark"] .site-header :is(.main-nav a, .profile-icon, .cart-icon),
html[data-theme="dark"] .mobile-nav nav a,
html[data-theme="dark"] .header-search input,
html[data-theme="dark"] .ssd-name {
    color: var(--theme-text);
}

html[data-theme="dark"] .hamburger-menu span { background: var(--theme-text); }

html[data-theme="dark"] :is(.header-search, .header-search:focus-within) {
    background-color: var(--theme-raised);
    border-color: var(--theme-border);
    box-shadow: none;
}

html[data-theme="dark"] .header-search:focus-within { border-color: var(--theme-accent); }

html[data-theme="dark"] .header-search input::placeholder,
html[data-theme="dark"] :is(.ssd-old, .ssd-empty) { color: var(--theme-muted); }

html[data-theme="dark"] .site-header :is(.main-nav a, .profile-icon, .cart-icon):hover,
html[data-theme="dark"] :is(.ssd-price, .ssd-view-all) { color: var(--theme-accent); }

html[data-theme="dark"] .search-suggest-dropdown {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] .ssd-view-all { border-color: var(--theme-border); }
html[data-theme="dark"] :is(.ssd-img, .ssd-item:hover, .ssd-view-all:hover, .ssd-active) {
    background: var(--theme-raised);
}

html[data-theme="dark"] .mobile-nav {
    background: var(--theme-surface);
    box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] :is(.mobile-nav-header, .mobile-menu-search, .mobile-nav-footer) {
    border-color: var(--theme-border);
}

html[data-theme="dark"] .mobile-nav-divider { background: var(--theme-border); }

html[data-theme="dark"] :is(.close-menu, .mobile-nav nav a i, .mobile-nav-socials a) {
    background: var(--theme-raised);
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(.close-menu:hover, .mobile-nav nav a:hover, .mobile-nav nav a:hover i, .mobile-nav-socials a:hover) {
    background: var(--theme-accent-surface);
    color: var(--theme-accent);
}

html[data-theme="dark"] .mobile-nav .nav-btn-login {
    background: var(--theme-raised) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border);
}

html[data-theme="dark"] .mobile-nav .nav-btn-login:hover { background: var(--theme-hover) !important; }

html[data-theme="dark"] .mobile-nav .nav-btn-register {
    background: var(--theme-accent) !important;
    color: var(--theme-bg) !important;
    border-color: var(--theme-accent);
}

html[data-theme="dark"] .mobile-nav .nav-btn-register:hover { background: #ffc18e !important; }

html[data-theme="dark"] :is(.hto-nav-btn, .chat-bot-btn) {
    background: var(--theme-accent-surface);
    color: var(--theme-accent);
    border-color: var(--theme-accent);
}

html[data-theme="dark"] :is(.header-search button, .header-search button:hover, .hto-nav-btn:hover, .hto-next, .hto-next:hover, .chat-bot-btn:hover) {
    background: var(--theme-accent);
    color: var(--theme-bg);
}

html[data-theme="dark"] :is(.hto-modal, .hto-card, .hto-ci, .hto-field, .hto-var) {
    background: var(--theme-surface);
    border-color: var(--theme-border);
}

html[data-theme="dark"] :is(.hto-visual, .hto-x, .hto-step-badge, .hto-search-bar) {
    background: var(--theme-raised);
    border-color: var(--theme-border);
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(.hto-prev, .hto-prev:hover) {
    border-color: var(--theme-border);
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(.hto-head-title, .hto-cap-title) { color: var(--theme-text); }
html[data-theme="dark"] :is(.hto-x:hover, .hto-avatar) { background: var(--theme-accent-surface); color: var(--theme-accent); }
html[data-theme="dark"] .hto-var.on { border-color: var(--theme-accent); }

/* Cart, notifications and support overlays stay legible above every page. */
html[data-theme="dark"] :is(.cart-sidebar, .cart-sidebar-footer, .notification, .chat-footer, .admin-msg),
html[data-theme="dark"] .chat-footer::after {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] :is(.cart-sidebar, .notification) { box-shadow: var(--theme-shadow); }

html[data-theme="dark"] :is(.cart-sidebar-overlay, .overlay) { background: rgba(0, 0, 0, .65); }

html[data-theme="dark"] :is(.cart-sidebar-header, .cart-sidebar-item, .sidebar-item-image img, .cart-sidebar .quantity-selector, .cart-sidebar .quantity-input) {
    border-color: var(--theme-border);
}

html[data-theme="dark"] :is(.cart-sidebar-header h3, .sidebar-item-name, .sidebar-item-price, .sidebar-item-total, .cart-sidebar-total, .notification__title) {
    color: var(--theme-text);
}

html[data-theme="dark"] :is(#cart-sidebar-close, .sidebar-remove-btn, .sidebar-item-price.old-price, .cart-sidebar-empty, .cart-sidebar-empty p) {
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(#cart-sidebar-close, .sidebar-remove-btn):hover { color: var(--theme-danger); }

html[data-theme="dark"] :is(.cart-sidebar-item:hover, .cart-sidebar .quantity-btn, .cart-sidebar .quantity-input, .min-order-bar-track) {
    background: var(--theme-raised);
    color: var(--theme-text);
}

html[data-theme="dark"] .cart-sidebar .quantity-btn:hover { background: var(--theme-hover); }

html[data-theme="dark"] :is(.sidebar-item-name:hover, .sidebar-item-price.sale-price, .min-order-top i, .min-order-left) {
    color: var(--theme-accent);
}

html[data-theme="dark"] .cart-min-order-notice {
    background: var(--theme-warning-surface);
    border-color: var(--theme-border);
    color: var(--theme-warning);
}

html[data-theme="dark"] :is(.cart-sidebar-checkout-btn, .cart-sidebar-continue-btn) {
    background: var(--theme-accent);
    color: var(--theme-bg);
}

html[data-theme="dark"] :is(.cart-sidebar-checkout-btn, .cart-sidebar-continue-btn):hover { background: #ffc18e; }
html[data-theme="dark"] .cart-sidebar-checkout-btn.is-disabled { background: var(--theme-hover); color: var(--theme-muted); }
html[data-theme="dark"] .cart-sidebar-spinner { border-color: var(--theme-border); border-top-color: var(--theme-accent); }

html[data-theme="dark"] :is(.notification--success, .notification--info) .notification__icon {
    background: var(--theme-accent-surface);
    color: var(--theme-accent);
}

html[data-theme="dark"] .notification--error .notification__icon { background: var(--theme-danger-surface); color: var(--theme-danger); }
html[data-theme="dark"] .notification__brand { color: var(--theme-accent); }

html[data-theme="dark"] #chat-box {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: var(--theme-shadow);
}

html[data-theme="dark"] .chat-header {
    background: var(--theme-raised);
    color: var(--theme-text);
    border-bottom: 1px solid var(--theme-border);
    box-shadow: none;
}

html[data-theme="dark"] .chat-title i { color: var(--theme-accent); }

html[data-theme="dark"] .user-msg {
    background: var(--theme-accent-surface);
    border: 1px solid var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] .chat-body {
    background-color: var(--theme-bg);
    background-image: radial-gradient(var(--theme-raised) 1.5px, transparent 1.5px);
}

html[data-theme="dark"] .chat-footer--bot { color: var(--theme-muted); }
html[data-theme="dark"] .chat-typing span { background: var(--theme-muted); }

/* Contact, delivery, policies and company details. */
html[data-theme="dark"] :is(.delivery-info-content, .contact-page-content) {
    --accent-color: var(--theme-accent);
    --brand-color: var(--theme-accent);
}

html[data-theme="dark"] :is(.about-us-content, .delivery-info-content, .contact-page-content) :is(h1, h2, h3, h4, .contact-text span) {
    color: var(--theme-text);
    border-color: var(--theme-border);
}

html[data-theme="dark"] :is(.about-us-content, .delivery-info-content, .contact-page-content) :is(p, li, p.lead, .note, .contact-text strong) {
    color: var(--theme-muted);
}

html[data-theme="dark"] .price-category {
    background: var(--theme-surface);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .contact-item i {
    background: var(--theme-accent-surface);
    border-color: var(--theme-border);
    color: var(--theme-accent);
}

html[data-theme="dark"] :is(.about-us-content, .delivery-info-content, .contact-page-content) a { color: var(--theme-accent); }

/* Wholesale request and interactive catalog. */
html[data-theme="dark"] :is(.wh-page, .wh-catalog-categories-head, .wh-category-card__content strong, .wh-catalog-placeholder strong) {
    color: var(--theme-text);
}

html[data-theme="dark"] :is(.wh-intro > p, .wh-process, .wh-selected, .wh-hint, .wh-stand-copy p, .wh-product-info span, .wh-product-info small, .wh-quantity, .wh-empty, .wh-fields label span, .wh-consent, .wh-submit p, .wh-category-filter, .wh-filter-count, .wh-catalog-categories-head span, .wh-category-card__content small, .wh-category-card > i, .wh-catalog-placeholder, .wh-success-dialog p, .wh-selection li span) {
    color: var(--theme-muted);
}

html[data-theme="dark"] :is(.wh-eyebrow, .wh-step, .wh-fields label em, .wh-consent a, .wh-category-card[aria-pressed="true"] > i, .wh-selection-head span, .wh-selection li button) {
    color: var(--theme-accent);
}

html[data-theme="dark"] :is(.wh-intro, .wh-process span + span, .wh-products, .wh-product) { border-color: var(--theme-border); }

html[data-theme="dark"] :is(.wh-panel, .wh-stand, .wh-catalog-layout, .wh-success-dialog) {
    background: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .wh-stand-image {
    background: radial-gradient(ellipse at center, #85837a, #393b3b);
    border-radius: 6px;
}

html[data-theme="dark"] :is(.wh-search, .wh-search input, .wh-category-filter select, .wh-selected-filter, .wh-quantity-controls, .wh-quantity-controls button, .wh-quantity input, .wh-fields input, .wh-fields textarea) {
    background: var(--theme-raised);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

html[data-theme="dark"] :is(.wh-catalog-categories, .wh-product-image, .wh-selected-filter span) {
    background: var(--theme-raised);
    border-color: var(--theme-border);
}

html[data-theme="dark"] :is(.wh-category-card:hover, .wh-quantity-controls button:hover, .wh-selection li button:hover) { background: var(--theme-hover); }

html[data-theme="dark"] :is(.wh-category-card[aria-pressed="true"], .wh-product.is-selected, .wh-selection, .wh-catalog-placeholder > i) {
    background: var(--theme-accent-surface);
    border-color: var(--theme-border);
    color: var(--theme-accent);
}

html[data-theme="dark"] :is(.wh-quantity input, .wh-fields input, .wh-fields textarea):focus { outline-color: var(--theme-accent); }
html[data-theme="dark"] .wh-search:focus-within { border-color: var(--theme-accent); }

html[data-theme="dark"] :is(.wh-submit button, .wh-success-close, .wh-selected-filter[aria-pressed="true"]) {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: var(--theme-bg);
}

html[data-theme="dark"] :is(.wh-submit button:hover, .wh-success-close:hover) { background: #ffc18e; }
html[data-theme="dark"] .wh-selected-filter[aria-pressed="true"] span { background: rgba(0, 0, 0, .12); }
html[data-theme="dark"] .wh-spinner { border-color: rgba(0, 0, 0, .25); border-top-color: var(--theme-bg); }

html[data-theme="dark"] :is(.wh-errors, .wh-picker-error) {
    background: var(--theme-danger-surface);
    border-color: var(--theme-danger);
    color: var(--theme-danger);
}

html[data-theme="dark"] :is(.wh-success, .wh-success-icon) {
    background: var(--theme-success-surface);
    border-color: var(--theme-success);
    color: var(--theme-success);
}
