/* =========================================================
   SƠN HÀ - CHỈ ÁP DỤNG TRANG CHI TIẾT SẢN PHẨM
   Toàn bộ selector được scope trong .single-product-page
   hoặc body.single-product để không ảnh hưởng trang khác.
========================================================= */

/* ===== Khung trang ===== */
.single-product-page {
    width: 100%;
}

.single-product-page .tw_container {
    width: 100%;
}

.single-product-page .content_all {
    width: 100%;
}

/* ===== Khu vực ảnh + thông tin sản phẩm ===== */
.single-product-page .top-content-product {
    display: flex;
    align-items: flex-start;
    gap: 36px;
}

.single-product-page .top-content-product > ._left,
.single-product-page .top-content-product > ._right {
    min-width: 0;
}

.single-product-page .top-content-product > ._left {
    position: relative;
    flex: 0 0 48%;
}

.single-product-page .top-content-product > ._right {
    flex: 1 1 auto;
}

/* ===== Gallery ảnh lớn ===== */
.single-product-page .gallery-top {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.single-product-page .gallery-top .swiper-slide {
    width: 100%;
}

.single-product-page .gallery-top .box-image-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-product-page .gallery-top .box-image-inner img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

/* ===== Thumbnail ===== */
.single-product-page .gallery-thumbs {
    position: relative;
    width: 100%;
    margin-top: 18px;
    padding-top: 56px; /* chừa chỗ riêng cho Prev / Next */
    overflow: hidden;
}

.single-product-page .gallery-thumbs .swiper-wrapper {
    align-items: stretch;
}

.single-product-page .gallery-thumbs .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

.single-product-page .gallery-thumbs .box-image-inner {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e3e3e3;
    background: #fff;
    box-sizing: border-box;
}

.single-product-page .gallery-thumbs .box-image-inner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}



/* =========================================================
   GALLERY PRODUCT NAV - FIX CUỐI
   Nút Prev/Next nằm thành 1 hàng riêng phía trên thumbnail.
   Không dùng absolute nên không thể đè lên ảnh.
========================================================= */

.single-product-page .product-gallery-navigation {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 14px 0 10px;
}

.single-product-page .product-gallery-navigation .swiper-button-prev,
.single-product-page .product-gallery-navigation .swiper-button-next {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;

    display: flex !important;
    align-items: center;
    justify-content: center;

    border: 1px solid #d9d9d9;
    border-radius: 50%;
    background: #fff !important;
    background-image: none !important;

    color: #333;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .08);

    z-index: 5;
    cursor: pointer;
}

.single-product-page .product-gallery-navigation .swiper-button-prev::after,
.single-product-page .product-gallery-navigation .swiper-button-next::after {
    font-size: 16px !important;
    font-weight: 700;
}

.single-product-page .product-gallery-navigation .swiper-button-prev:hover,
.single-product-page .product-gallery-navigation .swiper-button-next:hover {
    background: #1672BB !important;
    border-color: #1672BB;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(22, 114, 187, .24);
}

/* Bỏ khoảng chừa dành cho nút absolute cũ */
.single-product-page .gallery-thumbs {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Vô hiệu hoàn toàn rule absolute cũ nếu theme còn áp */


@media (max-width: 767px) {
    .single-product-page .product-gallery-navigation {
        margin-top: 10px;
        margin-bottom: 8px;
    }
}


/* ===== Tiêu đề + nội dung phải ===== */
.single-product-page .header-content-product {
    width: 100%;
}

.single-product-page .title-product,
.single-product-page .title-product-mobi {
    margin-top: 0;
}

.single-product-page .descreption-product {
    width: 100%;
}

.single-product-page .descreption-product img {
    max-width: 100%;
    height: auto;
}

/* ===== 2 nút Leaflet + Contact ===== */
.single-product-page .sonha-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.single-product-page .sonha-product-action {
    min-width: 235px;
    min-height: 58px;
    padding: 14px 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 1px solid #e60012;
    border-radius: 3px;

    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}

.single-product-page .sonha-product-action--leaflet {
    background: #fff;
    color: #ff7f8b;
    border-color: #ff7f8b;
}

.single-product-page .sonha-product-action--contact {
    background: #e60012;
    color: #fff;
    border-color: #e60012;
}

.single-product-page .sonha-product-action:hover,
.single-product-page .sonha-product-action:focus {
    background: #1672BB;
    border-color: #1672BB;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(22, 114, 187, .28);
}

/* ===== Tabs ===== */
.single-product-page .main-content-product {
    width: 100%;
}

.single-product-page .tab-product {
    width: 100%;
}

.single-product-page .tab-product ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.single-product-page .content-tab {
    width: 100%;
}

.single-product-page .content-tab img {
    max-width: 100%;
    height: auto;
}

/* ===== Sản phẩm liên quan ===== */
.single-product-page .bottom-content-product {
    width: 100%;
}

.single-product-page .related-product {
    width: 100%;
}

.single-product-page .related-product img {
    max-width: 100%;
    height: auto;
}

/* =========================================================
   POPUP - CHỈ TRANG SINGLE PRODUCT
========================================================= */
body.single-product #instant-quote-popup.household-contact-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

body.single-product #instant-quote-popup.household-contact-popup.is-active {
    display: flex;
}

