/* =============================================================================
   VBS Single Product - Styling (v1.1 - Đã cập nhật)
   ========================================================================== */

/* 1. Container chính (Bố cục 1 cột) - ĐÃ SỬA */
.vbs-single-container {
    max-width: 1200px; /* FIX 4: Sửa layout rộng 1200px */
    margin: 20px auto;
    padding: 20px;
    background: #F8FAFC;
    /* FIX 5: Bỏ box-shadow */
}

/* === CODE MỚI BẮT ĐẦU (FIX 3: BREADCRUMB) === */
.vbs-breadcrumb {
    margin-bottom: 24px;
    font-size: 14px;
}
/* === CODE MỚI KẾT THÚC === */


/* 2. Header (Tiêu đề, Meta) */
.vbs-single-product .entry-header {
    margin-bottom: 24px;
    border-bottom: 1px solid #eee; /* Dùng line mỏng 1px */
    padding-bottom: 16px;
}

.vbs-single-product .entry-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.vbs-single-product .entry-meta {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #777;
    display: flex;
    gap: 16px;
}

.vbs-single-product .entry-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vbs-single-product .entry-meta svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* 3. Ảnh đại diện */
.featured-image-wrapper {
    margin-bottom: 24px;
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f5;
}

.featured-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* 4. Thư viện ảnh */
.product-gallery {
    margin-bottom: 32px;
}

/* FIX 5: Sửa line tiêu đề (mỏng) */
.gallery-title,
.info-title,
.content-title {
    font-family: 'Work Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #2E3293; /* Màu brand */
    margin-bottom: 16px;
    border-bottom: 1px solid #2E3293; /* Sửa thành 1px mỏng */
    padding-bottom: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 cột */
    gap: 12px;
}

.gallery-item a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    transition: transform 0.2s ease;
}

.gallery-item a:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 120px; /* Chiều cao cố định */
    object-fit: cover; /* Cắt ảnh vừa vặn */
    display: block;
}

/* 5. Khối Thông tin Chính */
.product-main-info {
    margin-bottom: 32px;
    background: #f9faff; /* Nền xanh nhạt */
    border: 1px solid #e0e6ff;
    border-radius: 8px;
    padding: 24px;
}

.product-main-info .info-title {
    margin-top: 0;
    border: none;
    padding: 0;
}

.product-main-info ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

.product-main-info li {
    display: grid;
    grid-template-columns: 140px 1fr; /* Chia 2 cột cho label và value */
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee; /* FIX 5: Sửa line mỏng (thay vì dashed) */
}

.product-main-info li:last-child {
    border-bottom: none;
}

.product-main-info .info-label {
    font-weight: 600;
    color: #333;
}

.product-main-info .info-value {
    color: #1a1a1a;
    word-break: break-word; /* Chống vỡ layout nếu email/sđt quá dài */
}

.product-main-info .info-value.price {
    font-size: 18px;
    font-weight: 700;
    color: #E53E3E; /* Màu đỏ cho giá */
}

.product-main-info .info-value.masked {
    font-weight: 600;
}

/* 6. Nội dung Mô tả */
.entry-content {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.entry-content .content-title {
    font-size: 20px;
}

.entry-content p {
    margin-bottom: 1.5em;
}

/* 7. Responsive cho Di động */
@media (max-width: 767px) {
    .vbs-single-container {
        margin: 10px;
        padding: 15px;
    }

    .vbs-single-product .entry-title {
        font-size: 26px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cột trên di động */
    }

    .gallery-item img {
        height: 150px;
    }
    
    .product-main-info li {
        grid-template-columns: 1fr; /* 1 cột trên di động */
        gap: 4px;
    }

    .product-main-info .info-label {
        font-size: 14px;
        color: #555;
    }
}

/* === CODE MỚI BẮT ĐẦU (FIX BO TRẮNG DÀY) === */

/* Loại bỏ padding và box-shadow của container chính của Astra */
.ast-separate-container .site-content .ast-container,
.ast-separate-container #content,
.ast-separate-container #primary {
    padding-top: 0;
    padding-bottom: 0;
}

