.goi-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px;
}

.goi-item {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    background: #fff;
    transition: transform 0.3s ease;
}
.goi-item:hover {
    transform: translateY(-5px);
}

.goi-dac-biet {
    border: 2px solid #ff4081;
    background: #fff0f5;
    position: relative;
}

.giamgia {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e91e63;
    color: #fff;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: bold;
}

.goi-thumbnail {
    width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}
.giamgia-tag{
    font-style: italic;
    color: #e91e63;
}
.gia-box {
    font-size: 18px;
    margin: 10px 0;
}
.gia-box del {
    color: #999;
}
.gia-box strong {
    color: #e91e63;
    font-size: 22px;
}
.sanpham-giamgia-chitiet{
    text-align: center;
    font-style: italic;
    font-size: 18px;
    color: #e91e63;
}
.mota {
    margin-top: 10px;
}
.mota ul {
    list-style: none;
    padding: 0;
}
.mota li {
    padding: 4px 0;
    border-bottom: 1px dashed #ddd;
}

.btn-dat-mua {
    display: inline-block;
    margin-top: 12px;
    background: #2196f3;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    text-align: center;
    transition: background 0.3s ease;
}
.btn-dat-mua:hover {
    background: #1976d2;
}

.btn-highlight {
    background: linear-gradient(45deg, #f50057, #ff4081);
    box-shadow: 0 0 12px rgba(255,64,129,0.6);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 10px rgba(255,64,129,0.5); }
    50% { box-shadow: 0 0 20px rgba(255,64,129,0.9); }
    100% { box-shadow: 0 0 10px rgba(255,64,129,0.5); }
}


#goi-lightbox {
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
}
#goi-lightbox.show {
    display: flex;
}
.goi-lightbox-inner {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}
#goi-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}
.goi-lightbox-close {
    position: absolute;
    top: -10px; right: -10px;
    background: #fff;
    color: #333;
    font-size: 24px;
    border-radius: 50%;
    padding: 4px 10px;
    cursor: pointer;
}
/* 1. Container chính của header */
.goi-header {
    position: relative; /* Bắt buộc phải có để định vị thanh tiêu đề con */
    padding-top: 45px; /* Đẩy nội dung bên dưới xuống để không bị thanh tiêu đề che mất */
    border: 1px solid #e0e0e0; /* Thêm viền để trông đẹp hơn */
    border-radius: 4px;
    overflow: hidden; /* Ẩn phần nền xanh tràn ra ngoài nếu có bo góc */
}

/* 2. Thanh tiêu đề màu xanh */
.goi-header-title {
    /* --- Định vị và Kích thước --- */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 45px;

    /* --- Màu sắc --- */
    background-color: #0073aa; /* Màu xanh dương chuẩn của WordPress */
    color: #ffffff; /* Chữ màu trắng */

    /* --- Căn chỉnh nội dung (quan trọng) --- */
    display: flex; /* Sử dụng Flexbox để căn chỉnh */
    align-items: center; /* Căn giữa theo chiều dọc */
    padding: 0 15px; /* Tạo khoảng cách lề trái và phải */
    box-sizing: border-box; /* Đảm bảo padding không làm tăng chiều rộng */
}

/* 3. Icon ngôi nhà */
.goi-header-title .dashicons-admin-home {
    font-size: 22px; /* Chỉnh kích thước icon */
    margin-right: 10px; /* Tạo khoảng cách giữa icon và chữ */
    height: 22px; /* Giúp căn chỉnh tốt hơn */
    width: 22px;
}

/* 4. Tiêu đề chủ đề (chữ bên trong) */
.goi-header-title h4 {
    margin: 0; /* Xóa bỏ margin mặc định của thẻ h4 */
    padding: 0;
    font-size: 16px; /* Chỉnh kích thước chữ */
    font-weight: 600;
}

/* 5. Căn lề cho các nội dung còn lại */
.goi-header h3,
.goi-header .giamgia,
.goi-header .ghichu {
    padding: 0 15px; /* Thêm padding để thẳng hàng với tiêu đề xanh */
}

