/* ==========================================
   wikopn – Full Responsive Media Queries
   Covers: Navbar, Hero, Shop, Cart, Checkout,
   Product, Profile, Admin, Contact, About,
   Track Order, Footer, Forms
   ========================================== */

/* ===== MOBILE HAMBURGER NAV TOGGLE — SMOOTH PROFESSIONAL ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    z-index: 200;
    position: relative;
    overflow: hidden;
    transition:
        background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary, #171717);
    border-radius: 3px;
    position: absolute;
    left: 50%;
    transform-origin: center center;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1),
        opacity 0.2s ease,
        background-color 0.25s ease,
        width 0.25s ease;
    will-change: transform, opacity;
}

/* Resting positions of 3 bars */
.nav-toggle span:nth-child(1) {
    transform: translateX(-50%) translateY(-7px);
}

.nav-toggle span:nth-child(2) {
    transform: translateX(-50%) translateY(0);
    width: 14px;
    left: calc(50% - 3px);
}

.nav-toggle span:nth-child(3) {
    transform: translateX(-50%) translateY(7px);
}

/* OPEN STATE — morphs into X */
.nav-toggle.open {
    background: #fff0f0 !important;
    border-color: var(--primary-color, #f02121) !important;
    box-shadow: 0 0 0 4px rgba(240, 33, 33, 0.1) !important;
}

.nav-toggle.open span {
    background: var(--primary-color, #f02121);
    width: 20px;
    left: 50%;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateX(-50%) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-30%) scaleX(0);
}

.nav-toggle.open span:nth-child(3) {
    transform: translateX(-50%) rotate(-45deg);
}

/* Mobile-only nav items hidden on desktop */
.mobile-only-nav {
    display: none;
}

.navbar-backdrop {
    display: none;
}

.nav-close-row {
    display: none;
}

/* ===== LARGE DESKTOP 1280px+ ===== */
@media (min-width: 1281px) {
    .container {
        max-width: 1280px;
    }
}

/* ===== SMALL LAPTOP / LARGE TABLET 1200px ===== */
@media (max-width: 1200px) {
    .nav-actions {
        gap: 0.8rem;
    }

    .search-box input {
        width: 120px;
    }

    .search-box input:focus {
        width: 150px;
    }
}

/* ===== TABLET / MOBILE (<=1024px) ===== */
@media (max-width: 1024px) {

    /* Show Mobile & Tablet Bottom App Bar */
    .mobile-bottom-bar {
        display: flex !important;
    }

    body {
        padding-top: 54px !important;
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* TOP NAVBAR ON MOBILE & TABLET: Permanently fixed at top — zero layout jumps on scroll or toggle */
    .navbar {
        padding: 0.5rem 0 !important;
        background: #ffffff !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 10020 !important;
        transition: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body.nav-open .navbar {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    }

    body.nav-open .navbar .logo,
    body.nav-open .navbar .search-box {
        pointer-events: none !important;
    }

    body.nav-open .nav-toggle {
        pointer-events: auto !important;
    }

    .navbar .container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        padding: 0 0.85rem !important;
    }

    /* 1. Logo ALWAYS on Left */
    .navbar .logo {
        order: 1 !important;
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: left !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .navbar .logo img,
    .navbar .logo .logo-img {
        height: 32px !important;
        width: auto !important;
        max-width: 115px !important;
        object-fit: contain !important;
        object-position: left center !important;
        margin-left: 0 !important;
    }

    /* Top navbar: HIDE Cart, Wishlist, User Menu on mobile & tab (now in bottom bar & menu) */
    .navbar .cart-icon,
    .navbar .watchlist-icon,
    .navbar .user-menu {
        display: none !important;
    }

    /* 2. Actions wrapper containing Search Box (placed on the left side of Toggle Icon) */
    .navbar .nav-actions {
        order: 2 !important;
        display: flex !important;
        align-items: center !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 0.5rem 0 0.55rem !important;
        width: auto !important;
        max-width: none !important;
    }

    /* Highly Professional Flexible Search Box */
    .navbar .search-box {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        background: #f1f5f9 !important;
        border: 1.5px solid #e2e8f0 !important;
        border-radius: 999px !important;
        padding: 0 0.85rem !important;
        height: 40px !important;
        box-sizing: border-box !important;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
        position: relative !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    }

    .navbar .search-box:focus-within {
        background: #ffffff !important;
        border-color: var(--primary-color, #f02121) !important;
        box-shadow: 0 0 0 3.5px rgba(240, 33, 33, 0.12), 0 4px 14px rgba(0, 0, 0, 0.06) !important;
    }

    .navbar .search-box input {
        width: 100% !important;
        flex: 1 1 auto !important;
        border: none !important;
        background: transparent !important;
        outline: none !important;
        font-size: 0.86rem !important;
        font-weight: 500 !important;
        color: #0f172a !important;
        padding: 0 0.45rem !important;
        height: 100% !important;
    }

    .navbar .search-box input::placeholder {
        color: #94a3b8 !important;
        font-size: 0.84rem !important;
    }

    .navbar .search-box i {
        color: #94a3b8 !important;
        font-size: 0.9rem !important;
        flex-shrink: 0 !important;
        transition: color 0.2s ease !important;
    }

    .navbar .search-box:focus-within i {
        color: var(--primary-color, #f02121) !important;
    }

    /* 3. Toggle Icon on the Right */
    .nav-toggle {
        display: flex !important;
        order: 3 !important;
        margin: 0 !important;
        width: 38px !important;
        height: 38px !important;
        background: #f8fafc !important;
        border: 1.5px solid #e2e8f0 !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
        transition:
            background 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important,
            border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important,
            box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important,
            transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    .nav-toggle:active {
        transform: scale(0.88) !important;
        background: #f1f5f9 !important;
        transition: transform 0.1s ease !important;
    }

    @media (max-width: 480px) {
        .navbar .container {
            padding: 0 0.75rem !important;
            gap: 0 !important;
        }

        .navbar .logo img,
        .navbar .logo .logo-img {
            height: 30px !important;
            max-width: 90px !important;
        }

        .navbar .nav-actions {
            margin: 0 0.45rem 0 0.55rem !important;
        }

        .navbar .search-box {
            height: 38px !important;
            padding: 0 0.75rem !important;
        }

        .nav-toggle {
            width: 38px !important;
            height: 38px !important;
        }
    }

    @media (max-width: 360px) {
        .navbar .container {
            padding: 0 0.5rem !important;
        }

        .navbar .logo img,
        .navbar .logo .logo-img {
            height: 26px !important;
            max-width: 75px !important;
        }

        .navbar .nav-actions {
            margin: 0 0.35rem 0 0.4rem !important;
        }

        .navbar .search-box {
            height: 36px !important;
            padding: 0 0.55rem !important;
        }

        .navbar .search-box input {
            font-size: 0.8rem !important;
        }

        .nav-toggle {
            width: 34px !important;
            height: 34px !important;
        }
    }

    .product-detail-wrap,
    .cart-page-grid,
    .checkout-grid,
    .story-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-edit-grid {
        grid-template-columns: 1fr;
    }

    .track-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
}

/* ===== TABLET & MOBILE DRAWER (<=1024px) ===== */
@media (max-width: 1024px) {
    .nav-links {
        position: fixed;
        top: 54px;
        right: 0;
        width: min(86vw, 340px);
        min-width: 250px;
        height: calc(100vh - 54px);
        height: calc(100dvh - 54px);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        background: #ffffff !important;
        border-left: 1px solid #e2e8f0;
        border-top: 1px solid #e2e8f0;
        padding: 0.65rem 0.85rem 1.5rem;
        gap: 0;
        box-shadow: -10px 0 28px rgba(15, 23, 42, 0.08);
        transform: translate3d(100%, 0, 0);
        -webkit-transform: translate3d(100%, 0, 0);
        transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 10010 !important;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        display: flex;
        pointer-events: none;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        contain: paint;
        isolation: isolate;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    }

    .nav-links.open {
        transform: translate3d(0, 0, 0) !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        pointer-events: auto !important;
    }

    .nav-links li {
        width: 100%;
        list-style: none;
    }

    .nav-links li a {
        display: flex;
        align-items: center;
        padding: 0.82rem 1rem;
        color: #1e293b;
        font-weight: 600;
        font-size: 0.95rem;
        background: #f8fafc;
        margin: 0.3rem 0;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        text-decoration: none;
        transition:
            background 0.22s ease,
            color 0.22s ease,
            border-color 0.22s ease,
            transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
            box-shadow 0.22s ease;
    }

    .nav-links li a:hover,
    .nav-links li a:focus-visible {
        background: #fff1f1;
        color: var(--primary-color, #f02121);
        border-color: #fca5a5;
        transform: translateX(-2px);
        box-shadow: 0 2px 12px rgba(240, 33, 33, 0.08);
    }

    .nav-links li a:active {
        transform: scale(0.97);
        background: #ffe4e4;
    }

    .nav-links li a i {
        margin-right: 0.8rem;
        color: var(--primary-color, #f02121);
        min-width: 22px;
    }

    /* .nav-close-row removed - single navbar toggle button is used */

    .mobile-only-nav {
        display: block;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px dashed #e2e8f0;
    }

    .navbar-backdrop {
        display: block;
        position: fixed;
        top: 54px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.3) !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 10000 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        will-change: opacity;
    }

    .navbar-backdrop.open {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Scroll lock on body only — avoids layout shift / scrollbar flash on html */
    body.nav-open {
        overflow: hidden !important;
        overscroll-behavior: none !important;
        touch-action: none;
    }

    /* Outside of navLinks is strictly non-touchable while menu is open */
    body.nav-open> :not(.navbar):not(.navbar-backdrop) {
        pointer-events: none !important;
        user-select: none !important;
    }
}

/* ===== TABLET 768px ===== */
@media (max-width: 768px) {

/* ----- HERO ----- */
.hero {
    padding: 2rem 0 1.75rem;
    border-radius: 0 0 22px 22px;
}

.hero-text h1,
.hero-text h2 {
    font-size: 2rem;
}

.hero-text p {
    font-size: 0.95rem;
    margin: 0.9rem 0 1.2rem;
}

.hero-image {
    width: 100%;
    max-width: 100%;
    padding: 0;
    min-height: 280px;
    max-height: 360px;
}

.hero-image img {
    max-height: 100%;
    object-fit: cover;
}

/* ----- FEATURES / BEST GRID ----- */
.features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.best-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* ----- FOOTER ----- */
.footer {
    border-radius: 0;
}


/* ----- ADMIN ----- */
.admin-layout {
    flex-direction: column;
}

.admin-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.8rem 1rem;
    gap: 0.5rem;
}

.admin-brand {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 1.1rem;
}

.admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.admin-nav a {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.admin-main {
    padding: 1rem;
}

.admin-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ----- HERO MOBILE ----- */
.hero .container {
    flex-direction: column;
    align-items: stretch;
}

.hero-text,
.hero-image {
    flex: 1 1 100%;
}

.hero-image {
    min-height: 260px;
    padding-top: 1rem;
}

.hero-image img {
    border-radius: 28px;
}

/* ----- PROFILE ----- */
.account-wrapper {
    grid-template-columns: 1fr !important;
}

.account-sidebar {
    position: static !important;
}

/* ----- MODAL ----- */
.modal-content {
    width: 95vw !important;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem !important;
}

/* ----- DATE FILTER ----- */
.date-filter-bar {
    flex-direction: column;
    align-items: stretch;
}

.date-filter-custom {
    margin-left: 0;
}

.date-filter-presets {
    justify-content: flex-start;
}

/* ----- CARDS ----- */
.stat-card {
    gap: 0.8rem;
    padding: 1.2rem;
}

.stat-info h3 {
    font-size: 1.3rem;
}

/* ----- FORMS ----- */
.form-row {
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.form-row .form-group,
.form-row .form-group.flex-2 {
    flex: none;
    width: 100%;
}

.product-edit-grid {
    gap: 1rem;
}
}

/* ===== MOBILE 480px ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .nav-actions .cart-icon {
        font-size: 1.25rem;
    }

    /* ----- HERO ----- */
    .hero {
        padding: 2rem 0;
    }

    .hero-text h2 {
        font-size: 1.7rem;
    }

    .hero-image {
        font-size: 4rem;
        display: none;
    }

    /* ----- GRIDS ----- */
    .product-grid,
    .best-grid,
    .trending-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    /* .category-grid removed — now uses .category-scroll-row */

    .features-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.35rem !important;
    }

    /* ----- CART PANEL ----- */
    .cart-panel {
        width: 100%;
        max-width: 100vw;
        border-radius: 0;
    }

    /* ----- FILTER BAR ----- */
    .filter-bar {
        gap: 0.4rem 0.6rem;
    }

    .filter-btn {
        padding: 0.3rem 1rem;
        font-size: 0.8rem;
    }


    /* ----- ADMIN ----- */
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: flex;
        width: 100%;
        overflow-x: auto;
        padding: 0.6rem 0.8rem;
        background: var(--primary-deep, #143014);
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .admin-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        min-width: max-content;
        gap: 0.4rem;
    }

    .admin-nav a {
        white-space: nowrap;
        scroll-snap-align: start;
        font-size: 0.8rem;
        padding: 0.45rem 0.75rem;
    }

    .admin-brand {
        display: none;
    }

    .admin-main {
        padding: 0.85rem;
    }

    /* ----- BUTTONS ----- */
    .btn {
        font-size: 0.88rem;
        padding: 0.55rem 1.2rem;
    }

    .btn-sm {
        font-size: 0.8rem;
        padding: 0.35rem 0.8rem;
    }

    /* ----- TABLE ----- */
    .admin-table {
        font-size: 0.82rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.6rem 0.5rem;
    }

    /* ----- PAGE HEADER ROWS ----- */
    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    /* ----- PROFILE ----- */
    .account-sidebar {
        padding: 1rem;
    }


}

/* ===== TINY PHONES 360px ===== */
@media (max-width: 360px) {

    .product-grid,
    .best-grid,
    .trending-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    /* .category-grid removed — now uses .category-scroll-row */

    .hero-text h2 {
        font-size: 1.5rem;
    }


    .nav-links {
        width: min(86vw, 340px);
        min-width: auto;
    }

    .nav-toggle {
        width: 36px;
        height: 36px;
    }

    .logo {
        font-size: 1.5rem;
    }
}

/* ===== EXTRA SMALL PHONES 320px ===== */
@media (max-width: 320px) {
    .nav-links {
        width: min(88vw, 340px);
    }


    .cart-icon {
        font-size: 1.15rem;
    }
}

/* ===== UTILITY: HIDE ON MOBILE ===== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}


/* ----------- Mobile‑first enhancements (≤480px) ----------- */
@media (max-width: 480px) {

    /* Ensure containers have proper padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Cart page: stack grid columns */
    .cart-page-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .cart-table {
        width: 100%;
        overflow-x: auto;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }

    .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .cart-item-remove {
        padding: 0.3rem;
        font-size: 0.9rem;
    }

    /* Navbar: drawer width consistency */
    .nav-links {
        width: min(86vw, 340px);
        max-width: 86vw;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-actions .cart-icon {
        font-size: 1.2rem;
    }

    /* Hero images scale */
    .hero-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* Forms: full‑width inputs */
    .form-control,
    .btn {
        width: 100%;
        box-sizing: border-box;
    }

    .summary-card {
        padding: 1rem;
    }

    .summary-row {
        font-size: 0.9rem;
    }
}

/* ----------- Slightly larger tablets (481px‑768px) ----------- */
@media (min-width: 481px) and (max-width: 768px) {
    .cart-page-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        width: min(86vw, 340px);
    }

    .hero-image img {
        max-height: 320px;
    }
}

/* ---------- Cart Page Grid ---------- */
.cart-page-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .cart-page-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure container has side padding on small screens */
@media (max-width: 480px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        display: flex !important;
        width: 100%;
        overflow-x: auto;
        padding: 0.6rem;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .admin-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        min-width: max-content;
    }

    .admin-nav a {
        white-space: nowrap;
        scroll-snap-align: start;
        font-size: 0.78rem;
        padding: 0.4rem 0.7rem;
        gap: 0.3rem;
    }

    .admin-brand {
        display: none;
    }
}

/* ==========================================
   ULTRA-WIDE & 4K DISPLAY RESPONSIVENESS (≥1441px & ≥1920px)
   ========================================== */
@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }

    .admin-main {
        max-width: 1600px;
        margin: 0 auto;
    }
}

@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, 250px) !important;
        gap: 1.8rem !important;
        justify-content: center !important;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* =========================================================
   UNIVERSAL PRODUCT GRID & CARD RESPONSIVENESS (DESKTOP & TABLET >768px)
   Ensures card width stays strictly fixed (250px) across desktop & laptop
   while rows and columns adapt properly across all screens
   ========================================================= */
@media (min-width: 769px) {
    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, 250px) !important;
        gap: 1.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        justify-content: center !important;
    }

    .product-card {
        width: 250px !important;
        max-width: 250px !important;
        min-width: 250px !important;
        height: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .product-grid {
        gap: 1.2rem !important;
    }
}

/* ==========================================
   ULTRA-SMALL MOBILE RESPONSIVENESS (≤320px & ≤360px)
   ========================================== */
@media (max-width: 360px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.82rem;
    }

    .product-card {
        padding: 0.65rem;
    }

    .product-card-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 0.95rem;
    }
}