.ast-separate-container .site-main,
.ast-separate-container .ast-article-post {
    box-shadow: none; /* Loại bỏ box-shadow */
    padding: 0; /* Loại bỏ padding nội bộ */
    background-color: transparent; /* Đảm bảo không có màu nền trắng */
}

/* Đảm bảo container của chúng ta chiếm toàn bộ chiều rộng có thể */
.vbs-single-container {
    padding-left: 0;
    padding-right: 0;
}
/* === CODE MỚI KẾT THÚC === */
/* === CODE MỚI BẮT ĐẦU (FIX KHOẢNG TRẮNG TOP/BOTTOM) === */

/* Nhắm mục tiêu cụ thể hơn vào khu vực nội dung chính */
.single-tin_xuat_khau .site-content #primary.content-area {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 20px; /* Thêm một chút đệm nhỏ ở trên cho thoáng */
    padding-bottom: 20px; /* Thêm một chút đệm nhỏ ở dưới cho thoáng */
    background-color: #F8FAFC !important; /* Đảm bảo nền trong suốt */
}

/* Đảm bảo container bên trong nó cũng không có lề dọc */
.single-tin_xuat_khau .site-main {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Giảm khoảng cách mặc định của header trang (nếu có) */
.single-tin_xuat_khau .ast-page-builder-template .entry-header {
    margin-bottom: 0; 
}

/* Điều chỉnh lại padding cho container của chúng ta */
.vbs-single-container {
    padding-top: 0;
    padding-bottom: 0;
}
/* === CODE MỚI KẾT THÚC === */
/* === CODE MỚI BẮT ĐẦU (FIX 1: SLIDER STYLING) === */

/* Container chung cho slider */
.product-gallery-slider {
    margin-bottom: 32px;
}

/* Ảnh lớn hiển thị - ĐÃ SỬA TỶ LỆ VÀ THÊM MAX-HEIGHT */
.main-image-display {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background-color: #f5f5f5;
    position: relative;
    padding-top: 60%; /* Tỷ lệ rộng hơn (gần 16:9) */
    max-height: 500px; /* Giới hạn chiều cao tối đa */
}

.main-image-display img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Hiển thị toàn bộ ảnh */
    display: block;
}

/* Hàng ảnh nhỏ (thumbnail) */
.thumbnail-strip {
    display: flex; /* Dàn hàng ngang */
    gap: 10px;
    overflow-x: auto; /* Cho phép cuộn ngang nếu nhiều ảnh */
    padding-bottom: 10px; /* Thêm padding để thanh cuộn không quá sát */
}

.thumb-item {
    flex: 0 0 80px; /* Chiều rộng cố định cho mỗi thumbnail */
    height: 80px;
    border: 2px solid transparent; /* Border mặc định trong suốt */
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
    background-color: #f5f5f5;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cắt ảnh thumbnail cho vừa */
    display: block;
}

/* Kiểu khi thumbnail được chọn (active) */
.thumb-item.active {
    border-color: #2E3293; /* Màu brand */
}

/* Kiểu khi di chuột vào thumbnail */
.thumb-item:hover {
    border-color: #aaa;
}

/* Responsive cho thumbnail trên di động */
@media (max-width: 767px) {
    .thumb-item {
        flex: 0 0 60px; /* Thu nhỏ thumbnail */
        height: 60px;
    }
    .main-image-display {
         padding-top: 100%; /* Đổi ảnh lớn thành vuông trên mobile */
    }
}


/* === CODE MỚI KẾT THÚC === */

/* === CODE MỚI BẮT ĐẦU (FIX 1: SLIDER ARROWS STYLING) === */