body.single-product #instant-quote-popup .household-contact-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

body.single-product #instant-quote-popup .household-contact-popup__dialog {
    position: relative;
    z-index: 2;

    width: min(100% - 30px, 1125px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    padding: 42px 44px 60px;

    background: #fff;
    border-radius: 14px;
    box-shadow: 0 22px 65px rgba(0, 0, 0, .28);
}

body.single-product #instant-quote-popup .household-contact-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;

    width: 38px;
    height: 38px;
    padding: 0;

    border: 0;
    border-radius: 50%;
    background: #f1f1f1;

    color: #111;
    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}

body.single-product #instant-quote-popup #instant-quote-popup-title {
    position: relative;
    margin: 0 45px 55px 0;

    color: #292929;
    font-size: 35px;
    line-height: 1.25;
    font-weight: 800;
    text-transform: uppercase;
}

body.single-product #instant-quote-popup #instant-quote-popup-title::before {
    content: "";
    position: absolute;
    top: -45px;
    left: 0;

    width: 225px;
    height: 5px;

    background: #d41124;
}

/* CF7 - 2 cột desktop */
body.single-product
#instant-quote-popup
.instant-quote-form__row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 42px 68px !important;

    width: 100%;
    margin-bottom: 38px;
}

body.single-product
#instant-quote-popup
.instant-quote-form__group {
    min-width: 0;
}

body.single-product
#instant-quote-popup
.instant-quote-form__group--submit {
    grid-column: 1 / -1;
}

body.single-product
#instant-quote-popup
.instant-quote-form__control {
    display: block;

    width: 100% !important;
    height: 42px !important;

    margin: 0 !important;
    padding: 6px 2px !important;

    border: 0 !important;
    border-bottom: 1px solid #c8c8c8 !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;
}

body.single-product
#instant-quote-popup
.instant-quote-form__submit {
    width: 100% !important;
    height: 58px;

    margin: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: #e3061a !important;
    color: #fff !important;

    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

/* =========================================================
   MOBILE - CHỈ TRANG SẢN PHẨM
========================================================= */
@media (max-width: 767px) {

    .single-product-page .top-content-product {
        display: block;
    }

    .single-product-page .top-content-product > ._left,
    .single-product-page .top-content-product > ._right {
        width: 100%;
        flex: none;
    }

    .single-product-page .gallery-thumbs {
        padding-top: 52px;
    }


    .single-product-page .sonha-product-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .single-product-page .sonha-product-action {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    body.single-product #instant-quote-popup.household-contact-popup {
        padding: 12px;
    }

    body.single-product #instant-quote-popup .household-contact-popup__dialog {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        padding: 32px 20px;
    }

    body.single-product #instant-quote-popup #instant-quote-popup-title {
        margin-right: 45px;
        font-size: 18px;
    }

    body.single-product
    #instant-quote-popup
    .instant-quote-form__row {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
        margin-bottom: 28px;
    }

    body.single-product
    #instant-quote-popup
    .instant-quote-form__group--submit {
        grid-column: auto;
    }
}
