/* ==========================================================================
   WOOCOMMERCE SINGLE PRODUCT CORE SYSTEM
   Bố cục chuẩn theo thiết kế 2 cột: Gallery 50% - Info 50%
   ========================================================================== */

/* 1. KHUNG CHÍNH TRANG SẢN PHẨM */
.woocommerce.container,
.single-product .woocommerce.container {
    padding-top: 40px !important;
    padding-bottom: var(--section-gap, 50px) !important;
    box-sizing: border-box !important;
}

.woocommerce div.product,
div.product,
.single-product .site-main .product {
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    clear: both !important;
    font-family: var(--font-lexend), sans-serif !important;
}

/* 2. ẨN BREADCRUMB MẶC ĐỊNH NẰM NGOÀI TRANG */
.woocommerce > .woocommerce-breadcrumb,
.woocommerce > nav.woocommerce-breadcrumb {
    display: none !important;
}

/* 3. KHỐI TRÊN: GALLERY + INFO (CHIA 2 CỘT) */
.woocommerce div.product .esight-product-top-wrap,
div.product .esight-product-top-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    column-gap: 50px !important;
    row-gap: 20px !important;
    align-items: start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 20px !important;
}

/* Cột Trái: Gallery */
.esight-product-top-wrap > *:first-child,
.esight-product-top-wrap .product-gallery {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Cột Phải: Info Action Stack */
.esight-product-top-wrap > *:last-child,
.esight-product-top-wrap .product-summary {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 4. KHỐI MÔ TẢ CHI TIẾT SẢN PHẨM */
.product-full-desc-section,
.product-full-desc {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
}

/* 5. KHỐI SẢN PHẨM TƯƠNG TỰ (SLIDER 4 CỘT) */
.related.products,
div.product > .related.products {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 45px !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
    position: relative;
    clear: both !important;
}

/* Tiêu đề SẢN PHẨM TƯƠNG TỰ (Căn giữa, In hoa, Đậm) */
.related.products > h2,
.related.products .related-title {
    font-family: var(--font-lexend), sans-serif !important;
    font-size: 28px !important;
    line-height: 1.3 !important;
    color: var(--text-title, #111111) !important;
    font-weight: 700 !important;
    margin: 0 0 25px 0 !important;
    text-align: center !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.peony-related-slider-wrap {
    position: relative;
    width: 100%;
    padding: 0 40px !important;
    box-sizing: border-box !important;
}

.related.products .peony-product-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 20px !important;
    padding-bottom: 10px !important;
    margin: 0 !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.related.products .peony-product-grid::-webkit-scrollbar {
    display: none !important;
}

/* 4 Card sản phẩm trên Desktop */
.related.products .peony-product-grid > * {
    flex: 0 0 calc((100% - 60px) / 4) !important;
    max-width: calc((100% - 60px) / 4) !important;
    box-sizing: border-box !important;
    scroll-snap-align: start !important;
    margin: 0 !important;
}

/* 6. HAI NÚT MŨI TÊN ĐIỀU HƯỚNG SLIDER */
.peony-slider-nav {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 28px;
    height: 38px;
    background-color: var(--color-accent, #027CC5) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    cursor: pointer;
    z-index: 20;
    padding: 0 !important;
    transition: var(--transition-base, all 0.25s ease);
}

.peony-slider-nav svg {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.peony-slider-nav:hover {
    background-color: var(--color-accent-dark, #2F6D9B) !important;
}

.peony-slider-nav.prev {
    left: 0 !important;
}

.peony-slider-nav.next {
    right: 0 !important;
}

/* ==========================================================================
   RESPONSIVE TABLET
   ========================================================================== */
@media screen and (max-width: 1024px) {
    .woocommerce div.product .esight-product-top-wrap,
    div.product .esight-product-top-wrap {
        column-gap: 30px !important;
    }

    .related.products .peony-product-grid > * {
        flex: 0 0 calc((100% - 40px) / 3) !important;
        max-width: calc((100% - 40px) / 3) !important;
    }

    .related.products .related-title {
        font-size: 24px !important;
    }
}

/* ==========================================================================
   RESPONSIVE MOBILE
   ========================================================================== */
@media screen and (max-width: 767px) {
    .woocommerce.container,
    .single-product .woocommerce.container {
        padding-top: 40px !important;
    }

    .woocommerce div.product .esight-product-top-wrap,
    div.product .esight-product-top-wrap {
        grid-template-columns: 1fr !important;
        column-gap: 0 !important;
        row-gap: 20px !important;
    }

    .peony-related-slider-wrap {
        position: relative !important;
        padding: 0 !important;
    }

    .related.products .peony-product-grid {
        gap: 12px !important;
    }

    .related.products .peony-product-grid > * {
        flex: 0 0 calc((100% - 12px) / 2) !important;
        max-width: calc((100% - 12px) / 2) !important;
    }

    /* Hiển thị 2 nút điều hướng prev/next trên mobile chuẩn theo desktop */
    .peony-slider-nav {
        display: flex !important;
        width: 26px !important;
        height: 36px !important;
        top: 36% !important; /* Căn giữa theo chiều dọc của hình ảnh sản phẩm */
        z-index: 20 !important;
        opacity: 0.92 !important;
    }

    .peony-slider-nav.prev {
        left: 0 !important;
    }

    .peony-slider-nav.next {
        right: 0 !important;
    }

    .related.products .related-title {
        font-size: 20px !important;
        margin-bottom: 15px !important;
    }
}