/* =========================================
   GIAO DIỆN RIÊNG CHO TRANG SẢN PHẨM
   ========================================= */

.page-banner {
    background: var(--dark-gray);
    color: white;
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
}

.page-banner h1 {
    font-size: 36px;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.back-home {
    display: inline-block;
    margin-top: 20px;
    color: white;
    text-decoration: none;
    border: 1px solid white;
    padding: 8px 20px;
    border-radius: 5px;
    transition: 0.3s;
}

.back-home:hover {
    background: white;
    color: var(--dark-gray);
}

/* =========================================
   GIAO DIỆN POPUP (MODAL) CHI TIẾT SẢN PHẨM
   ========================================= */
.modal {
    display: none;
    /* Ẩn hoàn toàn khi mới vào web */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    /* Nền đen mờ */
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    /* Không cao quá màn hình */
    overflow-y: auto;
    /* Tạo thanh cuộn nếu nội dung quá dài */
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Nút X tắt Popup ở góc phải */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #999;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.close-btn:hover {
    color: var(--primary-red);
}

/* Bố cục chia 2 cột: Ảnh và Thông tin */
.modal-body {
    display: flex;
    flex-wrap: wrap;
}

.modal-image {
    flex: 1;
    min-width: 300px;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.modal-info {
    flex: 1;
    min-width: 300px;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.modal-info h2 {
    color: var(--dark-gray);
    font-size: 28px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.modal-price {
    color: var(--primary-red);
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 20px;
}

/* Sao chép style từ khung info của thẻ card */
.modal-specs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    color: #555;
    font-weight: bold;
}

.modal-desc {
    color: #555;
    line-height: 1.8;
    margin-bottom: 30px;
    flex-grow: 1;
    text-align: justify;
}

.btn-call-popup {
    background: var(--primary-red);
    color: white;
    padding: 15px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    flex: 2;
    /* Nút gọi to hơn */
    transition: background 0.3s;
}

.btn-call-popup:hover {
    background: #992d22;
}

/* =========================================
   HIỆU ỨNG SLIDE ẢNH TRONG POPUP
   ========================================= */
.slider-container {
    position: relative;
    overflow: hidden;
    /* Giấu các ảnh bị tràn ra ngoài khung */
    display: flex;
    align-items: center;
    background-color: #f1f2f6;
    /* Màu nền chờ khi ảnh đang tải */
}

.slider-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
    /* Hiệu ứng trượt mượt mà 0.4s */
}

.slider-wrapper img {
    width: 100%;
    flex-shrink: 0;
    /* Ép ảnh không bị co nhỏ lại */
    object-fit: cover;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

/* Nút bấm chuyển ảnh trái phải */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 50%;
    z-index: 10;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Đảm bảo ảnh bo góc đúng trên điện thoại */
@media (max-width: 768px) {
    .slider-wrapper img {
        border-bottom-left-radius: 0;
        border-top-right-radius: 12px;
        max-height: 250px;
    }
}

/* =========================================
   ĐỒNG BỘ NÚT XEM THÊM SẢN PHẨM CAO CẤP
   ========================================= */
#load-more-container {
    text-align: center;
    margin: 50px 0 20px 0;
    /* Tạo khoảng cách thông thoáng trên dưới */
}

#btn-load-more {
    /* 1. Xóa bỏ hoàn toàn định dạng thô mặc định của trình duyệt */
    border: none;
    outline: none;
    font-family: inherit;
    /* Ép dùng chung phông chữ Segoe UI của hệ thống */

    /* 2. Thiết lập màu sắc và kích thước theo chuẩn THOLAND */
    background-color: var(--primary-red);
    /* Lấy màu đỏ thương hiệu */
    color: white;
    padding: 14px 35px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;

    /* 3. Hiệu ứng đổ bóng đổ mịn màng */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease-in-out;
}

/* Hiệu ứng tương tác mượt mà khi di chuột vào nút */
#btn-load-more:hover {
    background-color: #992d22;
    /* Đỏ sậm hơn chút giống nút gọi điện */
    transform: translateY(-3px);
    /* Nút nhấc nhẹ lên tạo cảm giác nổi nổi */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    /* Bóng đổ đậm hơn khi nổi lên */
}

/* Hiệu ứng khi khách click chuột bấm vào nút */
#btn-load-more:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* =========================================
   CẤU TRÚC LƯỚI 2 DÒNG CHO 4 NÚT TRONG POPUP
   ========================================= */
.modal-actions {
    display: grid;
    /* Chia chính xác thành 2 cột bằng nhau, tự động tạo thành 2 dòng */
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    /* Khoảng cách thông thoáng giữa các nút */
    margin-top: 25px;
    width: 100%;
}

/* Đồng bộ kích thước cho tất cả các nút nằm trong Popup */
.modal-actions .btn-zalo,
.modal-actions .btn-fb,
.modal-actions .btn-call-popup,
.modal-actions .btn-close-popup {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 8px;
    /* Khoảng đệm vừa vặn */
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin: 0;
    /* Xóa khoảng cách thừa */
    white-space: nowrap;
}

/* Đảm bảo nút Đóng (Close) có giao diện hài hòa */
.btn-close-popup {
    background-color: #e0e0e0;
    color: #333;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close-popup:hover {
    background: #dfe4ea;
}

/* Dành cho màn hình điện thoại */
@media (max-width: 768px) {
    .modal-image img {
        border-bottom-left-radius: 0;
        border-top-right-radius: 12px;
        max-height: 250px;
    }

    .modal-info {
        padding: 25px 20px;
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* =========================================
   THANH SẮP XẾP VÀ LỌC KÉP ĐỒNG BỘ CẤU TRÚC
   ========================================= */
.filter-container {
    display: flex;
    justify-content: flex-end;
    /* Đẩy toàn bộ bộ lọc sang góc phải */
    align-items: center;
    margin: 10px 0 35px 0;
    gap: 25px;
    /* Khoảng cách giữa bộ lọc Vị Trí và Giá */
    flex-wrap: wrap;
    /* Tự động xuống hàng nếu màn hình nhỏ */
}

.filter-item {
    display: flex;
    align-items: center;
}

.filter-item label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    font-weight: 600;
    margin-right: 10px;
    white-space: nowrap;
}

.filter-item select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 42px 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease-in-out;
}

.filter-item select:hover {
    border-color: var(--primary-red);
    background-color: #fafafa;
}

.filter-item select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(186, 45, 33, 0.15);
}

/* TỐI ƯU TRÊN MOBILE */
@media (max-width: 768px) {
    .filter-container {
        justify-content: center;
        gap: 15px;
        padding: 0 15px;
    }

    .filter-item {
        width: 100%;
        /* Trên điện thoại, mỗi bộ lọc chiếm 1 hàng toàn màn hình */
        justify-content: space-between;
    }

    .filter-item select {
        flex: 1;
        max-width: 70%;
        padding: 8px 35px 8px 12px;
        font-size: 13px;
    }
}