/* ========================================================================
   Salsabeel Mobile Design System
   Deliberately scoped below 768px so approved desktop layouts are unchanged.
   ======================================================================== */

@media (max-width: 767px) {
    :root {
        --mobile-navy: #0f3759;
        --mobile-navy-deep: #092945;
        --mobile-gold: #c28b1e;
        --mobile-gold-soft: #f8edd2;
        --mobile-blue-soft: #edf6fc;
        --mobile-surface: #ffffff;
        --mobile-canvas: #f8fafc;
        --mobile-border: #dce5ed;
        --mobile-muted: #687b8f;
        --mobile-gutter: 16px;
        --mobile-radius-sm: 12px;
        --mobile-radius-md: 16px;
        --mobile-radius-lg: 20px;
        --mobile-shadow: 0 10px 30px rgba(15, 55, 89, 0.08);
    }

    html {
        scroll-padding-top: 76px;
    }

    body {
        min-width: 0;
        background: var(--mobile-canvas);
        -webkit-text-size-adjust: 100%;
    }

    /* Mobile shell: contact details move into the menu/footer, leaving a
       focused navigation bar with reliable 44px touch targets. */
    .top-bar {
        display: none;
    }

    .main-header {
        min-height: 70px;
        padding: calc(7px + env(safe-area-inset-top, 0px)) 0 7px;
        border-bottom-color: rgba(15, 55, 89, 0.1);
        box-shadow: 0 5px 18px rgba(15, 55, 89, 0.07);
    }

    .nav-container {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        width: calc(100% - 28px);
        min-height: 54px;
        gap: 8px;
    }

    .menu-toggle {
        grid-column: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 1px solid transparent;
        border-radius: 12px;
        color: var(--mobile-navy);
        font-size: 1.15rem;
    }

    .menu-toggle:hover,
    .menu-toggle:focus-visible {
        border-color: rgba(15, 55, 89, 0.12);
        background: #f3f7fa;
    }

    .logo {
        grid-column: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .logo img {
        display: block;
        width: auto;
        height: 54px;
        max-width: 174px;
        object-fit: contain;
    }

    .nav-left-actions {
        grid-column: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        gap: 0;
    }

    .header-cart-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 1px solid transparent;
        border-radius: 12px;
        font-size: 1.08rem;
    }

    .header-cart-btn:hover,
    .header-cart-btn:focus-visible {
        border-color: rgba(15, 55, 89, 0.12);
        background: #f3f7fa;
    }

    .cart-badge-count {
        top: 3px;
        left: 2px;
        width: 17px;
        height: 17px;
        font-size: 0.62rem;
    }

    html[dir="ltr"] .cart-badge-count {
        right: 2px;
        left: auto;
    }

    .cart-dropdown {
        position: fixed;
        top: calc(72px + env(safe-area-inset-top, 0px));
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100dvh - 92px);
        border: 1px solid var(--mobile-border);
        border-radius: var(--mobile-radius-md);
        box-shadow: 0 20px 55px rgba(7, 28, 45, 0.2);
    }

    [dir="ltr"] .cart-dropdown {
        right: 12px;
        left: 12px;
    }

    .main-nav {
        right: -100vw;
        width: min(86vw, 330px);
        max-width: 330px;
    }

    .main-nav.open {
        right: 0;
    }

    html[dir="ltr"] .main-nav {
        right: auto;
        left: -100vw;
    }

    html[dir="ltr"] .main-nav.open {
        left: 0;
    }

    .menu-header-mobile {
        position: sticky;
        top: 0;
        z-index: 1;
        min-height: 68px;
        padding: 15px 18px;
    }

    .menu-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .main-nav > ul {
        padding: 10px 12px calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .main-nav ul li a {
        min-height: 48px;
    }

    .sb-page {
        min-width: 0;
    }

    .sb-page img {
        max-width: 100%;
    }

    .mobile-scroll-safe {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
    }

    .mobile-scroll-safe::-webkit-scrollbar {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-header,
    .main-nav,
    .cart-dropdown {
        scroll-behavior: auto;
        transition-duration: 0.01ms !important;
    }
}
