/* ==========================================================================
   CUSTOM STYLESHEET (FILE CSS TUỲ BIẾN)
   - Sử dụng file này để viết thêm hoặc ghi đè (override) CSS của website.
   - Mọi chỉnh sửa CSS nên đặt tại đây để tránh sửa trực tiếp vào style.css,
     fixcssall.css,... tránh làm hỏng cấu trúc giao diện gốc.
   ========================================================================== */

/* Viết CSS tuỳ biến của bạn tại đây: */

/* ==========================================================================
   Row 127: Cố định frame ảnh giảng viên tới viền xám (/pages/khoa-hoc)
   ========================================================================== */
.instructor-slide .instructor-banner,
.instructor-banner {
    margin-bottom: 0 !important;
    align-items: stretch !important;
}

.instructor-slide {
    height: auto !important;
    min-height: 100% !important;
}

.ib-img-wrapper {
    align-self: stretch !important;
    height: 100% !important;
    min-height: 440px !important;
    display: flex !important;
}

.ib-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
}

.inst-controls {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    background: #ffffff !important;
}

/* ==========================================================================
   Row 129: Section Giới thiệu (Bento) - Mỗi hình vuông 120 x 120
   ========================================================================== */
.bento-img-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 30px !important;
    flex-wrap: wrap !important;
}

.bento-img-row img {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* ==========================================================================
   Row 130: Logo thương hiệu Bento kích thước 300 x 80 px
   ========================================================================== */
.bento-logo {
    max-width: 300px !important;
    min-height: 80px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    margin-bottom: 25px !important;
}

.bento-brand-image {
    max-width: 300px !important;
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: left center !important;
    display: block !important;
}

/* ==========================================================================
   Row 131: Format ngày tháng Workshop xếp dọc (17/09 - 18/09)
   ========================================================================== */
.mc-date {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.15 !important;
    min-width: 70px !important;
    white-space: nowrap !important;
}

.mc-date > span {
    display: block !important;
}

.mc-date .mc-date-range-separator {
    display: block !important;
    line-height: 1 !important;
    margin: 2px 0 !important;
    font-size: 1.1rem !important;
}

/* ==========================================================================
   Row 132: Footer icon MXH kích thước 42 x 42, bỏ background và bọc ngoài
   ========================================================================== */
.footer-socials {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: center !important;
    margin-top: 18px !important;
}

.footer-social-btn,
.footer-social-btn.btn-fb,
.footer-social-btn.btn-zalo-footer,
.footer-social-btn.btn-yt,
.footer-social-btn.btn-shopee,
.footer-social-btn.btn-lazada,
.footer-social-btn.btn-tiktok,
.footer-social-btn.btn-insta {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    transition: transform 0.25s ease, opacity 0.25s ease !important;
}

.footer-social-btn:hover,
.footer-social-btn:focus,
.footer-social-btn:active {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: translateY(-2px) scale(1.08) !important;
}

.footer-social-img {
    width: 42px !important;
    height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    object-fit: contain !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
}

/* Desktop: giữ toàn bộ nhóm MXH trên một hàng, kể cả khi cột Liên hệ hẹp. */
@media (min-width: 769px) {
    .footer-socials {
        width: max-content !important;
        max-width: none !important;
    }
}

/* Tạo nền tròn riêng để chữ Zalo luôn nằm gọn bên trong viền icon. */
.footer-social-btn.btn-zalo-footer {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    isolation: isolate;
}

.footer-social-btn.btn-zalo-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 50%;
    background: #0068ff;
}

.footer-social-btn.btn-zalo-footer .footer-social-img {
    position: relative;
    z-index: 1;
    transform: scale(0.86);
    transform-origin: center;
    clip-path: circle(50% at 50% 50%);
}

/* ==========================================================================
   Hotspot Mobile: Ẩn điểm sáng trên mobile khi không điền tọa độ
   ========================================================================== */
