/* ============================================================
   Unique Skins — Full Responsive Layout
   Breakpoints:
     • Mobile  : ≤ 480px (small phones)
     • Mobile  : ≤ 768px (phones & small tablets)
     • Tablet  : 769px – 1024px
     • Desktop : 1025px – 1399px
     • Large   : ≥ 1400px
   ============================================================ */

/* ── CSS Custom Props ── */
:root {
    --mob-nav-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ── Global Resets ── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   AUTH PAGE — Hide useless elements on login/register screen
   (works on ALL screen sizes — desktop, tablet, mobile)
   ============================================================ */

/* Hide search bar on auth page — not needed when logging in */
body.view-auth-active .search-box {
    display: none !important;
}

/* Hide location selector on auth page */
body.view-auth-active .location-selector {
    display: none !important;
}

/* ── Hidden on desktop; activated on mobile ── */
.mobile-header-tools,
.mobile-bottom-nav,
.mobile-product-bar,
.mobile-drawer,
.mobile-drawer-overlay {
    display: none;
}

/* ============================================================
   LARGE DESKTOP (≥ 1400px)
   ============================================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
        margin: 0 auto;
    }

    .cat-products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================================================
   DESKTOP (1025px – 1399px)
   ============================================================ */
@media (min-width: 1025px) and (max-width: 1399px) {
    .container {
        max-width: 1200px;
        padding: 20px 24px;
    }

    .cat-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-card {
        width: 210px;
    }
}

/* ============================================================
   TABLET (769px – 1024px)
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    header {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 10px;
    }

    .logo-area {
        flex: 1;
        min-width: 0;
    }

    .logo {
        font-size: 20px;
    }

    .search-box {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        margin: 0;
    }

    .search-input-wrapper input {
        font-size: 15px;
        padding: 11px 14px;
    }

    .nav-actions {
        gap: 14px;
    }

    .action-btn {
        font-size: 11px;
    }

    .action-icon {
        font-size: 18px;
    }

    .container {
        padding: 14px 16px;
    }

    .hero-carousel {
        height: 240px;
    }

    .category-row {
        gap: 12px;
    }

    .cat-rect-card {
        min-width: 120px;
        padding: 12px 18px;
    }

    .cat-rect-img {
        width: 50px;
        height: 50px;
    }

    .cat-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .cat-products-grid .product-card {
        width: 100%;
    }

    .product-card {
        width: 200px;
    }

    .p-view-container {
        padding: 24px;
        gap: 30px;
        flex-direction: column;
    }

    .p-gallery-wrapper,
    .p-info-col {
        min-width: 0;
        width: 100%;
    }

    .p-gallery-wrapper {
        flex-direction: row;
    }

    .p-title {
        font-size: 26px;
    }

    .p-selling-price {
        font-size: 34px;
    }

    .cart-layout {
        flex-direction: column;
    }

    .cart-summary {
        position: static;
    }

    .cart-item-img {
        width: 90px;
        height: 90px;
    }

    .profile-layout {
        flex-direction: column;
    }

    .profile-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        overflow-x: auto;
        padding: 12px 16px;
        -webkit-overflow-scrolling: touch;
    }

    .prof-tab {
        white-space: nowrap;
        margin-bottom: 0;
        margin-right: 8px;
        padding: 10px 14px;
    }

    .profile-content {
        padding: 24px;
    }

    .footer-grid {
        padding: 36px 20px;
        gap: 20px;
    }

    .footer-col {
        min-width: 180px;
    }

    .block-grid {
        padding: 16px;
        gap: 16px;
    }

    .auth-container {
        padding: 40px 32px;
    }
}

/* ============================================================
   PHONE & SMALL TABLET (≤ 768px) — MOBILE SHELL
   ============================================================ */
@media (max-width: 768px) {

    /* === BODY PADDING for fixed bottom nav === */
    body.mob-enabled {
        padding-bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 12px);
    }

    /* Auth page still needs padding since bottom nav stays visible */
    body.mob-enabled.view-auth-active {
        padding-bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 12px);
    }

    /* === HEADER === */
    body.mob-enabled header {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    body.mob-enabled .logo-area {
        flex: 1;
        min-width: 0;
        gap: 6px;
    }

    body.mob-enabled .logo {
        font-size: 17px;
        letter-spacing: -0.5px;
    }

    body.mob-enabled .header-custom-btn {
        order: 2;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 14px;
        justify-content: center;
        box-shadow: 0 10px 24px rgba(161,0,255,0.25);
    }

    body.mob-enabled .header-custom-btn span:last-child {
        display: none;
    }

    body.mob-enabled .header-custom-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    /* Hide location selector on mobile */
    body.mob-enabled .location-selector {
        display: none;
    }

    /* Show mobile icon buttons */
    body.mob-enabled .mobile-header-tools {
        order: 2;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    body.mob-enabled .mobile-icon-btn {
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 10px;
        background: #f5f5f5;
        font-size: 19px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        -webkit-tap-highlight-color: transparent;
    }

    body.mob-enabled .mobile-icon-btn .badge {
        top: 2px;
        right: 2px;
    }

    /* Hide desktop nav actions */
    body.mob-enabled .nav-actions {
        display: none;
    }

    /* Full-width search bar */
    body.mob-enabled .search-box {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        margin: 0;
    }

    body.mob-enabled .search-input-wrapper input {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 13px 14px;
    }

    /* === CONTAINER === */
    body.mob-enabled .container {
        padding: 10px 12px;
    }

    body.mob-enabled .home-special-section {
        margin: 0 0 12px;
        padding: 10px 0 2px;
    }

    body.mob-enabled .home-special-head {
        margin-bottom: 8px;
        align-items: flex-start;
    }

    body.mob-enabled .home-special-title {
        font-size: 17px;
    }

    body.mob-enabled .home-special-subtitle {
        font-size: 11px;
        line-height: 1.3;
    }

    body.mob-enabled .home-special-grid {
        display: flex;
        gap: 8px;
        padding: 2px 2px 8px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    body.mob-enabled .home-special-grid::-webkit-scrollbar {
        display: none;
    }

    body.mob-enabled .special-product-card {
        width: 124px;
        min-width: 124px;
        box-shadow: 0 8px 20px rgba(31,41,55,0.08);
    }

    body.mob-enabled .special-offer-pill {
        top: 7px;
        left: 7px;
        padding: 4px 7px;
        font-size: 9px;
    }

    body.mob-enabled .special-product-body {
        padding: 7px 8px 8px;
    }

    body.mob-enabled .special-product-name {
        font-size: 11px;
        min-height: 28px;
        line-height: 1.25;
    }

    body.mob-enabled .special-product-variant,
    body.mob-enabled .special-rating-row,
    body.mob-enabled .special-mrp,
    body.mob-enabled .special-save {
        font-size: 9px;
    }

    body.mob-enabled .special-rating-row,
    body.mob-enabled .special-price-row {
        margin-top: 5px;
    }

    body.mob-enabled .special-price {
        font-size: 13px;
    }

    /* === HERO CAROUSEL === */
    body.mob-enabled .hero-carousel {
        min-height: 160px;
        height: auto;
        margin-bottom: 12px;
        border-radius: 0;
    }

    body.mob-enabled .hero-carousel.has-uploaded-banners {
        min-height: 0;
    }

    body.mob-enabled .slide {
        min-height: 160px;
        font-size: 32px;
    }

    body.mob-enabled .slide.banner-image-slide {
        min-height: 0;
    }

    body.mob-enabled .slide img {
        height: auto;
        max-height: min(70vw, 360px);
        object-fit: contain;
    }

    body.mob-enabled .hero-carousel.has-uploaded-banners .slide img {
        width: 100%;
        height: auto;
        max-height: none;
    }

    /* === CATEGORY ROW === */
    body.mob-enabled .category-row {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 8px 0 14px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.mob-enabled .category-row::-webkit-scrollbar {
        display: none;
    }

    body.mob-enabled .cat-rect-card {
        min-width: 100px;
        flex-shrink: 0;
        padding: 10px 14px;
    }

    body.mob-enabled .cat-rect-img {
        width: 48px;
        height: 48px;
    }

    body.mob-enabled .cat-rect-title {
        font-size: 11px;
    }

    /* === DISCOUNT BLOCKS === */
    body.mob-enabled .discount-block {
        margin: 14px 0;
        border-radius: 10px;
    }

    body.mob-enabled .block-header {
        padding: 12px 14px;
    }

    body.mob-enabled .block-header h2 {
        font-size: 15px;
    }

    body.mob-enabled .block-grid {
        padding: 10px 12px;
        gap: 10px;
    }

    /* === PRODUCT CARDS === */
    body.mob-enabled .product-card {
        width: 155px;
    }

    body.mob-enabled .prod-info {
        padding: 10px 12px;
    }

    body.mob-enabled .prod-title {
        font-size: 14px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.mob-enabled .prod-price {
        font-size: 17px;
    }

    /* === CATEGORY PAGE === */
    body.mob-enabled .cat-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 12px;
        border-radius: 10px;
        margin-bottom: 16px;
    }

    body.mob-enabled .cat-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    body.mob-enabled .cat-products-grid .product-card {
        width: 100%;
    }

    /* === PRODUCT DETAIL PAGE === */
    body.mob-enabled .p-view-container {
        padding: 14px 12px;
        gap: 16px;
        margin-top: 0;
        border-radius: 10px;
    }

    body.mob-enabled .p-gallery-wrapper {
        flex-direction: column;
        min-width: 0;
        width: 100%;
    }

    body.mob-enabled .p-image-main-container {
        padding: 0;
        aspect-ratio: 1 / 1;
    }

    body.mob-enabled .p-thumbnail-row {
        gap: 8px;
        justify-content: center;
    }

    body.mob-enabled .p-thumbnail {
        width: 56px;
        height: 56px;
        border-radius: 8px;
        padding: 4px;
        flex-shrink: 0;
    }

    body.mob-enabled .p-info-col {
        min-width: 0;
        width: 100%;
    }

    body.mob-enabled .p-title {
        font-size: 20px;
    }

    body.mob-enabled .p-selling-price {
        font-size: 30px;
    }

    body.mob-enabled .p-bio {
        font-size: 14px;
    }

    body.mob-enabled .p-charges-section {
        padding: 14px;
    }

    body.mob-enabled .p-final-total-row {
        font-size: 17px;
    }

    body.mob-enabled .p-final-total-price {
        font-size: 24px;
    }

    body.mob-enabled .p-stock {
        margin-top: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }

    body.mob-enabled .p-stock-board {
        inset: auto 10px 10px 10px;
        min-height: 46px;
        padding: 10px 12px;
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    body.mob-enabled .variant-box {
        width: 85px;
    }

    body.mob-enabled .action-row {
        flex-direction: column;
        gap: 10px;
    }

    body.mob-enabled .action-row .btn-cart,
    body.mob-enabled .action-row .btn-buy {
        width: 100%;
        min-height: 48px;
    }

    /* Hide desktop action row on product view; show sticky bar instead */
    body.mob-enabled.view-product-active .action-row {
        display: none;
    }

    /* === MOBILE STICKY PRODUCT BAR === */
    body.mob-enabled .mobile-product-bar {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--mob-nav-h) + var(--safe-bottom));
        z-index: 1100;
        background: white;
        padding: 10px 12px;
        gap: 10px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        border-top: 1px solid var(--border);
    }

    body.mob-enabled.view-product-active .mobile-product-bar {
        display: flex;
    }

    .mobile-product-bar button {
        flex: 1;
        min-height: 48px;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 800;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-product-bar .mpb-cart {
        background: #ff9f00;
        color: white;
    }

    .mobile-product-bar .mpb-buy {
        background: #fb641b;
        color: white;
    }

    .mobile-product-bar button:disabled {
        background: #cfcfcf;
        color: #ffffff;
        cursor: not-allowed;
    }

    /* === CART PAGE === */
    body.mob-enabled .cart-layout {
        flex-direction: column;
        gap: 14px;
    }

    body.mob-enabled .cart-item {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: start;
        padding: 12px;
        gap: 12px;
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    body.mob-enabled .cart-item-media {
        width: 76px;
        min-width: 76px;
        height: 76px;
        border-radius: 12px;
        padding: 5px;
    }

    body.mob-enabled .cart-item-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    body.mob-enabled .cart-item-title {
        font-size: 16px;
        font-weight: 900;
        line-height: 1.25;
        padding-right: 66px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.mob-enabled .cart-item-var {
        font-size: 13px;
        margin-bottom: 6px;
    }

    body.mob-enabled .cart-item-meta {
        gap: 6px;
        margin: 6px 0 2px;
    }

    body.mob-enabled .cart-meta-pill {
        padding: 6px 9px;
        font-size: 11px;
    }

    body.mob-enabled .cart-qty-controls {
        margin-top: 8px;
        gap: 8px;
    }

    body.mob-enabled .cart-stepper-btn {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    body.mob-enabled .cart-stepper-value {
        width: 34px;
        font-size: 13px;
    }

    body.mob-enabled .cart-qty-note {
        display: none;
    }

    body.mob-enabled .cart-addon-title {
        font-size: 9px;
        margin-bottom: 8px;
    }

    body.mob-enabled .cart-addon-box {
        grid-column: 1 / -1;
        margin-top: 10px;
        margin-left: -88px;
        width: calc(100% + 88px);
        box-sizing: border-box;
        padding: 10px;
        border-radius: 12px;
    }

    body.mob-enabled .cart-addon-row {
        align-items: center;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
        gap: 8px;
        font-size: 13px;
        margin-bottom: 7px;
    }

    body.mob-enabled .cart-addon-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.mob-enabled .cart-addon-value {
        gap: 4px;
        padding: 5px 7px;
    }

    body.mob-enabled .cart-addon-value small {
        font-size: 10px;
    }

    body.mob-enabled .cart-addon-value b {
        font-size: 11px;
    }

    body.mob-enabled .cart-price-breakdown {
        grid-column: 1 / -1;
        margin-top: 10px;
        margin-left: -88px;
        width: calc(100% + 88px);
        box-sizing: border-box;
        padding: 10px;
        border-radius: 12px;
    }

    body.mob-enabled .cart-price-breakdown-row {
        display: grid;
        grid-template-columns: minmax(96px, 0.7fr) minmax(0, 1.3fr);
        gap: 10px;
        font-size: 12px;
        margin-bottom: 5px;
        line-height: 1.35;
    }

    body.mob-enabled .cart-price-breakdown-row strong {
        text-align: right;
        word-break: keep-all;
    }

    body.mob-enabled .cart-price-breakdown-final {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 10px;
        border-radius: 10px;
        font-size: 13px;
    }

    body.mob-enabled .cart-price-breakdown-final span:last-child {
        font-size: 15px;
        line-height: 1.25;
        text-align: right;
        word-break: keep-all;
    }

    body.mob-enabled .cart-stock-board {
        inset: auto 6px 6px 6px;
        padding: 5px 8px;
        font-size: 8px;
    }

    body.mob-enabled .cart-item-price {
        font-size: 18px;
    }

    body.mob-enabled .remove-cart-btn {
        top: 10px;
        right: 10px;
        font-size: 11px;
        padding: 5px 8px;
    }

    body.mob-enabled .cart-summary {
        position: static;
        border-radius: 10px;
    }

    body.mob-enabled .summary-total {
        font-size: 20px;
    }

    body.mob-enabled .checkout-form-container {
        padding: 20px 14px;
    }

    /* === AUTH PAGES === */
    body.mob-enabled .auth-wrapper {
        padding: 14px 12px;
        min-height: auto;
        align-items: flex-start;
        padding-top: 30px;
    }

    body.mob-enabled .auth-container {
        padding: 24px 18px;
        border-radius: 16px;
        box-shadow: none;
        border: 1px solid var(--border);
    }

    body.mob-enabled .auth-logo {
        font-size: 24px;
    }

    body.mob-enabled .auth-subtitle {
        font-size: 13px;
    }

    body.mob-enabled .input-field {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 13px 16px;
    }

    body.mob-enabled .otp-box {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    body.mob-enabled .btn-main,
    body.mob-enabled .btn-secondary {
        padding: 14px;
        font-size: 15px;
    }

    /* === MODALS === */
    body.mob-enabled .modal-box {
        max-width: 94%;
        padding: 22px 18px;
        border-radius: 14px;
    }

    body.mob-enabled .modal-title {
        font-size: 18px;
    }

    /* === PROFILE PAGE === */
    body.mob-enabled .profile-layout {
        flex-direction: column;
        min-height: auto;
        border-radius: 10px;
    }

    body.mob-enabled .profile-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 10px 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.mob-enabled .profile-sidebar::-webkit-scrollbar {
        display: none;
    }

    body.mob-enabled .prof-tab {
        white-space: nowrap;
        margin-bottom: 0;
        margin-right: 4px;
        padding: 8px 10px;
        font-size: 12px;
    }

    body.mob-enabled .profile-content {
        padding: 16px 12px;
    }

    body.mob-enabled .profile-container {
        padding: 16px 12px;
        border-radius: 10px;
    }

    body.mob-enabled .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    body.mob-enabled .avatar {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    /* === TOAST NOTIFICATIONS === */
    body.mob-enabled #toastContainer {
        left: 12px;
        right: 12px;
        bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 16px);
    }

    body.mob-enabled.view-auth-active #toastContainer {
        bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 16px);
    }

    /* === GO-TOP BUTTON === */
    body.mob-enabled .go-top {
        bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 68px);
        right: 14px;
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    body.mob-enabled.view-product-active .go-top {
        bottom: calc(var(--mob-nav-h) + var(--safe-bottom) + 125px);
    }

    /* === LIGHTBOX === */
    body.mob-enabled .lightbox-img {
        width: 90vw;
        border: 6px solid #fff;
    }

    body.mob-enabled .lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    body.mob-enabled .lightbox-nav.prev {
        left: 8px;
    }

    body.mob-enabled .lightbox-nav.next {
        right: 8px;
    }

    /* === FOOTER === */
    body.mob-enabled footer {
        margin-top: 30px;
    }

    body.mob-enabled .footer-grid {
        flex-direction: column;
        padding: 24px 16px;
        gap: 20px;
    }

    body.mob-enabled .footer-col {
        min-width: 0;
        flex: 1 1 100%;
    }

    body.mob-enabled .maker-credit {
        font-size: 12px;
        padding: 14px 12px;
    }

    /* === MAP CONTAINER === */
    body.mob-enabled .map-container iframe {
        height: 180px;
    }

    /* === LOCATION MODAL === */
    body.mob-enabled #locationPinModal .modal-box {
        max-width: 98%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* === MOBILE BOTTOM NAV === */
    body.mob-enabled .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--mob-nav-h) + var(--safe-bottom));
        padding-bottom: var(--safe-bottom);
        background: white;
        border-top: 1px solid var(--border);
        z-index: 1200;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
    }

    /* Bottom nav always stays visible so users can navigate back to Home/Cart/Wishlist from login */

    /* === MOBILE NAV ITEMS === */
    .mob-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 700;
        cursor: pointer;
        padding: 6px 4px;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s;
    }

    .mob-nav-item .mob-nav-icon {
        font-size: 22px;
        line-height: 1;
    }

    .mob-nav-item.active {
        color: var(--red-main);
    }

    /* === MOBILE DRAWER OVERLAY === */
    .mobile-drawer-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }

    .mobile-drawer-overlay.open {
        display: block;
        animation: fadeInOverlay 0.2s ease;
    }

    @keyframes fadeInOverlay {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* === MOBILE DRAWER === */
    .mobile-drawer {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: min(300px, 85vw);
        height: 100%;
        background: white;
        z-index: 1600;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 20px 14px;
        box-shadow: 4px 0 28px rgba(0, 0, 0, 0.12);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-drawer.open {
        transform: translateX(0);
    }

    .mobile-drawer h3 {
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-muted);
        margin: 18px 0 8px;
        letter-spacing: 0.6px;
        font-weight: 800;
    }

    .mobile-drawer-link {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 13px 12px;
        border: none;
        background: #f9f9f9;
        border-radius: 10px;
        margin-bottom: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        text-align: left;
        color: var(--text-dark);
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s;
    }

    .mobile-drawer-link:active {
        background: #f0f0f0;
    }

    .mobile-drawer-close {
        float: right;
        border: none;
        background: #eee;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }

    /* === CATEGORY CHIPS IN DRAWER === */
    .mob-cat-chip {
        display: inline-block;
        padding: 9px 14px;
        margin: 0 6px 6px 0;
        background: #f0f5ff;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        border: 1.5px solid transparent;
        -webkit-tap-highlight-color: transparent;
        transition: border-color 0.15s, color 0.15s;
    }

    .mob-cat-chip:active,
    .mob-cat-chip:focus {
        border-color: var(--red-main);
        color: var(--red-main);
    }

    /* === PAGE HEADINGS — prevent oversized text on small screens === */
    body.mob-enabled #view-cart h1,
    body.mob-enabled #view-wishlist h1 {
        font-size: 22px !important;
        margin-bottom: 16px !important;
    }

    /* === PROFILE HEADER — stack buttons below name on mobile === */
    body.mob-enabled .profile-header > div[style*="margin-left"] {
        margin-left: 0 !important;
        width: 100%;
        justify-content: center;
    }

    body.mob-enabled .profile-header #profName {
        font-size: 20px !important;
    }

    /* === CATEGORY COVERFLOW — fit within viewport === */
    body.mob-enabled .category-coverflow {
        padding: 14px 0 38px;
    }

    body.mob-enabled .category-row.coverflow {
        width: 100%;
        gap: 12px;
        min-height: 316px;
        padding: 10px max(14px, calc((100% - clamp(184px, 62vw, 238px)) / 2)) 24px;
        scroll-padding-inline: max(14px, calc((100% - clamp(184px, 62vw, 238px)) / 2));
    }

    body.mob-enabled .category-row.coverflow .cat-rect-card {
        width: clamp(184px, 62vw, 238px);
        min-width: clamp(184px, 62vw, 238px);
        height: auto;
        min-height: 266px;
    }

    body.mob-enabled .cat-rect-body {
        min-height: auto;
        padding: 18px 16px 0;
    }
}

