/* css/style.css */
:root {
    --bg-cream: #F7F6F2;
    --text-black: #000000;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Cho hiệu ứng cuộn mượt mà */
}

body {
    background-color: var(--bg-cream);
    color: var(--text-black);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden; /* Ngăn chặn tràn màn hình theo chiều ngang */
    padding-top: 80px; 
}

/* ==========================================================================
   CLEAN HEADER & NAVIGATION
   ========================================================================== */
.navbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--bg-cream);
    z-index: 3000; /* Tăng z-index để navbar luôn nằm trên lớp mờ */
    align-items: center;
    padding: 0 5%;
    justify-content: space-between;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
}

.header-col-left { flex: 1; display: flex; align-items: center; }
.header-col-center { flex: 0 0 auto; }
.header-col-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 1.5rem; }

.logo img { height: 50px; width: auto; display: block; }

.nav-links { display: flex; list-style: none; gap: 3rem; }
.nav-links a { 
    text-decoration: none; color: var(--text-black); text-transform: uppercase; 
    font-size: 0.8rem; letter-spacing: 1.5px; font-weight: 600;
}

.nav-icon-btn { 
    background: none; border: none; color: var(--text-black); cursor: pointer; 
    position: relative; padding: 5px; transition: transform 0.2s;
}
.nav-icon-btn:hover { transform: translateY(-2px); }

/* Search Overlay Design */
.search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(247, 246, 242, 0.98); z-index: 2000;
    display: none; align-items: flex-start; justify-content: center;
    padding-top: 10vh; backdrop-filter: blur(10px);
}
.search-overlay.active { display: flex; }

.search-overlay-content { width: 100%; max-width: 800px; padding: 0 20px; }
.search-input-wrapper {
    display: flex; align-items: center; gap: 15px;
    border-bottom: 2px solid var(--text-black); padding-bottom: 10px;
}
.search-input-wrapper input {
    flex: 1; border: none; background: none; font-size: 2rem;
    font-family: var(--font-serif); outline: none;
}
.close-search-btn { background: none; border: none; font-size: 2.5rem; cursor: pointer; }

.search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.1);
    z-index: 2500;
    display: none;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    animation: suggestionSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 450px;
    overflow-y: auto;
}

@keyframes suggestionSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Badge Styling */
.badge {
    position: absolute; top: -2px; right: -2px; background: #c0392b;
    color: #fff; font-size: 9px; font-weight: 700; width: 16px; height: 16px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-cream);
}