@media (max-width: 768px) {
    .hotspot-dot.hotspot-mobile-hidden {
        display: none !important;
    }
    .hotspot-dot:not(.hotspot-mobile-hidden) {
        top: var(--hotspot-mobile-top) !important;
        left: var(--hotspot-mobile-left) !important;
    }
}

/* ==========================================================================
   Row 140: Tăng kích thước logo Thương hiệu độc quyền, thu hẹp khoảng cách
   - Giữ nguyên chiều cao tổng thể & khoảng cách trên/dưới của section
   - Mở rộng logo đến hết viền xanh lá (165px)
   - Giảm khoảng cách (gap/padding) giữa các logo
   ========================================================================== */
.brand-marquee-container {
    height: 165px !important;
    min-height: 165px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.brand-marquee-track {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

.brand-marquee-group {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 32px !important;
    padding-right: 32px !important;
}

.brand-marquee-item {
    height: 165px !important;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.brand-marquee-item:hover {
    transform: scale(1.04) !important;
}

.brand-marquee-item .brand-item-img {
    height: auto !important;
    max-height: 158px !important;
    max-width: 320px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
}

@media (max-width: 991px) {
    .brand-marquee-container {
        height: 120px !important;
        min-height: 120px !important;
        padding: 0 !important;
    }
    .brand-marquee-track,
    .brand-marquee-group {
        height: 100% !important;
        gap: 22px !important;
        padding-right: 22px !important;
    }
    .brand-marquee-item {
        height: 120px !important;
        padding: 0 5px !important;
    }
    .brand-marquee-item .brand-item-img {
        max-height: 115px !important;
        max-width: 220px !important;
    }
}

@media (max-width: 767px) {
    .brand-marquee-container {
        height: 90px !important;
        min-height: 90px !important;
        padding: 0 !important;
    }
    .brand-marquee-track,
    .brand-marquee-group {
        height: 100% !important;
        gap: 16px !important;
        padding-right: 16px !important;
    }
    .brand-marquee-item {
        height: 90px !important;
        padding: 0 4px !important;
    }
    .brand-marquee-item .brand-item-img {
        max-height: 85px !important;
        max-width: 170px !important;
    }
}

/* Header desktop: giảm một cấp cỡ chữ của menu chính. */
@media (min-width: 1281px) {
    #main-header .nav-list > li > a {
        font-size: 0.95rem !important;
    }
}

@media (min-width: 992px) and (max-width: 1280px) {
    #main-header .nav-list > li > a {
        font-size: 0.8125rem !important;
    }
}

/* ==========================================================================
   Row 156: Trang chủ - Thu hẹp khoảng trống phía trên section Danh Mục Nổi Bật & Nổi Bật Mùa Lễ Hội
   - Đồng bộ chiều cao khoảng trống bằng với section Không Gian Bếp Mẫu (30px)
   ========================================================================== */
body.template-index .hotspot-section {
    margin-top: 30px !important;
}

body.template-index .category-masonry-section {
    padding-top: 30px !important;
}

body.template-index .category-masonry-section > .container.py-4,
body.template-index .category-masonry-section > .container {
    padding-top: 0 !important;
}

body.template-index .seasonal-products {
    padding-top: 30px !important;
    padding-bottom: 40px !important;
}

body.template-index .seasonal-products > .container.py-4,
body.template-index .seasonal-products > .container {
    padding-top: 0 !important;
}

body.template-index .home-ingredients-section {
    padding-top: 30px !important;
}

@media (max-width: 767px) {
    body.template-index .hotspot-section {
        margin-top: 20px !important;
    }

    body.template-index .category-masonry-section {
        padding-top: 20px !important;
    }

    body.template-index .seasonal-products {
        padding-top: 20px !important;
    }
}

/* Trang sản phẩm: chuẩn hóa ảnh chính trong khung vuông tối đa 500 x 500px. */
@media (min-width: 992px) {
    body.template-product .product-gallery.vertical-layout {
        position: relative !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body.template-product .product-gallery.vertical-layout .gallery-thumbnails {
        position: absolute !important;
        top: 30px;
        left: 30px;
        z-index: 2;
    }

    body.template-product .product-gallery.vertical-layout .main-image {
        flex: 1 1 500px !important;
        width: auto !important;
        max-width: 500px !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 1 / 1;
        box-sizing: border-box !important;
        padding: 15px !important;
        overflow: hidden !important;
        margin: auto !important;
    }

    body.template-product .product-gallery.vertical-layout .main-image > img {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
        margin: 0 !important;
        display: block !important;
    }
}

/* Trang chủ - Dịch Vụ Cốt Lõi: giảm hai nấc tên các danh mục con. */
@media (min-width: 992px) {
    body.template-index .services-section .srv-list .srv-item {
        font-size: 2rem !important;
    }
}

/* Các trang Page: căn giữa ảnh được chèn từ nội dung quản trị Haravan. */
body.template-page .page-content-wrapper img,
body.template-page #page-main-content img,
body.template-page #about-main-content img,
body.template-page .brand-intro img,
body.template-page .catalogue-intro img {
    display: initial !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}

body.template-page .page-content-wrapper p:has(img),
body.template-page .page-content-wrapper div:has(> img),
body.template-page .page-content-wrapper figure:has(img),
body.template-page #page-main-content p:has(img),
body.template-page #page-main-content div:has(> img),
body.template-page #page-main-content figure:has(img),
body.template-page #about-main-content p:has(img),
body.template-page #about-main-content div:has(> img),
body.template-page #about-main-content figure:has(img),
body.template-page .brand-intro p:has(img),
body.template-page .brand-intro div:has(> img),
body.template-page .brand-intro figure:has(img),
body.template-page .catalogue-intro p:has(img),
body.template-page .catalogue-intro div:has(> img),
body.template-page .catalogue-intro figure:has(img) {
    text-align: center !important;
}

/* ==========================================================================
   Row 151: Section Thiết Bị Nhà Hàng Khách Sạn - Sản phẩm đầu hiển thị 4 dòng mô tả
   ========================================================================== */
.hs-hero-content .desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-clamp: 4 !important;
}

/* ==========================================================================
   Row 153: Bài viết Blog (/blogs/...) - Tối ưu khoảng cách Headings & Body Text
   ========================================================================== */
.text-content-container .text-content h2,
#article-main-content h2,
.text-content h2 {
    margin-top: 36px !important;
    margin-bottom: 18px !important;
    line-height: 1.35 !important;
}

.text-content-container .text-content h3,
#article-main-content h3,
.text-content h3 {
    margin-top: 28px !important;
    margin-bottom: 16px !important;
    line-height: 1.4 !important;
}

.text-content-container .text-content h4,
#article-main-content h4,
.text-content h4 {
    margin-top: 24px !important;
    margin-bottom: 14px !important;
    line-height: 1.4 !important;
}

.text-content-container .text-content h5,
.text-content-container .text-content h6,
#article-main-content h5,
#article-main-content h6,
.text-content h5,
.text-content h6 {
    margin-top: 20px !important;
    margin-bottom: 12px !important;
    line-height: 1.4 !important;
}

/* Khoảng cách khi heading 2 đứng ngay trước heading 3 */
.text-content-container .text-content h2 + h3,
#article-main-content h2 + h3,
.text-content h2 + h3 {
    margin-top: 14px !important;
}

/* Heading đầu tiên của bài viết */
.text-content-container .text-content > h2:first-child,
.text-content-container .text-content > h3:first-child,
#article-main-content > h2:first-child,
#article-main-content > h3:first-child {
    margin-top: 0 !important;
}