/* Định vị nút bấm */
.main-image-display {
    position: relative; /* Đảm bảo nút con có thể định vị tuyệt đối */
}

.vbs-gallery-arrow {
    position: absolute;
    top: 50%; /* Canh giữa theo chiều dọc */
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.7); /* Nền trắng mờ */
    border: none;
    border-radius: 50%; /* Nút tròn */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333; /* Màu icon */
    transition: background-color 0.2s ease, opacity 0.3s ease;
    opacity: 0; /* Mặc định ẩn đi */
    z-index: 10;
}

/* Hiển thị nút khi di chuột vào khu vực ảnh lớn */
.main-image-display:hover .vbs-gallery-arrow {
    opacity: 1;
}

.vbs-gallery-arrow:hover {
    background-color: rgba(255, 255, 255, 0.9); /* Sáng hơn khi hover */
}

/* Vị trí cụ thể cho nút Prev/Next */
.vbs-gallery-arrow.prev {
    left: 15px;
}

.vbs-gallery-arrow.next {
    right: 15px;
}

/* Style cho icon SVG bên trong nút */
.vbs-gallery-arrow svg {
    width: 24px;
    height: 24px;
}

/* Ẩn nút trên di động (vì không có hover) */
@media (max-width: 767px) {
    .vbs-gallery-arrow {
        display: none;
    }
}

/* === CODE MỚI KẾT THÚC === */

/* === CODE MỚI BẮT ĐẦU (FIX XUNG ĐỘT CSS CHO NÚT BẤM) === */

/* Ghi đè các style mặc định có thể có của theme/plugin */
.vbs-single-product .vbs-gallery-arrow {
    background-color: rgba(255, 255, 255, 0.7) !important; /* Ép nền trắng mờ */
    color: #333 !important; /* Ép màu icon */
    border: none !important; /* Bỏ border */
    padding: 0 !important; /* Bỏ padding mặc định */
    line-height: 1 !important; /* Đảm bảo icon canh giữa */
    box-shadow: none !important; /* Bỏ đổ bóng nếu có */
}

/* Đảm bảo SVG hiển thị đúng */
.vbs-single-product .vbs-gallery-arrow svg {
    display: inline-block !important; /* Hiển thị icon */
    vertical-align: middle; /* Canh giữa icon */
    fill: currentColor !important; /* Icon dùng màu chữ (color) đã ép ở trên */
    width: 24px !important; /* Ép kích thước */
    height: 24px !important;
}

.vbs-single-product .vbs-gallery-arrow:hover {
     background-color: rgba(255, 255, 255, 0.9) !important; /* Sáng hơn khi hover */
}

/* === CODE MỚI KẾT THÚC === */

/* === CODE MỚI BẮT ĐẦU (FIX 6: CTA BUTTON & MODAL STYLING) === */

/* Styling for the CTA Button Section */
.vbs-cta-section {
    margin: 32px 0; /* Add space around the button */
    text-align: center; /* Center the button */
}

.vbs-cta-button {
    background-color: #2E3293; /* Brand color */
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Work Sans', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.vbs-cta-button:hover {
    background-color: #1a1e6a; /* Darker shade on hover */
}

.vbs-cta-button:active {
    transform: scale(0.98); /* Slight shrink effect on click */
}


/* Styling for the Modal (Popup) - Initially Hidden */

/* 1. Modal Overlay (background) */
.vbs-modal-overlay {
    position: fixed; /* Stay in place */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black */
    z-index: 1000; /* Ensure it's on top */
    display: none; /* Hidden by default */
    opacity: 0; /* Start invisible */
    transition: opacity 0.3s ease; /* Fade-in effect */
}

/* 2. Modal Content Box */
.vbs-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the box */
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px; /* Limit maximum width */
    max-height: 80vh; /* Limit maximum height */
    overflow-y: auto; /* Allow scrolling if content is tall */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001; /* Above overlay */
    display: none; /* Hidden by default */
    opacity: 0; /* Start invisible */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Fade and scale effect */
    transform: translate(-50%, -60%); /* Start slightly higher for pop-up effect */
}

