﻿/* --- BIẾN MÀU SẮC --- */
:root {
    --bg-cream: #FCF5EF;
    --brown-dark: #4B3022;
    --brown-light: #8D6E63;
    --gold: #FFD700;
    --text-main: #333;
    --green-matcha: #6fb490;
    --pink-berry: #ff6b81;
}

/* =========================================
   1. INTRO HERO SECTION (Banner)
   ========================================= */
#intro-picture {
    width: 100%;
    height: 500px; /* Chiều cao vừa phải cho trang con */
    position: relative;
    overflow: hidden;
}

.introSwiper {
    width: 100%;
    height: 100%;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Đảm bảo ảnh full khung không bị méo */
    filter: brightness(0.9); /* Làm tối nhẹ để chữ nổi hơn */
}

/* --- Typography: Title Cheese --- */
.title-cheese {
    text-wrap: nowrap;
    font-family: "Inter", sans-serif;
    font-weight: 900;
    font-size: clamp(40px, 7vw, 100px); /* Responsive font size */
    color: white;
    position: absolute;
    top: 45%;
    left: 50%;
    z-index: 100;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: fadeInUp 1s ease-out forwards 0.5s;
    display: flex;
    gap: 0;
}

    .title-cheese span {
        display: inline-block;
        text-shadow: 0 4px 30px rgba(0,0,0,0.5);
        animation: jumpDiscrete 6s ease-in-out infinite;
        /* Delay được gán inline trong HTML */
    }

    /* Gạch chân vàng */
    .title-cheese:after {
        content: '';
        position: absolute;
        bottom: -15px;
        left: 50%;
        transform: translateX(-50%);
        height: 4px;
        width: 0%;
        background: var(--gold);
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
        animation: expandLine 1s ease-out forwards 1.2s;
    }

/* --- Typography: Subtitle --- */
.subtitle-cheese {
    font-family: "Pacifico", cursive;
    font-weight: bold;
    position: absolute;
    top: 65%;
    left: 50%;
    z-index: 100;
    transform: translate(-50%, -20%);
    opacity: 0;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-size: clamp(18px, 2vw, 30px);
    width: 100%;
    text-align: center;
    animation: subtitleAppear 1s ease-out forwards;
    animation-delay: 1.8s;
}

/* =========================================
   2. KEYFRAMES ANIMATION
   ========================================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -30%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes expandLine {
    from {
        width: 0%;
    }

    to {
        width: 60%;
    }
}

@keyframes jumpDiscrete {
    0% {
        transform: translateY(0);
    }

    2% {
        transform: translateY(-20px);
        color: var(--gold);
    }

    4% {
        transform: translateY(0);
        color: white;
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes subtitleAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -20%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* =========================================
   3. MENU SECTION
   ========================================= */
.section-menu {
    padding: 80px 0;
    background-color: var(--bg-cream);
    min-height: 800px; /* Đảm bảo section có độ cao tối thiểu */
}

    .section-menu .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 15px;
    }

/* Header */
.menu-header {
    text-align: center;
    margin-bottom: 30px;
}

.menu-title {
    font-family: "Allura", cursive;
    font-size: 5rem;
    color: var(--brown-dark);
    margin-bottom: 10px;
    font-weight: 500;
    line-height: 1;
}

.menu-desc {
    font-family: "Kanit", sans-serif;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.divider-img {
    height: 30px;
    opacity: 0.6;
}

/* Tabs Filter */
.menu-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 30px;
    border: 2px solid var(--brown-dark);
    background: transparent;
    color: var(--brown-dark);
    font-family: "Kanit", sans-serif;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

    .tab-btn:hover, .tab-btn.active {
        background: var(--brown-dark);
        color: white;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(75, 48, 34, 0.3);
    }

/* =========================================
   4. PRODUCT GRID & CARDS
   ========================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: all 0.4s ease;
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column; /* Để footer (giá) luôn nằm dưới cùng */
}

    .product-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    }

/* Badge (Best Seller / New / Sale) */
.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--gold);
    color: var(--brown-dark);
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 20px;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Image Wrapper */
.card-img-wrapper {
    width: 100%;
    height: 280px;
    position: relative;
    overflow: hidden;
    background: #f9f9f9; /* Placeholder color */
}

    .card-img-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s ease;
    }

.product-card:hover .card-img-wrapper img {
    transform: scale(1.1);
}

