/*slider*/

.slider {
    position: relative;
    overflow: hidden;
}

.slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    box-sizing: border-box;
}

/* Nút bấm Prev/Next */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%); 
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;

    /* Hiệu ứng ẩn hiện */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.prev { left: 10px; }
.next { right: 10px; }

/* Hiện nút khi di chuột vào Slider */
.slider:hover .prev,
.slider:hover .next {
    opacity: 1;
    visibility: visible;
}

/* Hiệu ứng khi di chuột vào nút bấm */
.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8) !important;
    transform: translateY(-50%) scale(1.1); /* Phóng to nhẹ */
}


/* ======================================================
   2. DANH SÁCH SẢN PHẨM (Grid & Card)
   ====================================================== */
.grid_row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.grid_column {
    flex: 1;
    max-width: 30%;
    box-sizing: border-box;
}

/* Cấu hình chung cho khung sản phẩm (gộp cả class Bootstrap và tự tạo) */
.card, .home-product-item {
    font-size: 20px; /* Cỡ chữ */
    text-align: center;
    border: 1px solid #ddd; /* Viền mờ */
    border-radius: 5px;
    background-color: #f9f9f9;

    /* Quan trọng: Tạo độ mượt cho hover */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}

/* Khung chứa ảnh sản phẩm */
.home-product-item-img {
    width: 100%;
    height: 220px; /* Chiều cao cố định */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 5px;
}

.home-product-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Giữ tỉ lệ ảnh đẹp */
    display: block;
}


/* ======================================================
   3. CÁC NÚT BẤM (Mua ngay, Thêm giỏ)
   ===================================================== */
.buy-now-btn {
    background-color: #ff0008;
    color: white;
    padding: 10px;
    border: none;
    cursor: pointer;
}
.buy-now-btn:hover {
    background-color: #eae1e7;
    color: #333;
}

.add-to-cart-btn {
    background-color: #ef3f3f;
    color: white;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-size: 12px; /* Đã chỉnh lại cho dễ nhìn */
    border-radius: 5px;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #f2e6ef;
    color: #333;
}



   /*4. HIỆU ỨNG HOVER SẢN PHẨM (Bay lên)*/

/* Khi ở chế độ SÁNG (Light Mode) */
html body .card:hover,
html body .home-product-item:hover {
    transform: translateY(-5px) !important; /* Bay lên 5px */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important; /* Bóng đổ đậm */
    border-color: #ff6b6b !important; /* Viền đỏ */
    cursor: pointer;
}



   /*5. DARK MODE (Chế độ tối)*/

/* Nền đen cho khung sản phẩm */
body.dark-theme .card,
body.dark-theme .home-product-item {
    background-color: #252525 !important;
    border: 1px solid #444 !important;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5) !important;
}

/* Màu chữ trắng */
body.dark-theme .card-title,
body.dark-theme h5 {
    color: #ffffff !important;
}

/* Giá tiền màu đỏ hồng */
body.dark-theme .text-danger {
    color: #ff6b6b !important;
}

/* Giữ nền trắng cho ảnh (để không bị chìm) */
body.dark-theme .home-product-item-img {
    background-color: #ffffff !important;
    margin-bottom: 10px;
}

/* Nút viền xanh (Bootstrap) */
body.dark-theme .btn-outline-primary {
    color: #8bb9fe !important;
    border-color: #8bb9fe !important;
}
body.dark-theme .btn-outline-primary:hover {
    background-color: #8bb9fe !important;
    color: #000 !important;
}

/* --- Hover riêng cho chế độ tối (Bóng đổ sáng) --- */
body.dark-theme .card:hover,
body.dark-theme .home-product-item:hover {
    background-color: #333 !important; /* Sáng hơn nền một chút */
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.1) !important; /* Bóng sáng mờ */
    border-color: #ff6b6b !important;
    transform: translateY(-5px) !important;
}