.goi-header h3 {
    margin-top: 15px;
}
.goi-item .goi-footer{
    text-align: center;
}
.goi-item .goi-body {
   text-align: center;
}
.goi-item .mota {
   text-align: left;
}
span.gia-ban-sale{
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
}
.gia-ban-goc{
    font-size: 16px;
    font-style: italic;
    color: #e7e9e9;
}
.goi-chitiet-right-m{
    display: flex;
    justify-content: center;
    justify-items: center;
    align-items: center;
}
.sanpham-col-50{
    width: 50%;
    display: inline-block;
}
.goi-item .goi-body .anh-dai-dien{
    display: flex;
    justify-content: center;
}
.goi-item .goi-body .mota{
    font-size: 18px;
    
}
.goi-item .goi-body .anh-dai-dien img{
    height: 150px;
    width: auto;
}
/* =============================================== */
/* === CSS CHO POPUP CHI TIẾT GÓI === */
/* =============================================== */

/* Lớp nền mờ */
.goi-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99999998;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Bỏ gạch chân cho nút "Xem chi tiết" */
.btn-dat-mua {
    text-decoration: none !important;
}

/* Đảm bảo khi di chuột vào cũng không có gạch chân */
.btn-dat-mua:hover {
    text-decoration: none !important;
}
/* =============================================== */
/* === CSS CHO POPUP CHI TIẾT GÓI (ĐÃ SỬA LỖI) === */
/* =============================================== */

/* Lớp nền mờ - Đảm bảo căn giữa */
#goi-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Tăng độ mờ một chút */
    z-index: 99998;
    max-width: none !important; 
    /* Dùng Flexbox để căn giữa hoàn hảo */
    display: flex;
    align-items: center;
    justify-content: center;
}

#goi-popup-content { /* <-- SỬ DỤNG ID (#) ĐỂ TĂNG ĐỘ ƯU TIÊN */
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    
    /* BƯỚC 1: Hủy bỏ giới hạn max-width từ theme WordPress */
    max-width: none !important; 

    /* BƯỚC 2: Áp dụng chiều rộng mong muốn của chúng ta */
    width: 75% !important;
    max-width: 1200px !important; /* Đặt lại giới hạn của riêng chúng ta để không quá rộng */

    /* Các thuộc tính khác giữ nguyên */
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}


/* Nút đóng popup */
.goi-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.goi-popup-close:hover {
    color: #000;
}
.swiper-slide, .swiper-slide-active{
    text-align: center;
}
.swiper-slide, .swiper-slide-active img{
    height: 550px;
    width: auto;
}

/* Hiệu ứng loading spinner */
.spinner-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.swiper-wrapper{
    height: 60vh !important;
}
.sanpham-chitiet-title{
    font-weight: bold;
    color: #0073aa;
}

/*
FORM ĐẶT HÀNG 
*/
.goi-form-wrap form {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0 12px;
    background: #fff;
}

.form-group input,
.form-group textarea {
    border: none;
    padding: 12px;
    flex: 1;
    font-size: 16px;
    background: transparent;
}

.form-icon {
    color: #888;
    margin-right: 8px;
    font-size: 18px;
}

input:focus,
textarea:focus {
    outline: none;
}

input:invalid {
    border-color: red;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.goi-form-wrap .btn-dat-mua {
    background-color: #007cba;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
}

.goi-form-wrap .btn-dat-mua:hover {
    background-color: #005b8f;
}

.form-success {
    animation: flash-success 1s ease-in-out 2;
    border: 2px solid #4caf50 !important;
}
#form-dat-goi{
    margin-top: 25PX;
    display: flex;
    justify-content: center;
}
@keyframes flash-success {
    0%, 100% { background-color: #e0ffe0; }
    50% { background-color: #c8f7c5; }
}

/* --- Tinh chỉnh cho Mobile --- */
@media screen and (max-width: 768px) {
    #goi-popup-content { /* <-- Đồng bộ sử dụng ID */
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0;
        padding: 20px;
    }
    .swiper-slide, .swiper-slide-active img{
        height: 60%;
        width: auto;
    }
    .goi-popup-close {
        top: 15px;
        right: 20px;
    }
    .goi-chitiet-right-m {
        flex-direction: column;
    }
    .sanpham-col-50 {
        width: 100%;
    }
    .goi-wrapper {
        grid-template-columns: 1fr;
    }
}