/* Đoạn văn (body text) trong bài viết */
.text-content-container .text-content p,
#article-main-content p,
.text-content p {
    margin-bottom: 18px !important;
    line-height: 1.75 !important;
}

/* Danh sách ul, ol trong bài viết */
.text-content-container .text-content ul,
.text-content-container .text-content ol,
#article-main-content ul,
#article-main-content ol,
.text-content ul,
.text-content ol {
    margin-top: 12px !important;
    margin-bottom: 22px !important;
}

.text-content-container .text-content li,
#article-main-content li,
.text-content li {
    margin-bottom: 8px !important;
    line-height: 1.7 !important;
}

@media (max-width: 767px) {
    .text-content-container .text-content h2,
    #article-main-content h2,
    .text-content h2 {
        margin-top: 28px !important;
        margin-bottom: 14px !important;
    }

    .text-content-container .text-content h3,
    #article-main-content h3,
    .text-content h3 {
        margin-top: 22px !important;
        margin-bottom: 12px !important;
    }

    .text-content-container .text-content h2 + h3,
    #article-main-content h2 + h3,
    .text-content h2 + h3 {
        margin-top: 10px !important;
    }

    .text-content-container .text-content p,
    #article-main-content p,
    .text-content p {
        margin-bottom: 15px !important;
    }
}