/* 3. Modal Header (Title and Close button) */
.vbs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.vbs-modal-title {
    font-size: 20px;
    font-weight: 600;
    font-family: 'Work Sans', sans-serif;
    color: #333;
    margin: 0;
}

.vbs-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    padding: 5px;
}

.vbs-modal-close:hover {
    color: #333;
}

/* 4. Modal Body (Where the form will go) */
.vbs-modal-body {
    /* Styles for the form inside will be handled by Forminator,
       but we can add spacing if needed */
}

/* Styles to show the modal */
.vbs-modal-overlay.vbs-modal-show,
.vbs-modal-content.vbs-modal-show {
    display: block; /* Make it visible */
    opacity: 1; /* Make it fully opaque */
}

.vbs-modal-content.vbs-modal-show {
     transform: translate(-50%, -50%); /* Move to final centered position */
}


/* === CODE MỚI KẾT THÚC === */

/* === CODE MỚI BẮT ĐẦU (FIX 10: BREADCRUMB STYLING - AFTER HEADER) === */

/* Nhắm mục tiêu vào breadcrumb của Astra khi ở vị trí After Header */
.ast-breadcrumbs-wrapper.ast-breadcrumb-position-after-header {
    margin-top: 15px; /* Giảm khoảng cách phía trên */
    margin-bottom: 15px; /* Giảm khoảng cách phía dưới */
    padding-top: 10px;
    padding-bottom: 10px;
    /* background-color: #f9f9f9; */ /* Bỏ nền xám nếu không thích */
    max-width: 1200px; /* Giới hạn chiều rộng giống container */
    margin-left: auto; /* Canh giữa */
    margin-right: auto;
    padding-left: 20px; /* Thêm padding ngang */
    padding-right: 20px;
}

/* Điều chỉnh font chữ và màu sắc nếu cần */
.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner a,
.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner span {
    font-size: 14px;
    color: #555;
}

.ast-breadcrumbs-wrapper .ast-breadcrumbs-inner .breadcrumb-trail span:last-child {
    color: #1a1a1a; /* Màu đậm hơn cho mục hiện tại */
}

/* Điều chỉnh lại padding top của container chính để không bị quá sát */
.single-tin_xuat_khau .site-content #primary.content-area,
.single-tin_nhap_khau .site-content #primary.content-area { /* ÁP DỤNG CHO CẢ HAI CPT */
    padding-top: 0; 
}

/* === CODE MỚI KẾT THÚC === */

/* === CODE MỚI: Đổi nền trang thành trắng === */
body.single-tin_xuat_khau,
.ast-separate-container .ast-article-single { /* Nhắm mục tiêu cụ thể hơn cho Astra */
    background-color: #ffffff !important; /* Màu trắng */
}

/* === CODE MỚI BẮT ĐẦU (FIX 53: GIÁ THỎA THUẬN CONSISTENCY) === */

/* BƯỚC 1: Đảm bảo giá tiền thật có màu đỏ mạnh */
/* Quy tắc này ghi đè lên màu xanh của "Giá thoả thuận" */
.vbs-product-card .card-price {
    color: #E53E3E !important; /* Đỏ mạnh cho giá trị tiền tệ */
}

/* BƯỚC 2: Định nghĩa lại style cho trạng thái Negotiable */
.vbs-product-card .card-price.negotiable-price,
.product-main-info .info-value.negotiable-price { /* Áp dụng cho cả Single */
    font-size: 18px !important; /* Đảm bảo kích thước chữ lớn */
    font-weight: 700 !important;
    color: #2E3293 !important; /* Màu xanh thương hiệu cho trạng thái thỏa thuận */
}
/* === CODE MỚI KẾT THÚC === */
/* === CODE MỚI KẾT THÚC === */