/**
 * ==============================================================================
 * SAAMBROS E-COMMERCE - RESPONSIVE STYLES & MOBILE OPTIMIZATIONS
 * ==============================================================================
 */

/* --------------------------------------------------------------------------
   MOBILE BOTTOM APP BAR NAVIGATION — PREMIUM LIGHT DESIGN
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-nav-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #64748B;
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
    position: relative;
}

.mobile-bottom-nav .nav-item svg {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
    stroke-width: 2;
    stroke: currentColor;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: #FF6A00;
    font-weight: 700;
}

.mobile-bottom-nav .nav-item.active svg {
    stroke: #FF6A00;
}

.mobile-bottom-nav .nav-item .badge-count {
    position: absolute;
    top: 6px;
    right: calc(50% - 16px);
    min-width: 17px;
    height: 17px;
    font-size: 0.65rem;
    line-height: 15px;
    background-color: #FF6A00;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   OFF-CANVAS DRAWER FOR MOBILE (PREMIUM LIGHT & TOUCH OPTIMIZED)
   -------------------------------------------------------------------------- */
.mobile-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer-backdrop.backdrop-open {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86%;
    max-width: 320px;
    background-color: #FFFFFF;
    border-right: 1px solid #E2E8F0;
    color: #0F172A;
    z-index: 2100;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.mobile-nav-drawer.drawer-open {
    transform: translateX(0);
}

body.no-scroll {
    overflow: hidden !important;
    touch-action: none;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.25rem;
    background-color: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
}

.drawer-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.drawer-logo .logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.5px;
}

.drawer-logo .logo-text span {
    color: #FF6A00;
}

.drawer-logo .logo-badge {
    font-size: 0.65rem;
    font-weight: 800;
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FFEDD5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.drawer-close-btn {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #0F172A;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.drawer-close-btn:hover,
.drawer-close-btn:active {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #DC2626;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.drawer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.drawer-nav-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    border-bottom: 1px solid #F1F5F9;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.drawer-nav-list li a:hover,
.drawer-nav-list li a:active {
    color: #FF6A00;
    background-color: #FFF7ED;
}

.drawer-nav-list li a svg {
    width: 18px;
    height: 18px;
    color: #FF6A00;
    flex-shrink: 0;
}

.drawer-categories-section {
    margin: 1.25rem 0;
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
}

.drawer-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.drawer-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-cat-item {
    margin-bottom: 0.35rem;
}

.drawer-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #1E293B;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    transition: all 0.15s ease;
}

.drawer-cat-link:hover,
.drawer-cat-link:active {
    background: #FFF7ED;
    color: #FF6A00;
    border-color: #FFEDD5;
}

.drawer-secondary-links {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
}

.drawer-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #E2E8F0;
    background-color: #F8FAFC;
    font-size: 0.8rem;
    color: #64748B;
}

.drawer-footer p {
    margin: 0 0 0.25rem 0;
}

/* --------------------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    :root {
        --container-max-width: 1360px;
    }
}

/* Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    .header-navbar {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .footer-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .trust-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile Devices (max-width: 768px) - PREMIUM LIGHT MOBILE HEADER */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); /* Safe offset for mobile bottom navigation */
    }

    .mobile-bottom-nav {
        display: block;
    }

    .header-topbar {
        display: none;
    }

    /* PREMIUM LIGHT MOBILE HEADER (#FFFFFF / #F8FAFC) */
    .main-header {
        padding: 0.65rem 0;
        background: #FFFFFF;
        border-bottom: 1px solid #E2E8F0;
        box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
    }

    .main-header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* LEFT: Hamburger Menu Toggle */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 1;
        width: 38px;
        height: 38px;
        background: #F8FAFC;
        border: 1px solid #E2E8F0;
        border-radius: 8px;
        color: #0F172A;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }

    .mobile-menu-btn:hover,
    .mobile-menu-btn:active {
        background: #FFF7ED;
        color: #FF6A00;
        border-color: #FFEDD5;
    }

    .mobile-menu-btn svg {
        width: 22px;
        height: 22px;
    }

    /* LEFT-CENTER: Brand Logo */
    .header-logo {
        order: 2;
        margin: 0;
        display: flex;
        align-items: center;
    }

    .header-logo .logo-text {
        font-size: 1.45rem;
        font-weight: 800;
        color: #0F172A;
        letter-spacing: -0.5px;
    }

    .header-logo .logo-text span {
        color: #FF6A00;
    }

    .header-logo .logo-badge {
        font-size: 0.6rem;
        background: #FFF7ED;
        color: #EA580C;
        border: 1px solid #FFEDD5;
    }

    /* HIDE Account, Wishlist, Cart & Badges from Mobile Header (Served via Bottom Nav) */
    .main-header .header-actions {
        display: none !important;
    }

    /* FULL-WIDTH LIGHT SEARCH BAR */
    .header-search-wrapper {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 0.35rem;
    }

    .header-search-form {
        background-color: #F8FAFC;
        border: 1.5px solid #E2E8F0;
        border-radius: 9999px;
        padding: 0.2rem 0.25rem 0.2rem 1rem;
        transition: all 0.2s ease;
    }

    .header-search-form:focus-within {
        border-color: #FF6A00;
        background-color: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12);
    }

    .header-search-input {
        height: 38px;
        font-size: 0.875rem;
        color: #0F172A;
    }

    .header-search-btn {
        width: 34px;
        height: 34px;
        background-color: #FF6A00;
    }

    .header-search-btn:hover {
        background-color: #EA580C;
    }

    .grid-cols-4, .grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .section-title {
        font-size: 1.35rem;
    }

    .quickview-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .col-4, .col-6, .col-8 {
        flex: 1 0 100%;
    }

    .footer-main-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .trust-features-grid {
        grid-template-columns: 1fr;
    }

    .bottom-bar-container {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .modal-body {
        padding: 1.25rem;
    }
}

/* Small Phones (max-width: 480px) */
@media (max-width: 480px) {
    .grid-cols-4, .grid-cols-3, .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .current-price {
        font-size: 1.05rem;
    }

    .btn-lg, .btn-xl {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