/* ==========================================================================
   Row 154: Bài viết Blog (/blogs/...) - Text Link tự tô màu #ea9b76
   - Mặc định các liên kết văn bản (text link) tự động nhận màu #ea9b76
   - Khi người dùng chủ động chọn đổi màu trong trình soạn thảo (inline style),
     màu mới được chọn sẽ tự động được ưu tiên áp dụng.
   ========================================================================== */
.text-content a:not(.btn):not(.btn-book):not(.btn-primary):not([class*="btn"]),
#article-main-content a:not(.btn):not(.btn-book):not(.btn-primary):not([class*="btn"]),
.text-content-container .text-content a:not(.btn):not(.btn-book):not(.btn-primary):not([class*="btn"]) {
    color: #ea9b76;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.text-content a:not(.btn):not(.btn-book):not(.btn-primary):not([class*="btn"]):hover,
#article-main-content a:not(.btn):not(.btn-book):not(.btn-primary):not([class*="btn"]):hover,
.text-content-container .text-content a:not(.btn):not(.btn-book):not(.btn-primary):not([class*="btn"]):hover {
    color: #d68058;
    opacity: 0.85;
}

/* Link chứa ảnh thì bỏ gạch chân */
.text-content a:has(> img),
#article-main-content a:has(> img) {
    text-decoration: none !important;
}

/* Ưu tiên màu khi người dùng tự đổi màu ở thẻ cha bọc ngoài link */
span[style*="color"] > a:not(.btn):not(.btn-book),
p[style*="color"] > a:not(.btn):not(.btn-book),
font[color] > a:not(.btn):not(.btn-book) {
    color: inherit !important;
}

/* ==========================================================================
   Row 157: Fix hiển thị ảnh mobile cho Section Bếp Mẫu (Hotspot)
   ========================================================================== */