/* Dropdown Menu */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; 
    top: 100%; 
    left: 50%; 
    transform: translateX(-50%) translateY(10px);
    background: #fff;
    min-width: 220px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    list-style: none; 
    padding: 15px 0; 
    border-radius: 4px;
    opacity: 0; 
    visibility: hidden; 
    transition: 0.3s; 
    z-index: 1200;
    border: 1px solid #eee;
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { padding: 10px 20px; display: block; text-transform: none; font-size: 0.9rem; }
.dropdown-menu a:hover { background: #f9f9f9; }

/* Cho phép Mega Menu tràn toàn màn hình */
.nav-links > li.dropdown { 
    position: static; 
}

/* Mega Dropdown cho danh mục lớn như Dụng cụ bếp */
.mega-menu {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    top: 80px; /* Khớp với chiều cao của navbar */
    display: flex;
    padding: 40px 10% !important; /* Căn lề lùi vào cho nội dung cân đối */
    gap: 20px;
    flex-wrap: wrap; /* Cho phép rớt dòng nếu quá nhiều danh mục */
    transform: translateY(10px) !important;
    justify-content: center;
    border-radius: 0; /* Tràn ngang thường không để bo góc */
    border-left: none;
    border-right: none;
}
.dropdown:hover .mega-menu { transform: translateY(0) !important; }

.mega-col { 
    flex: 0 0 200px; /* Giữ độ rộng cột ổn định */
}
.mega-col h4 {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #888;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Mobile Navigation */
.menu-toggle {
    display: none; flex-direction: column; gap: 6px; cursor: pointer;
    background: none; border: none; padding: 10px; z-index: 4000; /* Tăng z-index để không bị đè */
    margin-right: 15px;
}
.menu-toggle span { 
    width: 22px; height: 1.5px; background: var(--text-black); 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Benefits Section */
.benefits-bar {
    background: #fff;
    padding: 2rem 5%;
    border-bottom: 1px solid #f0f0f0;
}
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.benefit-item {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}
.benefit-item svg { color: #5a8f79; flex-shrink: 0; }
.benefit-item span { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

/* Facebook Feed Styles (Global) */
.fb-feed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
.fb-post-card { background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; display: flex; flex-direction: column; text-align: left; }
.fb-post-header { display: flex; align-items: center; gap: 12px; padding: 15px; }
.fb-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.fb-post-info { display: flex; flex-direction: column; line-height: 1.3; }
.fb-post-info strong { font-size: 0.95rem; color: #050505; }
.fb-post-info small { font-size: 0.8rem; color: #65676b; }
.fb-post-content { padding: 0 15px 15px; font-size: 0.9rem; color: #1c1e21; flex: 1; }
.fb-post-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; cursor: pointer; transition: opacity 0.3s; }

@media (max-width: 992px) {
    .menu-toggle { display: flex; }
    .header-col-center { display: contents; } 
    .mobile-hide { display: none; }
    
    .nav-links {
        position: fixed; top: 0; left: -100%; width: 80%; height: 100vh;
        background: var(--bg-cream); flex-direction: column; padding: 70px 20px 20px 20px; /* Giảm padding trên và dưới */
        height: 100dvh; /* Tự động điều chỉnh theo thanh công cụ trình duyệt mobile */
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 3100; 
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        gap: 0.5rem; /* Giảm khoảng cách giữa các mục menu chính */
        overflow-y: auto; /* Cho phép cuộn nếu danh mục quá dài */
        -webkit-overflow-scrolling: touch; /* Giúp cuộn mượt hơn trên iPhone */
    }
    .nav-links.active { left: 0; }
    
    .nav-links a { font-size: 1.1rem; letter-spacing: 2px; } /* Giữ nguyên font-size */
    .nav-links > li > a { padding: 8px 0; } /* Thêm padding dọc cho các mục menu cấp cao nhất */
    
    /* Overlay khi mở menu */
    body.menu-open::after {
        content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 2500; 
    }

    .mobile-only { display: block; }

    /* Hamburger to X Animation */
    .menu-toggle.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

    /* Tối ưu Mega Menu trên Mobile thành dạng Accordion */
    .nav-links li.dropdown .mega-menu {
        position: static !important;
        display: none !important; /* Mặc định ẩn trên mobile */
        width: 100% !important;
        padding: 8px 0 8px 15px !important; /* Giảm padding cho mega-menu con */
        background: rgba(0,0,0,0.02) !important;
        box-shadow: none !important;
        transform: none !important;
        flex-direction: column;
        gap: 0.5rem !important; /* Giảm khoảng cách giữa các cột trong mega-menu */
        border: none !important;
    }

    /* Hiện menu con khi cha có class mobile-expanded */
    .nav-links li.dropdown.mobile-expanded .mega-menu {
        display: flex !important;
    }

    .mega-col {
        flex: 1 1 100% !important;
        width: 100%;
    }

    .mega-col h4 {
        font-size: 0.8rem !important;
        margin-bottom: 10px !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
        color: #888;
    }

    .mega-col a {
        padding: 8px 0 !important;
        display: block;
        font-size: 0.9rem !important;
        text-transform: none !important;
        opacity: 0.8;
        letter-spacing: 0.5px !important;
    }

    /* Hiệu ứng xoay mũi tên khi mở rộng */
    li.dropdown > a svg { transition: transform 0.3s; }
    li.dropdown.mobile-expanded > a svg {
        transform: rotate(180deg);
    }
}



/* Hero Section */
.hero {
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(235, 234, 230, 0.8), rgba(235, 234, 230, 0.8)), url('../Asset/images/hero-bg.jpg') no-repeat center center/cover; /* Đã đổi sang .webp */
    background-attachment: fixed; /* Hiệu ứng parallax */
    color: var(--text-black); /* Đảm bảo chữ rõ ràng trên nền ảnh */
    position: relative; /* Để dùng cho hiệu ứng */
    width: 100%;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0; /* Ban đầu ẩn để tạo hiệu ứng fade-in */
    animation: fadeIn 1s ease-out forwards;
}
.hero p {
    animation: fadeIn 1.5s ease-out forwards; /* Chậm hơn h1 */
}

/* Home Search Bar - Nằm trong Hero */
.search-container-home {
    max-width: 550px;
    margin: 2.5rem auto 0;
    position: relative;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 150px;
    opacity: 1;
}

.search-container-home.hidden-scroll {
    opacity: 0;
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: translateY(-20px);
    pointer-events: none;
    overflow: hidden;
}
.search-bar-home {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 30px;
    padding: 5px 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.search-bar-home input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 1rem;
    background: transparent;
    font-family: inherit;
}

/* Buttons */
.btn-dark {
    display: inline-block;
    background: var(--text-black);
    color: var(--bg-cream);
    padding: 1rem 2.5rem;
    text-decoration: none;
    margin-top: 1.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-hero-cta {
    margin-top: 2rem;
}

.btn-dark:hover {
    opacity: 0.8;
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--text-black);
    border: 1px solid var(--text-black);
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-outline:hover { background: var(--text-black); color: var(--bg-cream); }

.btn-minimal {
    background: none;
    border: 1px solid var(--text-black);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Tự động xuống dòng linh hoạt cho trang chuẩn */
    gap: 2rem;
    padding: 2rem 5%; /* Trả về lề chuẩn cho các trang */
}

/* Product Card */
.product-card {
    background-color: #fff; /* Nền trắng cho card sản phẩm */
    border: 1px solid #e0e0e0;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Hiệu ứng hover */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    height: 100%; /* Đảm bảo card chiếm hết chiều cao hàng của Grid */
}

.product-card:hover {
    transform: translateY(-5px); /* Nâng nhẹ card lên */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); /* Đổ bóng */
    border-color: #ddd;
}

.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1; /* Ép ảnh thành hình vuông */
    object-fit: cover; /* Cắt ảnh thông minh để không bị méo */
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 1rem;
    border-radius: 2px;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.3s ease; /* Hiệu ứng mượt mà cho ảnh */
    image-rendering: -webkit-optimize-contrast; /* Giúp ảnh hiển thị sắc nét hơn trên trình duyệt */
}

.product-card:hover img {
    transform: scale(1.05); /* Phóng to ảnh nhẹ khi hover vào card */
    filter: brightness(0.95); /* Giảm độ sáng nhẹ để tạo chiều sâu */
}

.product-card h3 {
    font-family: var(--font-serif);
    color: var(--text-black);
    /* Giới hạn 2 dòng chữ để grid luôn thẳng hàng */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem; /* Giữ chiều cao cố định cho tiêu đề */
    line-height: 1.4;
    font-size: 1.2rem; /* Giữ giá trị này */
    margin-bottom: 0.5rem; /* Giữ giá trị này */
}

.product-card .price {
    font-weight: 600;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-black);
    margin-top: auto; /* Đẩy giá xuống cuối card */
}

section {
    padding: 4rem 5%; /* Trả về lề chuẩn cho các trang */
    margin-top: 2rem;
}

.special-offers {
    display: none; /* Ẩn mặc định, JS sẽ hiện khi có data */
    background-color: #fff9f8; /* Nền hồng đất nhạt ấm cúng */
    padding: 5rem 5%;
    margin-top: 4rem;
    border-top: 1px solid #ffe4e1;
    border-bottom: 1px solid #ffe4e1;
}

.special-offers h2 {
    margin-bottom: 3.5rem;
    color: #c0392b;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: sale-glow 2s ease-in-out infinite alternate;
}

@keyframes sale-glow { 
    from { text-shadow: 0 0 5px rgba(192, 57, 43, 0.1); } 
    to { text-shadow: 0 0 15px rgba(192, 57, 43, 0.3); } 
}

.special-offers .grid {
    padding-top: 0;
    padding-bottom: 0;
}

.special-offers .product-card:hover {
    border-color: #c0392b;
    box-shadow: 0 10px 25px rgba(192, 57, 43, 0.15);
}

.price .old-price {
    text-decoration: line-through;
    color: #888;
    font-size: 0.9rem;
    margin-right: 10px;
    font-weight: normal;
}

.sale-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #e74c3c; /* Đỏ tươi hơn để thực sự nổi bật */
    color: white;
    padding: 6px 14px;
    border-radius: 20px; /* Dạng pill trông hiện đại hơn */
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3);
}

/* Out of Stock Styles */
.out-of-stock-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #888;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 12;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-card.is-out-of-stock {
    opacity: 0.7;
}

h2 {
    text-align: center;
    font-family: var(--font-serif);
    margin: 0 auto 3rem; /* Bỏ margin-top, dùng margin-bottom cố định */
    color: var(--text-black);
    width: 100%;
    display: block;
    font-size: 2rem;
}

/* --- Responsive Improvements --- */

@media (max-width: 768px) {
    /* Ép tất cả container chính về một chuẩn lề ngang duy nhất */
    .navbar,
    section,
    .products-page-container,
    .cart-container,
    .product-detail-container,
    .profile-container,
    .admin-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    section { padding-top: 3rem; padding-bottom: 3rem; margin-top: 1rem; }

    .logo {
        position: relative;
        z-index: 1400; /* Đảm bảo logo luôn hiện trên nền trắng của menu mobile */
    }

    h2 {
        margin-top: 3rem;
        font-size: 1.8rem;
        margin-bottom: 2rem;
        font-size: 1.6rem;
        padding: 0 5%;
    }

    .navbar {
        padding: 0 15px;
        height: 70px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    body { padding-top: 70px; }
    body { 
        padding-top: 70px; 
    }

    .logo, .nav-right { 
        flex: 0 0 auto; 
        width: auto;
    }
    .nav-right { gap: 1rem; }

    .menu-toggle {
        display: flex; /* Hiện nút trên mobile */
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%; /* Đổi sang trượt từ trái sang để không đè cụm icon phải */
        height: 100vh;
        width: 100%; /* Hiện full màn hình */
        background-color: #ffffff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        z-index: 1300; /* Phải cao hơn Navbar (1100) và Toggle (1200) */
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0,0,0,0.05);
        gap: 1.2rem;
    }

    .nav-links.active {
        left: 0;
    }

    .logo, .nav-right {
        flex: 0 0 auto; /* Trên mobile không cần chiếm 1fr */
        min-width: unset;
    }
    .nav-right { gap: 0.8rem; }

    /* Tối ưu nút đóng menu (dấu X phụ) */
    .btn-close-menu {
        display: none; /* Ẩn đi vì nút Toggle đã chuyển thành dấu X và nằm trên cùng rồi */
        position: absolute;
        top: 20px;
        right: 5%;
        background: none;
        border: none;
        font-size: 2.5rem;
        cursor: pointer;
        color: var(--text-black);
        z-index: 1401;
    }

    /* Hiệu ứng chuyển Hamburger thành dấu X */
    .menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-links a {
        font-size: 0.7rem;
        letter-spacing: 0;
    }

    .hero {
        height: 50vh;
        height: 60vh;
        margin: 0;
    }

    .hero h1 {
        font-size: 2.2rem;
        font-size: 2.5rem;
        padding: 0 10px;
        line-height: 1.1;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr); /* Đảm bảo luôn 2 cột trên mobile */
        gap: 12px;
        padding: 1.5rem 0;
    }

    .product-card {
        padding: 0.8rem;
    }

    .product-card h3 {
        font-size: 0.9rem;
        font-size: 0.95rem;
        min-height: 2.5rem;
        margin-bottom: 0.4rem;
        line-height: 1.3;
    }

    .category-banner {
        height: 250px;
    }

    .category-overlay h3 {
        font-size: 1.5rem;
    }

    .special-offers {
        padding: 3rem 5% !important;
    }

    .story-section {
        padding: 4rem 5% !important;
    }

    /* Tối ưu trang Products */
    .products-page-container {
        padding: 1.5rem 5% 4rem;
    }
    .page-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    .products-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .sidebar {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-right: 0;
        padding-bottom: 2rem;
    }
    .sidebar h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    .filter-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .filter-group h4 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    .filter-list li a {
        padding: 0.4rem 1rem;
        border: 1px solid #ddd;
        border-radius: 20px;
        font-size: 0.8rem;
    }
    .filter-list li a.active {
        background: var(--text-black);
        color: #fff;
        border-color: var(--text-black);
    }

    /* Tối ưu trang Cart */
    .cart-container { padding: 2rem 5%; }
    .cart-grid { padding: 1rem; }
    .cart-footer { flex-direction: column; align-items: stretch; text-align: center; }
    .cart-actions { flex-direction: column; }

    .sort-options {
        justify-content: space-between;
        margin-bottom: 1.5rem;
    }

    /* Tối ưu trang Detail */
    .product-detail-container { padding: 2rem 5%; }
    .product-detail-info h1 { font-size: 1.8rem; }
    .main-price { font-size: 1.5rem; }
    .price-box { flex-wrap: wrap; }

    .product-image-gallery { justify-content: flex-start; }
    .thumbnail {
        width: 55px;
        height: 55px;
    }
}

