/* ============================================================
   Advice-style compact shell (shared storefront)
   ล็อกความกว้างเนื้อหาไว้ตรงกลาง ~1877px (1632 + 15%)
   ซูมเข้า/จอใหญ่: ยังคงรูปทรงกะทัดรัด มีขอบขาวข้าง ๆ
   ============================================================ */

html[data-shared-storefront-shell="active"] {
    overflow-x: clip;
    --dcsc-shell-max: 1877px;
    --dcsc-shell-pad: 24px;
    --dcsc-shell-width: min(var(--dcsc-shell-max), calc(100vw - (var(--dcsc-shell-pad) * 2)));
}

html[data-shared-storefront-shell="active"] body {
    overflow-x: clip;
}

/* Header / topbar / nav */
html[data-shared-storefront-shell="active"] .top-bar > .container.top-bar-full-width,
html[data-shared-storefront-shell="active"] .main-header-wrapper-v2 > .container.main-header-full-width,
html[data-shared-storefront-shell="active"] .main-nav > .container.main-nav-full-width,
html[data-shared-storefront-shell="active"] #main-nav-container {
    width: min(100%, var(--dcsc-shell-width)) !important;
    max-width: min(100vw - 24px, var(--dcsc-shell-max)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

html[data-shared-storefront-shell="active"] .main-nav,
html[data-shared-storefront-shell="active"] #main-nav {
    width: 100% !important;
    max-width: 100vw !important;
    overflow: visible !important;
}

html[data-shared-storefront-shell="active"] .main-nav > .container.main-nav-full-width,
html[data-shared-storefront-shell="active"] #main-nav-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    overflow: visible !important;
}

/* Banner slider = เต็มความกว้างหน้าจอ (ไม่เข้า shell) */
html[data-shared-storefront-shell="active"] .top-hero-row,
html[data-shared-storefront-shell="active"] .top-hero-row.pro-hero-shell,
html[data-shared-storefront-shell="active"] #top-hero-row {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    left: 0 !important;
    right: 0 !important;
}

html[data-shared-storefront-shell="active"] .top-hero-row .hero-section,
html[data-shared-storefront-shell="active"] .top-hero-row .hero-section-wrapper,
html[data-shared-storefront-shell="active"] .top-hero-row #main-hero-slider,
html[data-shared-storefront-shell="active"] .top-hero-row .main-hero-slider-container,
html[data-shared-storefront-shell="active"] .top-hero-row .swiper-wrapper,
html[data-shared-storefront-shell="active"] .top-hero-row .swiper-slide,
html[data-shared-storefront-shell="active"] .top-hero-row .swiper-slide a,
html[data-shared-storefront-shell="active"] .top-hero-row .swiper-slide img {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
}

/* Category + main content row ยังอยู่ใน shell */
html[data-shared-storefront-shell="active"] #category-section,
html[data-shared-storefront-shell="active"] .category-section,
html[data-shared-storefront-shell="active"] .below-main-row,
html[data-shared-storefront-shell="active"] .reviews-shell,
html[data-shared-storefront-shell="active"] .pro-reviews-shell {
    width: var(--dcsc-shell-width) !important;
    max-width: var(--dcsc-shell-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

html[data-shared-storefront-shell="active"] .below-main-row {
    display: flex !important;
    gap: 16px !important;
    align-items: flex-start !important;
    margin-top: 2px !important;
}

html[data-shared-storefront-shell="active"] .below-main-row > #main-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
}

html[data-shared-storefront-shell="active"] .below-main-row > #left-ads-sidebar,
html[data-shared-storefront-shell="active"] .below-main-row > .ads-left-sidebar {
    flex: 0 0 280px !important;
    width: 280px !important;
    max-width: 280px !important;
}

html[data-shared-storefront-shell="active"] #main-footer.footer-rebuild > .footer-rebuild__shell {
    width: var(--dcsc-shell-width) !important;
    max-width: var(--dcsc-shell-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

html[data-shared-storefront-shell="active"] .main-header-wrapper-v2,
html[data-shared-storefront-shell="active"] .main-nav,
html[data-shared-storefront-shell="active"] #main-footer.footer-rebuild {
    width: 100% !important;
}

html[data-shared-storefront-shell="active"] footer.main-footer:not(#main-footer) {
    display: none !important;
}

html[data-shared-storefront-shell="active"] #scroll-to-top-btn {
    display: none;
}

@media (max-width: 991.98px) {
    html[data-shared-storefront-shell="active"] .top-bar > .container.top-bar-full-width,
    html[data-shared-storefront-shell="active"] .main-header-wrapper-v2 > .container.main-header-full-width,
    html[data-shared-storefront-shell="active"] .main-nav > .container.main-nav-full-width,
    html[data-shared-storefront-shell="active"] #main-nav-container,
    html[data-shared-storefront-shell="active"] .below-main-row,
    html[data-shared-storefront-shell="active"] .reviews-shell,
    html[data-shared-storefront-shell="active"] .pro-reviews-shell,
    html[data-shared-storefront-shell="active"] #main-footer.footer-rebuild > .footer-rebuild__shell {
        width: min(100vw - 24px, 100%) !important;
        max-width: 100% !important;
    }

    /* Hero ยังเต็มจอบนมือถือ */
    html[data-shared-storefront-shell="active"] .top-hero-row,
    html[data-shared-storefront-shell="active"] .top-hero-row.pro-hero-shell,
    html[data-shared-storefront-shell="active"] #top-hero-row {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    html[data-shared-storefront-shell="active"] .below-main-row {
        flex-direction: column !important;
    }

    html[data-shared-storefront-shell="active"] .below-main-row > #left-ads-sidebar,
    html[data-shared-storefront-shell="active"] .below-main-row > .ads-left-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
    }
}

@media (max-width: 767.98px) {
    html[data-shared-storefront-shell="active"] .top-bar > .container.top-bar-full-width,
    html[data-shared-storefront-shell="active"] .main-header-wrapper-v2 > .container.main-header-full-width,
    html[data-shared-storefront-shell="active"] .main-nav > .container.main-nav-full-width,
    html[data-shared-storefront-shell="active"] #main-footer.footer-rebuild > .footer-rebuild__shell {
        width: min(100vw - 20px, 100%) !important;
    }
}