@media (max-width: 320px) {

    html,
    body {
        overflow-x: clip !important;
    }

    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .nav-actions {
        gap: 0.3rem;
    }

    .logo {
        font-size: 1.35rem;
    }

    .cart-icon,
    .watchlist-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
}

/* Product Card Mobile Responsive Fixes - 2 Cards Per Row for All Product Cards */
@media (max-width: 768px) {

    /* Professional Sleek 2-Card Mobile Layout */
    .product-grid,
    .best-grid,
    .trending-grid,
    .products-grid,
    .related-product-grid,
    .wishlist-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        justify-content: stretch !important;
    }

    .product-card,
    .trending-card,
    .related-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        border-radius: 12px !important;
        border: 1px solid #edf1f7 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
        background: #ffffff !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        margin: 0 !important;
    }

    .product-img-box,
    .trending-img-box,
    .related-card-img-wrap {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        aspect-ratio: 4 / 5 !important;
        height: auto !important;
        max-height: 215px !important;
        background: #f8fafc !important;
        position: relative !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-bottom: 1px solid #f1f4f9 !important;
    }

    .product-img-box img,
    .trending-img-box img,
    .related-card-img-wrap img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        padding: 0 !important;
    }

    .product-emoji-placeholder,
    .trending-emoji-placeholder {
        font-size: 2.8rem !important;
    }

    .trending-track-wrapper {
        position: relative !important;
        width: 100% !important;
    }

    .trending-scroll-track {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .trending-scroll-track::-webkit-scrollbar {
        display: none !important;
    }

    /* Hide nav arrows on mobile and tablet for trending products */
    .trending-scroll-btn {
        display: none !important;
    }

    .product-quick-wish,
    .trending-quick-wish,
    .related-wishlist-btn {
        width: 28px !important;
        height: 28px !important;
        top: 6px !important;
        right: 6px !important;
        font-size: 0.74rem !important;
        border-radius: 50% !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    }

    .product-rating-pill {
        bottom: 6px !important;
        left: 6px !important;
        padding: 2px 5px !important;
        border-radius: 4px !important;
        font-size: 0.65rem !important;
        gap: 2px !important;
    }

    .product-rating-pill .rating-num {
        font-size: 0.65rem !important;
        font-weight: 700 !important;
    }

    .product-rating-pill .rating-star {
        font-size: 0.58rem !important;
    }

    .product-card-badge-wrap,
    .trending-card-badge-wrap,
    .related-card-badges {
        top: 8px !important;
        left: 8px !important;
        transform: scale(0.85);
        transform-origin: top left;
    }

    .product-card-content,
    .trending-card-content,
    .related-card-body {
        padding: 0.65rem 0.55rem !important;
        gap: 0.3rem !important;
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    .product-rating,
    .trending-rating,
    .related-card-rating {
        font-size: 0.72rem !important;
        gap: 0.2rem !important;
        margin-bottom: 0 !important;
    }

    .product-card-name,
    .trending-card-name,
    .related-card-title {
        font-size: 0.84rem !important;
        line-height: 1.25 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        min-height: 2.1em !important;
        margin: 0 !important;
    }

    .product-card-footer,
    .trending-card-footer,
    .related-card-footer {
        padding-top: 0.45rem !important;
        margin-top: 0.2rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.35rem !important;
        border-top: 1px dashed var(--border-color) !important;
    }

    .product-price-box,
    .trending-price-box,
    .related-card-price {
        display: flex !important;
        align-items: baseline !important;
        justify-content: flex-start !important;
    }

    .product-price,
    .trending-price,
    .related-price-current,
    .product-selling-price {
        font-size: 0.94rem !important;
        font-weight: 800 !important;
    }

    .product-price-row {
        display: flex !important;
        align-items: baseline !important;
        gap: 5px !important;
        flex-wrap: wrap !important;
        margin-top: 2px !important;
    }

    .product-mrp {
        font-size: 0.72rem !important;
        color: #94a3b8 !important;
        text-decoration: line-through !important;
    }

    .product-discount-pill {
        font-size: 0.7rem !important;
        color: #16a34a !important;
        font-weight: 700 !important;
    }

    .product-rating-pill {
        bottom: 6px !important;
        left: 6px !important;
        padding: 1px 5px !important;
    }

    .product-rating-pill .rating-num {
        font-size: 0.68rem !important;
    }

    .product-rating-pill .rating-star {
        font-size: 0.6rem !important;
    }

    .product-quick-wish,
    .trending-quick-wish {
        top: 6px !important;
        right: 6px !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 0.74rem !important;
    }



    .btn-product-buy,
    .btn-trending-buy,
    .btn-move-cart,
    .related-card-btn,
    .btn-related-buy {
        width: 100% !important;
        padding: 0.42rem 0.5rem !important;
        font-size: 0.76rem !important;
        justify-content: center !important;
        border-radius: 6px !important;
        gap: 0.25rem !important;
    }

    .btn-product-buy i,
    .btn-trending-buy i,
    .btn-move-cart i,
    .related-card-btn i,
    .btn-related-buy i {
        font-size: 0.72rem !important;
    }

    .wishlist-actions {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.3rem !important;
    }

    .wishlist-actions .btn-move-cart {
        flex: 1 !important;
    }

    .btn-remove-wishlist {
        width: 28px !important;
        height: 28px !important;
        flex-shrink: 0 !important;
    }

    /* Features Trust Bar - Compact, Small Type, Zero Waste */
    .features {
        padding: 0.4rem 0 !important;
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        padding: 0.65rem 0.5rem !important;
        gap: 0.35rem !important;
        border-radius: var(--radius-md) !important;
    }

    .feature-item {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 0.2rem 0.15rem !important;
        gap: 0.25rem !important;
    }

    .feature-item:not(:last-child) {
        border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
    }

    .feature-item i {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        font-size: 0.92rem !important;
        border-radius: 8px !important;
        margin: 0 !important;
    }

    .feature-item-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    .feature-item h4 {
        font-size: 0.72rem !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.25 !important;
        font-weight: 700 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .feature-item p {
        font-size: 0.62rem !important;
        margin: 0 !important;
        line-height: 1.25 !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        color: var(--text-muted) !important;
    }

    .category-item span {
        font-size: 0.76rem !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.2 !important;
    }
}

@media (max-width: 360px) {

    h2,
    .products-title,
    .trending-title,
    .section-title {
        font-size: 1.12rem !important;
    }

    .trending-view-all {
        padding: 0.3rem 0.65rem !important;
        font-size: 0.72rem !important;
    }

    .features-grid {
        padding: 0.5rem 0.25rem !important;
        gap: 0.2rem !important;
    }

    .feature-item i {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        font-size: 0.8rem !important;
    }

    .feature-item h4 {
        font-size: 0.66rem !important;
        white-space: normal !important;
        overflow: visible !important;
        line-height: 1.2 !important;
    }

    .feature-item p {
        font-size: 0.58rem !important;
        white-space: normal !important;
        overflow: visible !important;
        line-height: 1.2 !important;
    }

    .category-item span {
        font-size: 0.7rem !important;
    }

    .product-grid,
    .best-grid,
    .trending-grid,
    .products-grid,
    .related-product-grid,
    .wishlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }



    .product-card-content,
    .trending-card-content,
    .related-card-body {
        padding: 0.5rem 0.4rem !important;
    }

    .product-card-name,
    .trending-card-name,
    .related-card-title {
        font-size: 0.78rem !important;
    }

    .product-price,
    .trending-price,
    .related-price-current {
        font-size: 0.9rem !important;
    }

    .btn-product-buy,
    .btn-trending-buy,
    .btn-move-cart,
    .related-card-btn,
    .btn-related-buy {
        padding: 0.36rem 0.4rem !important;
        font-size: 0.72rem !important;
    }
}

/* ===== MOBILE RESPONSIVE FOR PROFESSIONAL FILTERS (BOTTOM SHEET PATTERN) ===== */
@media (max-width: 768px) {
    .best-sellers-section {
        padding: 1.25rem 0 1.5rem !important;
        margin: 1rem 0 !important;
        border-radius: 18px !important;
    }

    /* Hide custom slider dots and nav arrows on mobile */
    .best-sellers-section .custom-slider-dots,
    .best-sellers-section .custom-slider-nav,
    .best-sellers-section .custom-slider-btn {
        display: none !important;
    }

    .products-section-header {
        margin-bottom: 0.75rem;
    }

    .trending-section-header {
        margin-bottom: 0.85rem !important;
        gap: 0.5rem !important;
    }

    .trending-view-all {
        padding: 0.38rem 0.85rem !important;
        font-size: 0.78rem !important;
        font-weight: 600 !important;
    }

    .load-more-wrap {
        margin-top: 1.25rem !important;
    }

    .btn-load-more {
        padding: 0.4rem 1.1rem !important;
        font-size: 0.78rem !important;
    }

    h2,
    .products-title,
    .trending-title,
    .section-title {
        font-size: 1.22rem !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        letter-spacing: -0.015em !important;
    }

    .section-title {
        margin-bottom: 0.9rem !important;
        gap: 0.5rem !important;
    }

    .pro-filter-wrapper {
        padding: 0.45rem 0.75rem;
        gap: 0;
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
    }

    /* Streamline mobile: Hide horizontal categories pill row since Categories is now in the filter dropdown */
    .pro-filter-categories {
        display: none !important;
    }

    .filter-search-box {
        display: none !important;
    }

    .pro-filter-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        padding-top: 0;
        border-top: none;
    }


    /* Responsive Icon-Only Filter Action Strip */
    .filter-controls-group {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.4rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0;
    }

    .filter-controls-group::-webkit-scrollbar {
        display: none;
    }

    .filter-dropdown {
        flex-shrink: 0;
    }

    /* On responsive, hide button label text and dropdown chevron; show only icons */
    .filter-dropdown-btn span,
    .filter-dropdown-btn .arrow-icon,
    .btn-clear-filters span {
        display: none !important;
    }

    .filter-dropdown-btn,
    .btn-clear-filters {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
        position: relative;
        flex-shrink: 0;
        gap: 0 !important;
        background: #ffffff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
        transition: all 0.2s ease;
    }

    .filter-dropdown-btn i,
    .btn-clear-filters i {
        font-size: 1.05rem;
        margin: 0 !important;
        color: #171717;
    }

    .filter-dropdown-btn:hover,
    .filter-dropdown.open .filter-dropdown-btn {
        background: #fff0f0;
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .filter-dropdown-btn:hover i,
    .filter-dropdown.open .filter-dropdown-btn i {
        color: var(--primary-color);
    }

    /* Active Filter indicator badge on icon */
    .filter-dropdown-btn.has-value {
        background: #fff0f0 !important;
        border-color: var(--primary-color) !important;
        color: var(--primary-color) !important;
    }

    .filter-dropdown-btn.has-value i {
        color: var(--primary-color) !important;
    }

    .filter-dropdown-btn.has-value::after {
        content: '';
        position: absolute;
        top: 2px;
        right: 2px;
        width: 9px;
        height: 9px;
        background: var(--primary-color);
        border: 2px solid #ffffff;
        border-radius: 50%;
        box-shadow: 0 1px 3px rgba(240, 33, 33, 0.45);
    }

    .btn-clear-filters {
        background: #ffffff;
        border: 1.5px solid #e5e7eb;
        color: #ef4444;
    }

    .btn-clear-filters i {
        color: #ef4444;
    }

    .btn-clear-filters:hover {
        background: #fef2f2;
        border-color: #ef4444;
    }

    /* Transform dropdown into native Mobile Bottom Sheet Modal */
    .filter-dropdown-menu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        border: none !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3) !important;
        z-index: 9999 !important;
        padding: 0 !important;
        max-height: 82vh !important;
        display: flex !important;
        flex-direction: column !important;
        background: #ffffff !important;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
        opacity: 0;
        pointer-events: none;
    }

    .filter-dropdown.open .filter-dropdown-menu {
        transform: translateY(0);
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .filter-dropdown-menu.is-dragging {
        transition: none !important;
    }

    .mobile-sheet-header {
        display: flex !important;
    }

    .mobile-sheet-footer {
        display: block !important;
    }

    .filter-options-scroll {
        flex: 1 1 auto;
        max-height: calc(82vh - 140px);
        padding: 0.5rem 1rem;
        overscroll-behavior: contain;
    }

    .filter-radio-label {
        padding: 0.85rem 0.75rem;
        font-size: 0.95rem;
        border-bottom: 1px solid #f3f4f6;
        min-height: 48px;
    }

    .filter-radio-label:last-child {
        border-bottom: none;
    }

    .custom-price-box {
        padding: 0.85rem 1rem 1rem;
    }

    .custom-price-inputs {
        gap: 0.5rem;
    }

    .price-field input {
        padding: 0.65rem 0.5rem 0.65rem 1.6rem;
        font-size: 0.92rem;
    }

    .btn-apply-price {
        padding: 0.65rem 1.15rem;
        font-size: 0.88rem;
    }

    .pro-filter-statusbar {
        font-size: 0.82rem;
        gap: 0.5rem;
    }

    /* Categories Page Mobile App Experience (Flipkart Native Layout) */
    body.is-categories-page .navbar {
        display: none !important;
    }
    body.is-categories-page {
        padding-top: 0 !important;
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
        overflow: hidden !important;
    }
    body.is-categories-page .copyright-footer {
        display: none !important;
    }
}