/* Ẩn nút đóng trên desktop */
.btn-close-menu { display: none; }

@media (max-width: 480px) {
    .navbar { padding: 1rem 3%; }
    .logo img {
        height: 40px;
    }

    .hero h1 { font-size: 1.8rem; }

    .grid {
        gap: 8px;
    }
    .product-card {
        padding: 0.6rem;
    }

    .purchase-section {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .quantity-input {
        justify-content: space-between;
    }

    .detail-fav-btn {
        flex: 0 0 50px; /* Giữ nguyên chiều rộng nút tim */
    }

    /* Tối ưu bảng Admin trên mobile */
    .admin-table th:nth-child(4), 
    .admin-table td:nth-child(4),
    .admin-table th:nth-child(6),
    .admin-table td:nth-child(6) {
        display: none; /* Ẩn bớt cột tồn kho và đánh giá trên màn hình siêu nhỏ */
    }

    .profile-tabs {
        gap: 0.8rem;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }

    .tab-btn {
        font-size: 0.95rem;
    }

    .order-header {
        flex-direction: column;
        font-size: 0.8rem;
    }

    /* Tối ưu hóa bảng Admin thành dạng Card trên Mobile */
    .admin-table thead {
        display: none; /* Ẩn tiêu đề bảng */
    }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block;
        width: 100%;
    }
    .admin-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    .admin-table td {
        text-align: right;
        padding: 10px 0;
        position: relative;
        border-bottom: 1px solid #f5f5f5;
        min-height: 40px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    .admin-table td:last-child {
        border-bottom: none;
        margin-top: 10px;
    }
    .admin-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        text-align: left;
        font-weight: 700;
        font-size: 0.75rem;
        color: #888;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .admin-table td img {
        width: 60px !important;
        height: 60px !important;
    }
    .status-select {
        width: auto;
    }

    .toast { min-width: auto; width: 90vw; right: 5vw; }

    /* Tinh chỉnh Products trên màn hình nhỏ 480px */
    .pagination-container {
        gap: 1rem;
        margin-top: 2rem;
    }

    .sort-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sort-options select {
        width: 100%;
    }

    /* Mobile User Dropdown */
    .user-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        text-align: center;
        display: block;
        min-width: unset;
    }
}

