/**
 * Storefront responsive layer — loaded after storefront.css + mobile-app.css.
 * Site-wide overflow, media, tables, and breakpoint tuning (mobile / tablet / desktop).
 */

/* ── Global containment ── */
.storefront-body,
.storefront-body .app-main {
    overflow-x: clip;
    max-width: 100%;
}

/* Fluid media in page content only — header/footer logos keep fixed dimensions */
.storefront-body .app-main img,
.storefront-body .app-main video,
.storefront-body .app-main picture,
.storefront-body .site-footer img {
    max-width: 100%;
    height: auto;
}

.storefront-body .category-card-media img,
.storefront-body .product-card1 img,
.storefront-body .hero-slide-img,
.storefront-body .special-offer-media img,
.storefront-body .home-combo-media img,
.storefront-body .cart-item-img,
.storefront-body .pdp-main-image img,
.storefront-body .pdp-thumb img {
    height: 100%;
    width: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.sf-container,
.padd1,
.shop-category-inner,
.shop-layout,
.checkout-layout,
.page-banner-inner,
.home-section,
.sf-section {
    min-width: 0;
    max-width: 100%;
}

.storefront-body .table-responsive,
.storefront-body .sf-table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.storefront-body .row {
    --bs-gutter-x: 1rem;
}

/* ── Header: logo + nav + search (no overlap) ── */
.main-header {
    isolation: isolate;
}

.main-header .header-container {
    width: 100%;
}

.main-header .logo1 {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 200px;
    text-decoration: none;
}

.main-header .logo1 .logo-full,
.main-header .logo1 .logo-compact {
    width: auto;
    max-width: 200px;
    max-height: 52px;
    height: auto;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.main-header .logo1 .logo-compact {
    display: none;
}

@media (min-width: 993px) {
    .main-header .header-container {
        display: grid;
        grid-template-columns: minmax(0, 200px) minmax(0, 1fr) minmax(150px, 196px) auto;
        align-items: center;
        column-gap: 12px;
    }

    .main-header .menu-toggle {
        display: none !important;
    }

    .main-header .logo1 {
        grid-column: 1;
        justify-self: start;
    }

    .main-header .header-nav {
        grid-column: 2;
        min-width: 0;
        max-width: 100%;
        overflow: visible;
    }

    .main-header .nav-menu {
        justify-content: center;
        max-width: 100%;
        overflow: visible;
        flex-wrap: nowrap;
    }

    .main-header .header-search-form {
        grid-column: 3;
        display: flex !important;
        width: 100%;
        max-width: 196px;
        min-width: 0;
    }

    .main-header .header-actions {
        grid-column: 4;
        flex-shrink: 0;
    }
}

@media (min-width: 993px) and (max-width: 1180px) {
    .main-header .nav-menu li a,
    .main-header .nav-more-btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .main-header .header-container {
        grid-template-columns: minmax(0, 168px) minmax(0, 1fr) minmax(136px, 168px) auto;
        column-gap: 8px;
    }

    .main-header .logo1 .logo-full {
        max-width: 168px;
        max-height: 48px;
    }
}

@media (max-width: 992px) {
    .main-header .logo1 {
        flex: 1 1 auto;
        max-width: none;
        justify-content: center;
    }

    .main-header .logo1 .logo-full {
        display: none !important;
    }

    .main-header .logo1 .logo-compact {
        display: inline-block !important;
        max-height: 44px;
        max-width: min(210px, 56vw);
        margin: 0 auto;
        object-position: center;
    }
}

/* ── Hero slider: stay below header, no bleed ── */
.hero-section {
    position: relative;
    z-index: 0;
    overflow: hidden;
}

.hero-section .carousel,
.hero-section .carousel-inner,
.hero-section .carousel-item,
.hero-slide-frame {
    max-width: 100%;
}

.hero-section .hero-slide-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    object-fit: cover !important;
    object-position: center center;
}

.hero-slide-caption {
    z-index: 2;
    max-width: min(420px, 92vw);
}

@media (max-width: 992px) {
    .hero-slide-caption {
        max-width: calc(100% - 24px);
        left: 12px;
        right: 12px;
    }
}

/* ── Tablet (769px – 1199px) ── */
@media (min-width: 769px) and (max-width: 1199px) {
    .shop-category-grid .category-card-frame--featured .category-card-media {
        min-height: 280px;
    }

    .special-offer-track {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .home-combo-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .checkout-layout {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}

/* ── Mobile / small tablet (≤ 992px) ── */
@media (max-width: 992px) {
    .shop-sidebar {
        position: static;
        width: 100%;
        max-height: none;
    }

    .shop-layout {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .hero-slide-frame {
        aspect-ratio: 16 / 9;
        max-height: min(52vh, 420px);
    }

    .hero-section .hero-slide-img {
        object-fit: cover;
    }

    .shop-category-grid .row {
        margin-left: 0;
        margin-right: 0;
    }

    .category-card-frame--featured .category-card-media {
        aspect-ratio: 16 / 10;
        min-height: 200px;
    }

    .category-card-media--small {
        aspect-ratio: 3 / 2;
        min-height: 140px;
    }

    .special-offer-media {
        height: clamp(180px, 42vw, 320px);
    }

    .home-combo-media img {
        height: clamp(160px, 40vw, 220px);
    }

    .floating-whatsapp {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .floating-facebook {
        bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }

    .store-chat-launcher {
        bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }

    .pdp-gallery-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .manual-section,
    .cms-page-content,
    .static-page-body {
        overflow-wrap: anywhere;
    }
}

/* ── Phone (≤ 768px) ── */
@media (max-width: 768px) {
    .cart-items-card .table thead {
        display: none;
    }

    .cart-items-card .table tr {
        display: block;
        padding: 16px;
        border-bottom: 1px solid var(--sf-cream-dark, #ebe4d8);
    }

    .cart-items-card .table td {
        display: block;
        border: none;
        padding: 4px 0;
        white-space: normal;
    }

    .cart-items-card .table td:first-child {
        padding-bottom: 12px;
    }

    .checkout-form-card,
    .checkout-summary-card {
        padding: 20px 16px;
    }

    .checkout-steps {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .product-detail-page .breadcrumb {
        font-size: .875rem;
        flex-wrap: wrap;
    }

    .site-footer .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
    }

    .newsletter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .review-slider-track {
        scroll-padding-inline: 12px;
    }

    .page-banner {
        padding: 32px 16px;
    }

    .page-banner .breadcrumb {
        font-size: .875rem;
        justify-content: center;
    }

    .wishlist-page .table-responsive .table td {
        white-space: normal;
    }
}

/* ── Small phone (≤ 576px) ── */
@media (max-width: 576px) {
    .section-title {
        font-size: clamp(1.25rem, 5vw, 1.45rem);
    }

    .section-subtitle {
        font-size: .9rem;
        padding-left: 8px;
        padding-right: 8px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .storefront-body input.form-control,
    .storefront-body select.form-select,
    .storefront-body textarea.form-control,
    .storefront-body .product-button1,
    .storefront-body .btn-buy-now,
    .storefront-body .sf-btn {
        min-height: 44px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .category-card-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .category-shop-btn {
        align-self: stretch;
        text-align: center;
    }

    .special-offer-track {
        grid-template-columns: 1fr;
    }

    .store-alert {
        margin-left: 12px !important;
        margin-right: 12px !important;
    }
}

/* ── Medium layouts ── */
@media (min-width: 577px) and (max-width: 992px) {
    .product-grid:not(.product-grid--forced) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ── Large desktop ── */
@media (min-width: 1400px) {
    .sf-container {
        max-width: var(--sf-container, 1240px);
    }
}
