﻿
/*BANNER CHO HOME PAGE*/
/* Banner container */
.banner {
    width: 100%;
    height: 500px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Slides */
.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    flex-direction: row;
}

    /* Active slide */
    .slide.active {
        opacity: 1;
    }

/* Image and text containers */
.image-container, .text-container {
    width: 50%;
    height: 100%;
}

    /* Image styling */
    .image-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Text container styling */
.text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 0 10px 10px 0;
}

/* Animation keyframes */
@keyframes slideShow {
    0% {
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    33% {
        opacity: 1;
    }

    38% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Apply animation to slides */
#slide1.active {
    animation: slideShow 12s infinite;
}

#slide2.active {
    animation: slideShow 12s infinite 4s;
}

#slide3.active {
    animation: slideShow 12s infinite 8s;
}
/* ========== Dots (Pagination Indicators) ========== */
.dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

/* Mỗi dot */
.dot {
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.9); /* Trắng đậm hơn */
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.3); /* Viền đen mờ để nổi trên nền sáng */
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

    /* Hover — làm sáng hơn, to nhẹ */
    .dot:hover {
        background: #fff;
        transform: scale(1.15);
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    }

    /* Dot đang active — chuyển sang màu vàng nổi bật */
    .dot.active {
        background: #fbbf24; /* Amber */
        border: 2px solid rgba(255, 255, 255, 0.8);
        box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
        transform: scale(1.25);
    }

    /* Click ripple effect */
    .dot::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 2px solid rgba(251, 191, 36, 0.6);
        transform: scale(0.5);
        opacity: 0;
        transition: all 0.4s ease;
    }

    .dot:active::after {
        transform: scale(2);
        opacity: 1;
    }

/* Responsive design */
@media (max-width: 768px) {
    .banner {
        height: 600px;
    }

    .slide {
        flex-direction: column;
    }

    .image-container, .text-container {
        width: 100%;
        height: 50%;
    }

        .image-container img {
            border-radius: 10px 10px 0 0;
        }

    .text-container {
        border-radius: 0 0 10px 10px;
    }

    .title {
        font-size: 2rem !important;
    }

    .sub-title {
        font-size: 1rem !important;
    }

    .btn {
        padding: 0.5rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
}



/* --- GRID SẢN PHẨM --- */
.isotope-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.grid-item {
    flex: 1 1 calc(20% - 20px); /* ✅ 5 cột trên PC */
    max-width: calc(20% - 20px);
    box-sizing: border-box;
}

/* Laptop: 4 cột */
@media (max-width: 1400px) {
    .grid-item {
        flex: 1 1 calc(25% - 20px);
        max-width: calc(25% - 20px);
    }
}

/* Tablet: 3 cột */
@media (max-width: 991px) {
    .grid-item {
        flex: 1 1 calc(33.33% - 20px);
        max-width: calc(33.33% - 20px);
    }
}

/* Mobile: 2 cột */
@media (max-width: 575px) {
    .grid-item {
        flex: 1 1 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}


.product {
    width: 100%;
    text-align: center;
    transition: transform 0.3s ease;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .product:hover {
        transform: translateY(-6px);
        box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    }

/* --- KHUNG ẢNH (Không cố định chiều cao, tự động điều chỉnh) --- */
.product-thumb {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Loại bỏ chiều cao cố định để ảnh tự điều chỉnh */
}

    /* --- ẢNH HIỂN THỊ KÍCH THƯỚC THẬT (Tối đa là 100% chiều rộng cột) --- */
    .product-thumb img {
        /* Đảm bảo ảnh không vượt quá chiều rộng của cột */
        max-width: 100%;
        /* Tự động tính chiều cao theo tỷ lệ gốc */
        height: auto;
        border-radius: 0;
        transition: transform 0.3s ease;
    }

    /* --- HIỆU ỨNG HOVER ẢNH THỨ HAI --- */
    .product-thumb .image-hover {
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0;
        transition: opacity 0.3s ease;
        /* Áp dụng lại các quy tắc kích thước để khớp với ảnh chính */
        max-width: 100%;
        height: auto;
    }

    .product-thumb:hover img.image-hover {
        opacity: 1;
    }

/* --- TÊN & GIÁ --- */
.product-info {
    padding: 15px 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

    .product-title a {
        color: inherit;
        text-decoration: none;
    }

        .product-title a:hover {
            color: #b8895e;
        }

.product-price {
    font-size: 15px;
    font-weight: bold;
    color: #b8895e;
}

/* --- NÚT TIM YÊU THÍCH --- */
.add-to-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    padding: 8px;
    transition: background 0.3s ease;
}

    .add-to-wishlist:hover {
        background: #b8895e;
    }

.learts-mb-30 {
    margin-bottom: 25px !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    .grid-item {
        flex: 1 1 calc(33.33% - 20px); /* 3 items per row */
        max-width: calc(33.33% - 20px);
    }
}

@media (max-width: 575px) {
    .grid-item {
        flex: 1 1 calc(50% - 20px); /* 2 items per row */
        max-width: calc(50% - 20px);
    }
}





/*SHOW SP THEO DẠNG MASONRY*/
.masonry-grid-container {
    column-count: 5;
    column-gap: 10px;
    margin: 0;
    padding: 0;
    width: 100%;
}


.masonry-grid-item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
}



/* Màn hình Laptop/Desktop vừa (Max 1400px): 4 Cột */
@media (max-width: 1400px) {
    .masonry-grid-container {
        column-count: 4;
    }
}

/* Tablets ngang/Laptop nhỏ (Max 992px): 3 Cột */
@media (max-width: 992px) {
    .masonry-grid-container {
        column-count: 3;
    }
}

/* Mobile ngang/Tablets dọc (Max 768px): 2 Cột */
@media (max-width: 768px) {
    .masonry-grid-container {
        column-count: 2;
    }
}

/* Mobile dọc (Max 576px): 1 Cột */
@media (max-width: 576px) {
    .masonry-grid-container {
        column-count: 1;
        column-gap: 0;
    }
}

/* ========== Dots (Pagination Indicators) ========== */
.dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    /* Hiệu ứng hover và active */
    .dot:hover {
        background: rgba(255, 255, 255, 0.8);
        transform: scale(1.15);
    }

    /* Active dot — có viền sáng & bóng nhẹ */
    .dot.active {
        background: #fbbf24; /* Màu amber vàng */
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
        transform: scale(1.2);
    }

    /* Thêm hiệu ứng gợn sóng khi click */
    .dot::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 2px solid rgba(251, 191, 36, 0.5);
        transform: scale(0.5);
        opacity: 0;
        transition: all 0.4s ease;
    }

    .dot:active::after {
        transform: scale(2);
        opacity: 1;
    }
/* ✅ MOBILE FIX: hiển thị 1 cột duy nhất */
@media (max-width: 768px) {
    .masonry-grid-container {
        column-count: 1 !important;
        column-gap: 0 !important;
    }

    .masonry-grid-item {
        width: 100% !important;
        display: block !important;
        margin-bottom: 20px !important;
    }

        .masonry-grid-item img {
            width: 100% !important;
            height: auto !important;
            display: block;
            border-radius: 8px;
        }

    .portfolio {
        width: 100% !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
    }

        .portfolio .content {
            padding: 12px;
            text-align: center;
        }

        .portfolio .title {
            font-size: 1rem;
            margin-top: 5px;
        }
}
/* ===== FADE-IN ANIMATION CHO SẢN PHẨM ===== */
.fade-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

    .fade-item.fade-visible {
        opacity: 1;
        transform: translateY(0);
    }