.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; width: 100%; height: 1px;
    background: #eee;
}
.auth-divider span {
    position: relative;
    background: #fff;
    padding: 0 1rem;
    color: #999;
    font-size: 0.8rem;
}
.btn-google {
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; background: #fff; border: 1px solid #ddd;
    padding: 0.8rem; cursor: pointer; transition: background 0.3s;
}
.btn-google:hover { background: #f9f9f9; }
/* Category Banners */
.categories-section {
    padding: 4rem 5% 0;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.category-banner {
    position: relative;
    height: 350px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.category-banner img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.5s ease;
}
.category-banner:hover img {
    transform: scale(1.05);
}
.category-overlay {
    position: relative;
    z-index: 2;
    background: rgba(0,0,0,0.2);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}
.category-banner:hover .category-overlay {
    background: rgba(0,0,0,0.3);
}
.category-overlay h3 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.category-overlay span {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    border-bottom: 1px solid #fff;
}

/* Story Section */
.story-section {
    padding: 6rem 10%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    background-color: #fff;
}
.story-content { text-align: left; }
.story-content h2 { text-align: center; margin-top: 0; margin-bottom: 2rem; }
.story-content p { color: #555; margin-bottom: 2rem; font-size: 1.1rem; }
.story-image img {
    width: 100%;
    border-radius: 2px;
    box-shadow: 20px 20px 0px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .story-section { padding: 4rem 15px !important; }
    .story-image img { box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
}

/* Scroll Reveal Animation Classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px); /* Mặc định trượt lên cho các section khác */
    transition: opacity 1s cubic-bezier(0.5, 0, 0, 1), transform 1s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-on-scroll.reveal-left {
    transform: translateX(-100px); /* Trượt từ trái qua */
}

.reveal-on-scroll.reveal-right {
    transform: translateX(100px); /* Trượt từ phải qua */
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Flower Intro Section */
.flower-intro-section {
    padding: 6rem 10%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    background-color: #fff;
}
.flower-intro-content { text-align: left; }
.flower-intro-content h2 { text-align: left; margin-bottom: 1.5rem; }
.flower-intro-content p { color: #555; margin-bottom: 1.5rem; font-size: 1.1rem; }
.flower-services-tags { display: flex; gap: 15px; margin-bottom: 2rem; flex-wrap: wrap; }
.flower-services-tags span { 
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; 
    padding: 5px 15px; border: 1px solid #ddd; border-radius: 20px; color: #777;
}
.flower-intro-image img {
    width: 100%;
    border-radius: 2px;
    box-shadow: -20px 20px 0px rgba(0,0,0,0.05);
}

/* Event Intro Section */
.event-intro-section {
    padding: 6rem 10%;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
    background-color: #f2f0eb;
}
.event-intro-content { text-align: left; }
.event-intro-content h2 { text-align: left; margin-bottom: 1.5rem; }
.event-intro-content p { color: #555; margin-bottom: 1.5rem; font-size: 1.1rem; }
.event-services-tags { display: flex; gap: 15px; margin-bottom: 2rem; flex-wrap: wrap; }
.event-services-tags span { 
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; 
    padding: 5px 15px; border: 1px solid #ddd; border-radius: 20px; color: #777;
    background: #fff;
}
.event-intro-image img {
    width: 100%;
    border-radius: 2px;
    box-shadow: 20px 20px 0px rgba(0,0,0,0.05);
}

/* Footer */
footer {
    background-color: var(--text-black);
    color: var(--bg-cream);
    padding: 4rem 5% 2rem;
    margin-top: 4rem;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3, .footer-section h4 {
    font-family: var(--font-serif);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.footer-section p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.footer-list {
    list-style: none;
}

.footer-list li {
    margin-bottom: 0.5rem;
}

.footer-section a, .footer-bottom a {
    color: var(--bg-cream);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer-section a:hover, .footer-bottom a:hover {
    opacity: 1;
}

.zalo-link-inline {
    font-size: 0.85rem;
    color: #3498db !important;
    opacity: 1 !important;
    font-weight: 600;
}

.footer-newsletter {
    display: flex;
    margin: 15px 0 25px;
    border: 1px solid rgba(247, 246, 242, 0.2);
    padding: 2px;
}
.footer-newsletter input {
    background: transparent;
    border: none;
    padding: 10px;
    color: white;
    font-family: inherit;
    width: 70%;
    outline: none;
}
.footer-newsletter button {
    background: var(--bg-cream);
    border: none;
    padding: 0 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    width: 30%;
}

.footer-trust-icons {
    display: flex;
    gap: 20px;
    font-size: 1.5rem;
    margin-bottom: 10px;
    filter: grayscale(1);
    transition: 0.3s;
}
.footer-trust-icons:hover { filter: grayscale(0); }

.social-links {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(247, 246, 242, 0.1);
    transition: all 0.3s ease;
    color: var(--bg-cream);
    border: 1px solid rgba(247, 246, 242, 0.2);
}

.social-icon:hover {
    background: var(--bg-cream);
    color: var(--text-black);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.footer-bottom {
    border-top: 1px solid rgba(247, 246, 242, 0.1);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.6;
}

.legal-links {
    display: flex;
    gap: 2rem;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    .social-links {
        align-items: center;
    }
}

@media (max-width: 992px) {
    .story-section { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .story-content h2 { text-align: center; }

    .flower-intro-section { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .flower-intro-content h2 { text-align: center; }
    .flower-services-tags { justify-content: center; }
    .flower-intro-image { order: -1; }

    .event-intro-section { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .event-intro-content h2 { text-align: center; }
    .event-services-tags { justify-content: center; }
}

/* Skeleton Loading UI */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #f7f7f7 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 1rem;
    border-radius: 4px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.skeleton-img { width: 100%; aspect-ratio: 1/1; margin-bottom: 1rem; }
.skeleton-text { height: 1rem; margin-bottom: 0.6rem; border-radius: 2px; }
.skeleton-title { width: 85%; height: 1.2rem; }
.skeleton-small { width: 50%; }
.skeleton-price { width: 40%; margin-top: auto; height: 1.4rem; }

/* Skeleton riêng cho trang chi tiết */
.skeleton-detail-img { width: 100%; aspect-ratio: 1/1; border-radius: 4px; margin-bottom: 1rem; }
.skeleton-detail-title { width: 70%; height: 2.5rem; margin-bottom: 1.5rem; }
.skeleton-detail-text { width: 100%; height: 1rem; margin-bottom: 0.8rem; }
@media (max-width: 768px) {
    .skeleton-detail-img { height: 350px; }
    .skeleton-detail-title { width: 90%; height: 2rem; }
}

/* Ảnh chính trong trang chi tiết - To rõ nét */
#main-product-img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in; /* Hiệu ứng trỏ chuột báo hiệu có thể phóng to */
    transition: transform 0.3s ease, opacity 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
}

#main-product-img:hover {
    opacity: 0.9;
}

/* Modal xem ảnh toàn màn hình */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: zoom-out;
}

.fullscreen-overlay img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* Hiệu ứng mượt mà khi hiện nội dung thật */
.fade-in-content {
    animation: fadeInEffect 0.6s ease-out forwards;
}

@keyframes fadeInEffect {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Floating Widgets */
.floating-widgets {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--bg-cream);
    background-color: var(--text-black);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(247, 246, 242, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.float-btn:hover {
    transform: translateY(-5px);
    background-color: #1a1a1a;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

#btn-scroll-top {
    display: none; /* Ẩn mặc định, chỉ hiện khi cuộn xuống */
    opacity: 0.9;
    background-color: #444; /* Màu nhạt hơn một chút cho nút cuộn */
}

#btn-scroll-top.show {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

@media (max-width: 768px) {
    .floating-widgets {
        bottom: 20px;
        right: 15px;
    }
    .float-btn {
        width: 45px;
        height: 45px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shine-sweep {
    0% { transform: translateX(-150%) rotate(35deg); }
    20%, 100% { transform: translateX(150%) rotate(35deg); }
}

.sale-sparkle {
    position: relative;
    overflow: hidden;
}

.sale-sparkle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 60px;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    z-index: 5;
    animation: shine-sweep 4s infinite;
    pointer-events: none;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.heartbeat-anim {
    animation: heartbeat 0.4s ease-in-out;
}

/* Hiệu ứng rung nhẹ thu hút sự chú ý cho nút liên hệ */
@keyframes ring-zalo {
    0% { transform: scale(1) rotate(0); }
    5% { transform: scale(1.1) rotate(15deg); }
    10% { transform: scale(1.1) rotate(-15deg); }
    15% { transform: scale(1.1) rotate(15deg); }
    20% { transform: scale(1.1) rotate(-15deg); }
    25% { transform: scale(1) rotate(0); }
    100% { transform: scale(1) rotate(0); }
}

.vibrate-btn {
    animation: ring-zalo 3s infinite; /* Rung mỗi 3 giây một lần */
}

.vibrate-btn:hover {
    animation: none; /* Dừng rung khi rê chuột vào để khách dễ nhấn */
}

/* Admin Styles */
.admin-container {
    padding: 2rem 5%;
}
.admin-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}
@media (max-width: 992px) {
    .admin-grid { grid-template-columns: 1fr; }
}
.admin-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.admin-card h3 { margin-bottom: 1.5rem; font-family: var(--font-serif); }
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.7rem; border: 1px solid #ccc; border-radius: 4px; font-family: inherit;
}
.admin-table {
    width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.admin-table th, .admin-table td {
    text-align: left; padding: 0.8rem; border-bottom: 1px solid #eee;
}
.admin-table th { background: #fafafa; font-weight: 600; }
.btn-delete {
    background: none; border: none; color: #cc0000; cursor: pointer; text-decoration: underline; font-weight: 600;
}

/* Admin Order Management Styles */
.admin-tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
}
.admin-tab-btn {
    background: none;
    border: none;
    padding: 1rem 0;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}
.admin-tab-btn.active {
    color: var(--text-black);
    border-bottom-color: var(--text-black);
}
.admin-section { display: none; }
.admin-section.active { display: block; }

.status-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Admin Stock Badges */
.stock-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}
.stock-out {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.table-responsive { overflow-x: auto; }

/* Image Preview in Form */
.image-preview-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    min-height: 50px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 4px;
}
.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.remove-preview {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    background: #ffffff;
    color: var(--text-black);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #333;
    font-size: 0.9rem;
    font-weight: 500;
    animation: toastIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    transition: all 0.4s ease;
}

.toast.success { border-left-color: #27ae60; }
.toast.error { border-left-color: #e74c3c; }

@keyframes toastIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   ULTRA-WIDE PRODUCT DETAIL (REWORKED)
   ========================================================================== */
.product-detail-container { 
    padding: 3rem 4%; 
    max-width: 1800px; /* Tràn lề tối đa cho màn hình PC */
    margin: 0 auto; 
}

.product-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.5fr); /* Cân bằng lại để cột thông tin đủ rộng cho hàng ngang */
    gap: 3rem;
    align-items: start;
}

.product-info-sticky {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-main-meta {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 1.5rem;
}

.product-main-meta .category-tag {
    display: inline-block;
    background: #222;
    color: #fff;
    padding: 5px 14px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.product-sku {
    display: block;
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.product-main-meta h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-black);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-price-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.product-price-row .main-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #c0392b; /* Màu đỏ đất */
}

.product-description {
    color: #555;
    line-height: 1.9;
    font-size: 1.1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-description p {
    white-space: pre-line; /* Giữ các dấu xuống dòng trong mô tả */
    word-break: break-word;
}

.product-description h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: #111;
    font-weight: 700;
}

.purchase-card {
    /* Loại bỏ khung màu trắng */
    background: transparent;
    padding: 1rem 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: row; /* Chuyển box thành hàng ngang */
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap; /* Cho phép xuống dòng nếu không đủ chỗ, tránh kéo ngang */
}

.quantity-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: none;
    flex-shrink: 0; /* Không cho bộ số lượng bị co lại */
}

.action-group {
    display: flex;
    gap: 10px;
    flex: 1; /* Chiếm hết phần còn lại của box */
    align-items: center;
    min-width: 0; /* Cho phép co giãn */
}

.action-group .btn-dark { 
    flex: 2; 
    margin: 0; 
    height: 55px; 
    font-size: 0.9rem; 
    letter-spacing: 1px;
    font-weight: 700;
    white-space: nowrap;
}

.action-group .btn-outline { 
    flex: 1.2; 
    margin: 0; 
    height: 55px; 
    font-size: 0.85rem;
    display: flex; 
    align-items: center; 
    justify-content: center;
    white-space: nowrap;
    padding: 0 15px;
}

.action-group .detail-fav-btn {
    flex: 0 0 55px;
    height: 55px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-group .detail-share-btn {
    flex: 0 0 50px;
    height: 50px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    background: #fff;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}
.action-group .detail-share-btn:hover { border-color: var(--text-black); color: var(--text-black); }

@media (max-width: 992px) {
    .product-detail-container { padding: 2rem 15px; }
    .product-detail-grid { grid-template-columns: 1fr; }
    .product-info-sticky { position: static; }
    .product-main-meta h1 { font-size: 2rem; }
    .product-price-row .main-price { font-size: 2rem; }
    
    /* Tối ưu hàng nút bấm trên Mobile */
    .purchase-card {
        flex-direction: column; /* Chuyển sang cột trên tablet/mobile để tránh tràn */
        align-items: stretch;
        gap: 1.5rem;
        padding: 0;
    }
    .quantity-box { justify-content: space-between; width: 100%; }
}

@media (max-width: 480px) {
    .product-main-meta h1 { font-size: 1.6rem; }
    .purchase-card { flex-direction: column; align-items: stretch; }
    .action-group {
        flex-direction: column; /* Trên màn hình cực nhỏ thì xếp dọc để dễ bấm */
    }
    .action-group .btn-dark, .action-group .btn-outline, .action-group .detail-fav-btn, .action-group .detail-share-btn {
        width: 100%;
        flex: none;
        height: 50px;
        white-space: normal; /* Cho phép xuống dòng nếu chữ quá dài trên máy nhỏ */
    }
    .quantity-controls { width: 100%; justify-content: center; }
}

/* Reviews Section Modern Styling */
.reviews-section {
    margin-top: 5rem;
    border-top: 1px solid #eee;
    padding-top: 5rem;
    width: 100%;
    clear: both;
    display: block;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.reviews-header h3 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--text-black);
}

#review-form-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    margin-bottom: 3rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}

#product-review-form textarea {
    width: 100%;
    height: 120px;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
    margin: 1.5rem 0;
    font-family: inherit;
    resize: none;
}

.review-item {
    padding: 2.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.review-user-info h5 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Rating Summary Dashboard */
.rating-summary {
    display: flex;
    align-items: center;
    gap: 4rem;
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    margin-bottom: 4rem;
    border: 1px solid #f0f0f0;
}

.rating-avg-box {
    text-align: center;
    min-width: 150px;
    border-right: 1px solid #eee;
    padding-right: 4rem;
}

.avg-score {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: var(--font-serif);
}

.total-reviews-count {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

.rating-bars { flex: 1; }
.rating-bar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}
.star-label { font-size: 0.85rem; font-weight: 600; width: 35px; }
.percent-label { font-size: 0.8rem; color: #888; width: 40px; text-align: right; }
.bar-bg { flex: 1; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: #f1c40f; border-radius: 4px; }

@media (max-width: 768px) {
    .rating-summary { flex-direction: column; gap: 2rem; padding: 2rem 1.5rem; }
    .rating-avg-box { border-right: none; padding-right: 0; border-bottom: 1px solid #eee; padding-bottom: 2rem; width: 100%; }
    .rating-bars { width: 100%; }
}

/* Admin Reply Styles */
.admin-reply {
    margin-top: 1.5rem;
    margin-left: 1.5rem;
    padding: 1.2rem;
    background: #fdfdfd;
    border-left: 3px solid var(--text-black);
    border-radius: 4px;
    position: relative;
}
.admin-reply h6 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

/* Global Quantity Controls Update */
.quantity-controls {
    display: flex;
    align-items: center;
    background: #f8f8f8;
    border-radius: 30px;
    padding: 4px;
    width: fit-content;
    border: 1px solid #eee;
}

.q-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.q-btn:hover:not(:disabled) { transform: scale(1.1); background: var(--text-black); color: #fff; }

#product-quantity {
    width: 50px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Products Page Specific Styles */
.products-page-container {
    padding: 4rem 5%;
    max-width: 1400px; /* Trả về chiều rộng chuẩn */
    margin: 0 auto;
}
.page-title {
    font-family: var(--font-serif);
    text-align: center;
    margin-bottom: 3rem;
}
.products-content {
    display: grid;
    grid-template-columns: 250px 1fr; /* Sidebar cố định, phần sản phẩm linh hoạt */
    gap: 3rem;
}
@media (max-width: 992px) {
    .products-content {
        grid-template-columns: 1fr; /* Sidebar nằm trên khi màn hình nhỏ */
    }
    .sidebar {
        margin-bottom: 2rem;
    }
}

/* Sidebar Filters */
.sidebar {
    background: transparent;
    padding: 0;
    border-right: 1px solid rgba(0,0,0,0.05);
    padding-right: 2.5rem;
}
.sidebar h3 {
    font-family: var(--font-serif);
    margin-bottom: 2.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--text-black);
    padding-bottom: 15px;
    letter-spacing: 1px;
}
.filter-group {
    margin-bottom: 2rem;
}
.filter-group h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #aaa;
    margin-bottom: 1.2rem;
    font-weight: 700;
    font-family: var(--font-sans);
    transition: color 0.3s ease;
}
.filter-group h4:hover {
    color: var(--text-black);
}
.filter-group .chevron {
    transition: transform 0.3s ease;
    color: #ccc;
}
.filter-group.expanded .chevron {
    transform: rotate(180deg);
}
.filter-list {
    list-style: none;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
    opacity: 0;
}
.filter-group.expanded .filter-list {
    max-height: 1000px; /* Giá trị đủ lớn để chứa nội dung */
    opacity: 1;
    transition: max-height 0.4s ease-in, opacity 0.3s ease;
}
.filter-list li {
    margin-bottom: 10px;
}
.filter-list li a {
    display: inline-block;
    padding: 4px 0;
    text-decoration: none;
    color: #666;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}
.filter-list li a:hover, .filter-list li a.active {
    color: var(--text-black);
}
.filter-list li a:hover {
    transform: translateX(5px);
}
.filter-list li a.active {
    font-weight: 700;
    padding-left: 15px;
}
.filter-list li a.active::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-black);
}

/* Sort Options */
.sort-options {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 2rem;
    gap: 1rem;
}
.sort-options label {
    font-size: 0.9rem;
    color: #555;
}
.sort-options select {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
}

#no-products-found {
    grid-column: 1 / -1; /* Chiếm toàn bộ chiều rộng grid */
}

/* Search Input in Sidebar */
.search-input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}
.search-input:focus {
    outline: none;
    border-color: var(--text-black);
}

/* Pagination Styles */
.pagination-container {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}
#page-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}
.btn-minimal:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Nút xem thêm chung */
.btn-dark, .btn-outline {
    margin-top: 1.5rem; /* Đảm bảo khoảng cách với nội dung phía trên */
}

/* Flash Sale Page Banner */
.flash-sale-banner {
    width: 100%;
    height: 450px;
    background: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)), url('https://images.unsplash.com/photo-1578749556568-bc2c40e68b61?q=80&w=1200&fm=webp&auto=format&fit=crop') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 4rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.banner-title {
    font-family: var(--font-serif);
    font-size: 4.5rem;
    color: #fff !important;
    margin-bottom: 0.8rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.flash-sale-banner p {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}
.sale-tag-hero {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    animation: banner-pulse 2s infinite;
}
@keyframes banner-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* Hiệu ứng Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--text-black);
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

/* Spinner nhỏ cho các nút bấm */
.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.price-range-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}
.price-range-inputs .search-input {
    padding: 0.5rem;
    font-size: 0.8rem;
}
.quantity-input {
    display: flex;
    align-items: center;
} /* Bổ sung dấu đóng ngoặc bị thiếu gây lỗi nghiêm trọng */

.quantity-controls {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
    background: #fff;
    width: 130px;
    justify-content: space-between;
    height: 40px;
}
.q-btn {
    background: #fff;
    border: none;
    width: 35px;
    height: 100%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}
.q-btn:hover { background: #eee; }
#product-quantity {
    width: 40px;
    height: 100%;
    text-align: center;
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 600;
}
#product-quantity::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Cart Icon & Badge */
.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 5px;
}
.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #e74c3c;
    color: white;
    font-size: 9px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex !important; /* Đảm bảo luôn sử dụng flex để căn giữa số */
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    transition: all 0.3s ease;
    color: #888;
}

.favorite-btn:hover {
    transform: scale(1.1);
    background: #fff;
}

.favorite-btn.active {
    color: #e74c3c;
    fill: #e74c3c;
}

/* Product Gallery */
.product-detail-image {
    position: relative; /* Container chính cho ảnh lớn và nút bấm */
}

.main-img-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.product-image-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Cho phép cuộn ngang các thumbnail */
    scroll-behavior: smooth;
    padding-bottom: 10px;
}

.product-image-gallery::-webkit-scrollbar {
    height: 4px;
}

.product-image-gallery::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.thumbnail {
    width: 64px;
    height: 64px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    opacity: 0.6;
}

.thumbnail:hover, .thumbnail.active {
    border-color: var(--text-black);
    opacity: 1;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-black);
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-nav-btn:hover {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-nav-btn.left { left: 15px; }
.gallery-nav-btn.right { right: 15px; }

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #ffffff;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    list-style: none;
    padding: 0.8rem 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border-radius: 4px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu li a {
    padding: 0.6rem 1.5rem !important;
    display: block;
    text-transform: none !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.5px !important;
    color: var(--text-black);
    white-space: nowrap;
    text-align: left;
}

.dropdown-menu li a:hover {
    background-color: var(--bg-cream);
    opacity: 1;
}

/* Mobile Dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        display: none; /* Sẽ hiện ra khi hover/click tùy theo thiết kế mobile */
    }
    .dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.user-icon-link {
    color: var(--text-black);
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.user-icon-link:hover {
    opacity: 0.7;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0.8rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1500;
    border-radius: 4px;
    border: 1px solid #eee;
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu li hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 0.5rem 0;
}

.user-dropdown-menu li a, 
.user-dropdown-menu li button {
    width: 100%;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-black);
    text-align: left;
    padding: 0.6rem 1.5rem !important;
    border: none !important;
    transition: all 0.2s ease;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.user-dropdown-menu li a:hover,
.user-dropdown-menu li a.active {
    background-color: var(--bg-cream);
    font-weight: 600;
}

/* Auth Page Styles */
.auth-container {
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 5%;
}
.auth-card {
    width: 100%;
    max-width: 450px;
    background: #fff;
    padding: 3rem 2.5rem;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    text-align: center;
}
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
}
.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #888;
    border-bottom: 2px solid transparent;
    font-family: var(--font-sans);
}
.auth-tab.active {
    color: var(--text-black);
    border-bottom-color: var(--text-black);
}
.auth-form .form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}
.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.auth-form input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--text-black);
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; width: 100%; height: 1px;
    background: #eee;
}
.auth-divider span {
    position: relative;
    background: #fff;
    padding: 0 1rem;
    color: #999;
    font-size: 0.8rem;
}
.btn-google {
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; background: #fff; border: 1px solid #ddd;
    padding: 0.8rem; cursor: pointer; transition: background 0.3s;
}
.btn-google:hover { background: #f9f9f9; }

/* Profile Page Styles */
.profile-container {
    padding: 4rem 5%;
    max-width: 900px;
    margin: 0 auto;
    min-height: 60vh;
}
.profile-title {
    font-family: var(--font-serif);
    margin-bottom: 2rem;
    text-align: left;
}
.profile-card {
    background: #fff;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.profile-card h3 {
    font-family: var(--font-serif);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}
.profile-card p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}
.profile-card p strong {
    color: #555;
    margin-right: 5px;
}

/* Order History List */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.order-item {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 1.5rem;
    background: #fdfdfd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.order-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
    font-size: 0.9rem;
}
.order-details h4 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: #333;
}
.order-details ul {
    list-style: none;
    margin-bottom: 1rem;
}
.order-details ul li {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #666;
    margin-bottom: 0.4rem;
}
.order-status-dang-xu-ly { color: orange; font-weight: 600; }
.order-status-da-hoan-thanh { color: green; font-weight: 600; }
.order-status-da-huy { color: red; font-weight: 600; }
.order-status-dang-giao-hang { color: #3498db; font-weight: 600; } /* Màu xanh dương cho trạng thái đang giao hàng */

/* Cart Page Styles */
.cart-container {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 60vh;
}
.cart-title {
    font-family: var(--font-serif);
    margin-bottom: 2rem;
    text-align: left;
}
.cart-grid {
    background: #fff;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.cart-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}
.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f9f9f9;
}
.item-info { display: flex; align-items: center; gap: 1.5rem; }
.item-info img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.item-info h4 { font-family: var(--font-serif); font-size: 1.1rem; }
.item-remove button {
    background: none; border: none; font-size: 1.5rem; color: #ccc; cursor: pointer; transition: color 0.3s;
}
.item-remove button:hover { color: #e74c3c; }

.cart-footer {
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 2rem;
}
.cart-total { font-size: 1.8rem; font-weight: 700; color: var(--text-black); }
.cart-total span:first-child { font-weight: 400; font-size: 1rem; margin-right: 15px; color: #666; }
.cart-actions { display: flex; gap: 1.5rem; align-items: center; }

@media (max-width: 850px) {
    .cart-table-header { display: none; }
    .cart-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
        border-bottom: 1px solid #eee;
    }
    .item-info { flex-direction: column; gap: 0.5rem; }
    .cart-footer { flex-direction: column; align-items: center; }
}

/* Căn chỉnh khu vực đăng nhập/đăng xuất */
#auth-section {
    display: flex;
    align-items: center;
    gap: 1rem; /* Tạo khoảng cách giữa tên và nút logout */
    flex-shrink: 0; /* Đảm bảo không bao giờ bị co lại mất nút */
}

/* Đồng bộ độ cao các nút trong phần mua hàng */
.purchase-section .btn-dark {
    height: 40px;
    margin-top: 0;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#product-quantity {
    height: 40px;
}

/* Detail Page Favorite Button */
.detail-fav-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    background: #fff;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}
.detail-fav-btn:hover { border-color: var(--text-black); color: var(--text-black); }
.detail-fav-btn.active { color: #e74c3c; border-color: #e74c3c; }

/* Tabs Profile */
.profile-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
}
.tab-btn {
    background: none;
    border: none;
    padding: 0.8rem 0;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}
.tab-btn.active {
    border-bottom-color: var(--text-black);
    font-weight: 600;
}
.profile-section {
    display: none;
}
.profile-section.active {
    display: block;
}

/* Order Detail Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}
.modal.active { display: flex; }
.modal-content {
    background-color: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}
.modal-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}
.detail-row span:first-child { color: #666; }
.detail-row span:last-child { font-weight: 600; }

/* Review Styles */
.reviews-list { display: flex; flex-direction: column; gap: 2rem; }
.review-item { padding-bottom: 2rem; border-bottom: 1px solid #f0f0f0; }
.review-header { display: flex; align-items: center; gap: 15px; margin-bottom: 1rem; }
.review-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; background: #eee; }
.review-user-info h5 { margin: 0; font-size: 1rem; }
.review-date { font-size: 0.8rem; color: #888; }
.review-content p { color: #555; line-height: 1.6; margin-bottom: 1rem; }
.review-images-gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.review-img { width: 100px; height: 100px; object-fit: cover; border-radius: 4px; cursor: pointer; transition: transform 0.2s; }
.review-img:hover { transform: scale(1.05); }

.star-rating-input { display: flex; gap: 5px; font-size: 1.5rem; }
.star-rating-input span { cursor: pointer; color: #ddd; transition: color 0.2s; }
.star-rating-input span.active { color: #f1c40f; }

/* Định dạng modal phóng to ảnh review */
.review-modal-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
}

/* Điều chỉnh nút Search trong thanh bar */
#header-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-black);
    display: flex;
    align-items: center;
    padding: 0;
    margin-left: 10px;
    transition: transform 0.2s ease;
}
#header-search-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .search-container-header {
        margin: 0 1rem;
        max-width: none;
    }
    .search-bar-header {
        padding: 5px 15px;
    }
}

/* Search Suggestions Box */
.search-item { position: relative; }
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 15px;
    text-decoration: none;
    color: var(--text-black);
    transition: all 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { 
    background: #fcfbf8; 
    padding-left: 25px;
}
.suggestion-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f9f9f9;
}
.suggestion-info {
    flex: 1;
    min-width: 0;
}
.suggestion-info h5 {
    font-size: 0.95rem;
    margin: 0 0 2px 0;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.suggestion-price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}
.suggestion-current-price {
    font-weight: 700;
    color: #333;
}
.suggestion-current-price.sale {
    color: #c0392b;
}
.suggestion-old-price {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
}
.suggestion-sale-tag {
    font-size: 0.65rem;
    background: #c0392b;
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .search-suggestions {
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        z-index: 2001;
    }
}

@media (max-width: 992px) {
    .flash-sale-banner { height: 350px; }
    .banner-title { font-size: 3.2rem; }
}

@media (max-width: 768px) {
    .flash-sale-banner { height: 300px; padding: 20px; }
    .banner-title { font-size: 2.5rem; }
    .flash-sale-banner p { font-size: 1.1rem; }
}

@media (max-width: 480px) {
    .countdown-item span:first-child { font-size: 2.5rem; min-width: 50px; }
}

/* --- Print Styles for POS Receipt --- */
#receipt-print-area {
    display: none; /* Ẩn trên giao diện web */
}

@media print {
    /* Ẩn tất cả các thành phần UI */
    body * { visibility: hidden; }
    .navbar, footer, .admin-container, .toast-container, .floating-widgets, .modal { display: none !important; }

    /* Chỉ hiện khu vực hóa đơn */
    #receipt-print-area, #receipt-print-area * {
        visibility: visible;
        display: block !important;
    }

    #receipt-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm; /* Khổ giấy máy in nhiệt chuẩn */
        padding: 5mm;
        font-family: 'Montserrat', sans-serif;
        color: #000;
        background: #fff;
    }

    .receipt-header { text-align: center; margin-bottom: 5mm; }
    .receipt-header h2 { font-size: 1.2rem; margin: 0; }
    .receipt-header p { font-size: 0.8rem; margin: 1mm 0; }
    
    .receipt-info { font-size: 0.8rem; border-bottom: 1px dashed #000; padding-bottom: 2mm; margin-bottom: 3mm; }
    .receipt-info p { margin: 1mm 0; }

    .receipt-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
    .receipt-table th { text-align: left; border-bottom: 1px solid #000; padding: 1mm 0; }
    .receipt-table td { padding: 2mm 0; vertical-align: top; }
    .receipt-table .col-qty { text-align: center; width: 10mm; }
    .receipt-table .col-price { text-align: right; width: 25mm; }

    .receipt-total {
        border-top: 1px solid #000;
        margin-top: 3mm;
        padding-top: 2mm;
        text-align: right;
        font-weight: bold;
        font-size: 1rem;
    }
    .receipt-footer { text-align: center; margin-top: 5mm; font-size: 0.7rem; font-style: italic; }
}

/* --- Coupon List UI --- */
.available-coupons {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.coupon-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px dashed var(--text-black);
    border-left: 5px solid var(--text-black);
    padding: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.coupon-card:hover {
    background-color: var(--bg-cream);
    transform: translateX(5px);
}
.coupon-card.active {
    background-color: #f0f7f0;
    border-color: #27ae60;
    border-left-color: #27ae60;
    animation: coupon-pop 0.4s ease-out;
}

@keyframes coupon-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}
.coupon-info { flex: 1; }
.coupon-info h5 {
    font-family: var(--font-serif);
    font-size: 1rem;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.coupon-info p {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}
.btn-use-coupon {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-black);
    border: 1px solid var(--text-black);
    padding: 4px 10px;
    border-radius: 2px;
}

/* --- Full Width Layout Overrides (Dành riêng cho trang Sản phẩm) --- */
.full-width-layout .navbar,
.full-width-layout footer,
.full-width-layout .products-page-container {
    padding-left: 5% !important;
    padding-right: 5% !important;
    max-width: 100% !important;
}

.full-width-layout .grid {
    padding-left: 5px !important;
    padding-right: 5px !important;
    gap: 10px; /* Thu nhỏ khoảng cách giữa các món để sát nhau hơn */
}

@media (min-width: 769px) {
    .full-width-layout .grid,
    #recently-viewed-grid,
    #related-product-grid {
        grid-template-columns: repeat(5, 1fr) !important; /* Hiển thị 5 cột trên màn hình lớn */
        gap: 1.2rem; /* Giảm gap để card rộng hơn */
    }
}

/* Cookie Consent Popup */
.cookie-consent {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #ffffff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: calc(100% - 40px);
    max-width: 900px;
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(0,0,0,0.05);
}
.cookie-consent.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cookie-actions { display: flex; gap: 10px; }

@media (max-width: 768px) {
    .cookie-consent {
        flex-direction: column;
        border-radius: 20px;
        padding: 1.5rem;
        text-align: center;
        bottom: 20px;
        gap: 1rem;
    }
    .cookie-actions { width: 100%; justify-content: center; }
}