/* ============================================================
   EXTRA SMALL PHONES (≤ 380px)
   ============================================================ */
@media (max-width: 380px) {
    body.mob-enabled .logo {
        font-size: 15px;
    }

    body.mob-enabled .product-card {
        width: 140px;
    }

    body.mob-enabled .cat-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    body.mob-enabled .otp-box {
        width: 36px;
        height: 44px;
        font-size: 18px;
    }

    body.mob-enabled .auth-container {
        padding: 20px 14px;
    }

    body.mob-enabled .p-title {
        font-size: 18px;
    }

    body.mob-enabled .p-selling-price {
        font-size: 26px;
    }

    body.mob-enabled .cat-rect-card {
        min-width: 88px;
        padding: 8px 10px;
    }

    body.mob-enabled .cat-rect-img {
        width: 40px;
        height: 40px;
    }

    .mob-nav-item {
        font-size: 9px;
    }

    .mob-nav-item .mob-nav-icon {
        font-size: 19px;
    }
}

/* ============================================================
   FORCE HIDE MOBILE ELEMENTS ON DESKTOP (≥ 769px)
   ============================================================ */
@media (min-width: 769px) {
    .mobile-header-tools,
    .mobile-bottom-nav,
    .mobile-product-bar,
    .mobile-drawer,
    .mobile-drawer-overlay {
        display: none !important;
    }
}

/* ============================================================
   UTILITY — TOUCH-FRIENDLY INTERACTIVE ELEMENTS
   ============================================================ */
@media (max-width: 768px) {
    /* Ensure all interactive elements have at least 44px touch target */
    .btn-main,
    .btn-secondary,
    .btn-cart,
    .btn-buy,
    .qty-btn {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Prevent double-tap zoom on buttons */
    button,
    a,
    [role="button"] {
        touch-action: manipulation;
    }

    /* Scrollable horizontal areas on touch */
    .block-grid,
    .category-row,
    .p-thumbnail-col,
    .profile-sidebar {
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================
   PRINT MEDIA
   ============================================================ */
@media print {
    header,
    footer,
    .mobile-bottom-nav,
    .mobile-product-bar,
    .go-top,
    #toastContainer,
    .overlay-modal,
    .lightbox-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}
