/* ĐỊNH DẠNG CHO PHẦN SẢN PHẨM TRANG CHỦ */
/* Container chứa danh mục sản phẩm */
.product-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /* 10px khoảng cách dọc*/
}

/* Tiêu đề PRODUCT trong thanh product-bar */


/* Mỗi danh mục sản phẩm */
.product-category {
    width: 100%;
    transition: all 0.3s ease-in-out;
    /* Hiệu ứng mượt */
}

/* Khi danh mục bị ẩn */
.product-category.hidden {
    height: 0 !important;
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease-out;
}

/* Định dạng sản phẩm */
.product-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
    aspect-ratio: 1/1;
    transition: transform 0.3s ease-in-out;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

/* Hình ảnh sản phẩm */
.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
}

/* Hiệu ứng hover: Phóng to ảnh nhẹ */
.product-card:hover img {
    transform: scale(1.05);
}

/* Hiệu ứng hover: Đổ bóng khi di chuột */
.product-card:hover {
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
}

/* Hiệu ứng overlay */
.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: rgba(28, 187, 118, 0.9);
    color: white;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-size: 14px;
    font-weight: bold;
    transition: height 0.3s ease-in-out;
    opacity: 1;
}

/* Khi hover: Hiện overlay lên toàn bộ ảnh */
.product-card:hover .product-overlay {
    height: 70%;
    opacity: 0.5;
}

/* Hiệu ứng hover */
.product-card:hover {
    transform: scale(1.05);
}

/* Chữ trong overlay */
.overlay-text {
    text-align: center;
    width: 100%;
    transition: opacity 0.3s ease-in-out;
    z-index: 2;
}

/* Nút Learn More */
.read-more {
    display: none;
    font-size: 14px;
    font-weight: bold;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid white;
    background: transparent;
    color: white;
    transition: all 0.3s ease-in-out;
    text-decoration: none;
}

/* Khi hover vào sản phẩm, giữ nút Learn More */
.product-card:hover .read-more {
    display: inline-block;
    opacity: 1;
}

/* Khi hover vào nút Learn More, đổi màu */
.read-more:hover {
    background: rgb(61, 71, 174);
    color: #F4A533;
}

/* Đảm bảo chữ không bị mất */
.product-card a {
    text-decoration: none;
    color: inherit;
    z-index: 3;
    position: relative;
}

/* Đảm bảo hàng sản phẩm luôn giữ đúng kích thước */
.product-category .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Căn giữa khi có ít sản phẩm */
    gap: 10px 0;
    /* Khoảng cách giữa các dòng */
}

/* Định dạng sản phẩm trong danh mục */
.product-category .col-md-4 {
    display: flex;
    justify-content: center;
}

/* Nút chuyển slider */
/* .carousel-control-prev, .carousel-control-next {
    width: auto;
    background: rgba(188, 84, 29, 0.2);
    border-radius: 50%;
} */


/* Khi chọn danh mục sản phẩm, ẩn slider */
.product-category .category-slider {
    display: block;
}

/* Khi chọn danh mục cụ thể, ẩn slider */
.product-category.selected .category-slider {
    display: none;
}

/* Khi màn hình nhỏ hơn 992px (Tablet), Product Bar nhỏ lại */
@media (max-width: 992px) {


    .product-container {
        width: 100%;
        /* Sản phẩm vẫn chiếm nhiều hơn */
    }
}

/* Khi màn hình nhỏ hơn 768px (Điện thoại), Product Bar xuống dưới */
@media (max-width: 768px) {


    .product-container {
        width: 100%;
        /* Sản phẩm cũng chiếm toàn bộ */
        display: inline;
    }
}

/* Định dạng sản phẩm */
.product-item {
    flex: 1 1 calc(33.33% - 10px) !important;
    /* 3 sản phẩm mỗi hàng */
    max-width: calc(33.33% - 10px) !important;
    margin-bottom: 10px;
}

/* Khi màn hình nhỏ hơn 992px, hiển thị 2 sản phẩm mỗi hàng */
@media (max-width: 992px) {
    .product-item {
        flex: 1 1 calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
    }
}

/* Khi màn hình nhỏ hơn 600px, hiển thị 1 sản phẩm mỗi hàng */
@media (max-width: 600px) {
    .product-item {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

/* Định dạng Product Bar - full chiều ngang */
.product-bar-container {
    width: 100%;
    background-color: #f8f9fa;
    padding: 10px 0;
    border-radius: 8px;

    display: flex;
    /* THÊM DÒNG NÀY */
    align-items: center;
    /* Căn giữa theo chiều dọc */
    gap: 20px;
    /* Khoảng cách giữa PRODUCT và nav bar */
    flex-wrap: wrap;
    /* Cho phép xuống dòng nếu không đủ chỗ */
}

.product-bar {
    display: flex;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0 15px;
    gap: 15px;
    flex: 1;
    /* ✅ CHÌA KHÓA VÀNG: Cho phép phần nav chiếm phần còn lại */
}

.product-title {
    color: #d51717;
    font-weight: bold;
    margin: 0;
    text-transform: uppercase;
    flex-shrink: 0;
    /* Không co lại */
}


.product-bar .nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Định dạng các mục */
.product-bar .nav-item {

    flex-shrink: 0;
    /* Không cho các mục co lại */
}

/* Định dạng link */
.product-bar .nav-link {
    font-weight: bold;
    color: #007bff;
    padding: 10px 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
    font-size: 16px;
}


.product-bar .nav-link:hover {
    background-color: #007bff;
    color: white;
    border-radius: 5px;
}

/* Khi màn hình nhỏ hơn 768px, đổi thành menu dọc */
@media (max-width: 768px) {
    .product-bar-container {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

    .product-bar {
        flex-wrap: wrap;
        /* Cho phép xuống dòng */
        overflow-x: visible;
        /* Không có thanh cuộn */
    }

    .product-bar .nav {
        flex-direction: column;
        /* Chuyển thành dọc */
        align-items: center;
        width: 100%;
        gap: 5px;
    }

    .product-bar .nav-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px;
    }
}

/* Định dạng sản phẩm theo 4 cột */
.product-item {
    width: 20%;
    /* Mỗi sản phẩm chiếm 23.5% để đảm bảo fit 4 cột */
    max-width: 20%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    /* Khoảng cách giữa các dòng */
}

/* Định dạng khi màn hình nhỏ hơn 992px (Tablet) */
@media (max-width: 992px) {
    .product-item {
        width: 48%;
        /* Hiển thị 2 sản phẩm mỗi hàng */
        max-width: 48%;
    }
}

/* Định dạng khi màn hình nhỏ hơn 600px (Mobile) */
@media (max-width: 600px) {
    .product-item {
        width: 100%;
        /* Hiển thị 1 sản phẩm mỗi hàng */
        max-width: 100%;
    }
}