/* Overlay Actions (Hover vào ảnh) */
.overlay-actions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .overlay-actions {
    opacity: 1;
}

/* Nút Xem Nhanh (Thẻ <a>) */
.btn-quick-view {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    color: var(--brown-dark);
    font-size: 1.2rem;
    /* Căn giữa icon trong thẻ a */
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none; /* Bỏ gạch chân */
    transition: transform 0.2s, color 0.2s;
}

    .btn-quick-view:hover {
        transform: scale(1.1) rotate(10deg);
        color: var(--gold);
    }

/* Card Body */
.card-body {
    padding: 20px;
    flex: 1; /* Đẩy phần này chiếm hết khoảng trống */
    display: flex;
    flex-direction: column;
}

.product-name {
    font-family: "Pacifico", cursive;
    font-size: 1.8rem;
    color: var(--brown-dark); /* Màu mặc định, sẽ bị override bởi inline-style từ View */
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-desc {
    font-family: "Kanit", sans-serif;
    font-size: 0.95rem;
    color: #777;
    margin-bottom: 20px;
    /* Giới hạn 2 dòng, có dấu ... */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px; /* Đảm bảo chiều cao đồng đều */
}

/* Giá & Nút Mua */
.price-row {
    margin-top: auto; /* Đẩy xuống đáy card */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed #eee;
    padding-top: 15px;
}

.price {
    font-family: "Kanit", sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--brown-dark);
}

/* Form bọc nút Add to Cart */
.price-row form {
    margin: 0;
    display: flex; /* Để nút button bên trong căn chỉnh đúng */
}

.btn-add-cart {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--bg-cream);
    color: var(--brown-dark);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .btn-add-cart:hover {
        background: var(--brown-dark);
        color: white;
    }

/* Button View More */
.btn-view-more {
    display: inline-block;
    padding: 12px 40px;
    background: transparent;
    border: 2px solid var(--brown-light);
    color: var(--brown-light);
    font-family: "Kanit", sans-serif;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s;
    margin-top: 40px;
}

    .btn-view-more:hover {
        background: var(--brown-light);
        color: white;
    }

/* =========================================
   5. UTILITIES & ANIMATIONS
   ========================================= */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

    .fade-up.active {
        opacity: 1;
        transform: translateY(0);
    }

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.4s;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    #intro-picture {
        height: 400px;
    }

    .menu-title {
        font-size: 3.5rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .card-img-wrapper {
        height: 180px;
    }

    .product-name {
        font-size: 1.4rem;
    }

    .card-body {
        padding: 15px;
    }

    .price {
        font-size: 1.1rem;
    }

    .btn-add-cart, .btn-quick-view {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}
/* --- STYLE CHO SẢN PHẨM HẾT HÀNG --- */

/* Làm mờ toàn bộ card */
.product-card.sold-out {
    opacity: 0.7; /* Mờ đi */
    filter: grayscale(0.5); /* Xám đi một chút */
    pointer-events: none; /* Không cho click vào card (Tùy chọn) */
}

    /* Nhưng vẫn cho phép click vào nút "Xem chi tiết" để xem thông tin */
    .product-card.sold-out .overlay-actions,
    .product-card.sold-out .btn-quick-view {
        pointer-events: auto;
    }

/* Nút hết hàng (Disable) */
.btn-add-cart.disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    border: 1px solid #ccc;
}

    .btn-add-cart.disabled:hover {
        background-color: #e0e0e0; /* Không đổi màu khi hover */
        color: #999;
        transform: none; /* Không nảy lên */
    }

/* Chỉnh lại layout phần giá để chứa được 2 dòng giá */
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end !important; /* Căn đáy để nút và giá thẳng hàng */
    border-top: 1px dashed #eee;
    padding-top: 15px;
    margin-top: auto;
}

.price-info {
    display: flex;
    flex-direction: column; /* Xếp giá cũ lên trên giá mới */
    line-height: 1.2;
}

.old-price {
    font-family: "Kanit";
    font-weight: 400;
}

/* Badge container để xếp chồng nhiều nhãn (VD: vừa Hot vừa Sale) */
.badges-wrapper .card-badge {
    position: relative; /* Reset position absolute cũ của badge */
    top: auto;
    left: auto;
    display: inline-block;
    width: fit-content;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}