.hotspot-picture {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.hotspot-picture .hotspot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product card titles: keep the product name on Montserrat. */
.product-title,
.product-title a,
.cat-card h4,
.cat-card h4 a,
.cat-card-info h4,
.cat-card-info h4 a,
.cat-card-title,
.cat-card-title a,
#collection-product-grid .cat-card h4,
#collection-product-grid .cat-card-info h4,
.category-main .cat-card h4,
.category-main .cat-card-info h4,
.article-product-slide .cat-card h4,
.product-card h4,
.product-card h4 a,
.product-card-title,
.product-card-title a,
.itemProduct h4,
.itemProduct h4 a,
.product-item h4,
.product-item h4 a,
.pro-item h4,
.pro-item h4 a,
.c-product-title,
.c-product-title a,
.course-card-title,
.course-card-title a,
body .inner-banner-title,
.hp-title,
.hp-title a,
.hs-hero-content h3,
.hs-sidekick-wrapper h4,
.skincare-product-card__title,
.skincare-product-card__title a,
.uv-item-title,
.uv-item-title a,
.product_name,
.product_name a,
.wishlist-card-title,
.wishlist-card-title a,
.search-item__title,
.search-item__title a {
    font-family: 'Montserrat', sans-serif !important;
}

/* Homepage heading rules have higher specificity than generic card rules.
   Override product names explicitly while retaining section typography. */
body.template-index .product-card h4,
body.template-index .product-card h4 a,
body.template-index .product-card-title,
body.template-index .product-card-title a,
body.template-index .cat-card:not(.uv-article-search-card) h4,
body.template-index .cat-card:not(.uv-article-search-card) h4 a,
body.template-index .cat-card-title,
body.template-index .cat-card-title a,
body.template-index .hs-hero-content h3,
body.template-index .hotspot-popup .hp-title,
body.template-index .hotspot-popup .hp-title a,
body.template-index .skincare-product-card__title,
body.template-index .skincare-product-card__title a,
body.template-index .c-product-title,
body.template-index .c-product-title a,
body.template-index .wishlist-card-title,
body.template-index .wishlist-card-title a,
body.template-index .itemProduct h4,
body.template-index .product-item h4,
body.template-index .pro-item h4 {
    font-family: 'Montserrat', sans-serif !important;
}

/* ==========================================================================
   Hotspot Quick View Anti-Clipping Fix (Cho các điểm sáng sát viền mép)
   ========================================================================== */

/* Nâng cao z-index khi hover hoặc active để card popup luôn hiển thị trên cùng */
.hotspot-dot:hover,
.hotspot-dot.active {
    z-index: 120 !important;
}

/* 1. Điểm sáng sát viền TRÁI (pos-edge-left):
   Cho popup mở về phía bên phải để không bao giờ bị cắt cụt cạnh trái */
.hotspot-dot.pos-edge-left .hotspot-popup {
    left: 0 !important;
    right: auto !important;
    transform: translateY(8px) !important;
}

.hotspot-dot.pos-edge-left:hover .hotspot-popup,
.hotspot-dot.pos-edge-left.active .hotspot-popup {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* Khi điểm sát viền trái ở phía trên cao (pos-bottom): mở hướng xuống dưới */
.hotspot-dot.pos-edge-left.pos-bottom .hotspot-popup {
    top: calc(100% + 14px) !important;
    bottom: auto !important;
    transform: translateY(-8px) !important;
}

.hotspot-dot.pos-edge-left.pos-bottom:hover .hotspot-popup,
.hotspot-dot.pos-edge-left.pos-bottom.active .hotspot-popup {
    transform: translateY(0) !important;
}

/* Mũi tên trỏ chuẩn xác vào tâm điểm sáng ở bên trái */
.hotspot-dot.pos-edge-left .hotspot-popup::after {
    left: 14px !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

/* 2. Điểm sáng sát viền PHẢI (pos-edge-right):
   Cho popup mở về phía bên trái để không bao giờ bị cắt cụt cạnh phải */
.hotspot-dot.pos-edge-right .hotspot-popup {
    left: auto !important;
    right: 0 !important;
    transform: translateY(8px) !important;
}

.hotspot-dot.pos-edge-right:hover .hotspot-popup,
.hotspot-dot.pos-edge-right.active .hotspot-popup {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* Khi điểm sát viền phải ở phía trên cao (pos-bottom): mở hướng xuống dưới */
.hotspot-dot.pos-edge-right.pos-bottom .hotspot-popup {
    top: calc(100% + 14px) !important;
    bottom: auto !important;
    transform: translateY(-8px) !important;
}

.hotspot-dot.pos-edge-right.pos-bottom:hover .hotspot-popup,
.hotspot-dot.pos-edge-right.pos-bottom.active .hotspot-popup {
    transform: translateY(0) !important;
}

/* Mũi tên trỏ chuẩn xác vào tâm điểm sáng ở bên phải */
.hotspot-dot.pos-edge-right .hotspot-popup::after {
    left: auto !important;
    right: 14px !important;
    transform: translateX(50%) !important;
}
