/* =========================================
   1. CÀI ĐẶT CHUNG (RESET & FONTS)
   ========================================= */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; /* Font chữ hiện đại */
}

body {
    background-color: #f8f9fa; /* Màu nền xám nhẹ dịu mắt */
    color: #333;
    overflow-x: hidden; /* Tránh thanh cuộn ngang không mong muốn */
}

/* =========================================
   2. THANH ĐIỀU HƯỚNG (NAVBAR)
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.logo span { color: #ff6b6b; } /* Điểm nhấn màu cam đỏ */

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    transition: 0.3s;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: #ff6b6b;
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.cart-box {
    position: relative;
    display: flex;
    align-items: center;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

/* Nút Menu Mobile (Hamburger) */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: #333;
}

/* =========================================
   3. HERO SECTION (BANNER)
   ========================================= */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1441986300917-64674bd600d8?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80');
    background-size: cover;
    background-position: center;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.hero h1 { font-size: 48px; margin-bottom: 10px; }
.hero p { font-size: 18px; margin-bottom: 20px; }

.btn-primary {
    padding: 12px 30px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary:hover {
    background-color: #e65252;
    transform: translateY(-2px);
}

.btn-primary:active { transform: scale(0.95); }

/* =========================================
   4. THANH CÔNG CỤ (SEARCH & FILTER)
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-filter {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 14px;
}

.btn-filter.active, .btn-filter:hover {
    background: #333;
    color: white;
    border-color: #333;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid #ddd;
    width: 300px;
}

.search-box input {
    border: none;
    outline: none;
    margin-left: 10px;
    width: 100%;
    font-size: 14px;
}

/* =========================================
   5. DANH SÁCH SẢN PHẨM
   ========================================= */
.section-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: #333;
    position: relative;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 3px;
    background: #ff6b6b;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

/* --- THẺ SẢN PHẨM (CARD) --- */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
    position: relative;
    cursor: pointer; /* Để người dùng biết có thể bấm vào */
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.product-img {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.product-card:hover .product-img img { transform: scale(1.1); }

.tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4cd137;
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
}
.tag.sale { background: #ff6b6b; }

.product-info { padding: 20px; }

.product-info h3 { font-size: 18px; margin-bottom: 5px; }

.price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price { font-size: 18px; font-weight: 600; color: #ff6b6b; }
.old-price { font-size: 14px; color: #aaa; text-decoration: line-through; }

.btn-cart {
    width: 100%;
    padding: 10px;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-cart:hover { background: #555; }
.btn-cart:active { transform: scale(0.95); }

/* =========================================
   6. MODAL (POPUP CHI TIẾT)
   ========================================= */
.modal {
    display: none; /* Ẩn mặc định */
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 800px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

.modal-body { display: flex; gap: 30px; }
.modal-img { flex: 1; }
.modal-img img { width: 100%; border-radius: 8px; object-fit: cover; }

.modal-info { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.m-price { font-size: 24px; color: #ff6b6b; font-weight: bold; margin: 10px 0; }
.m-desc { line-height: 1.6; color: #666; margin-bottom: 20px; }
.m-actions { margin-top: auto; }

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #aaa;
    transition: 0.2s;
}
.close-modal:hover { color: #333; }

/* Animation cho Modal */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(50px); } to { transform: translateY(0); } }

/* =========================================
   7. TOAST NOTIFICATION (THÔNG BÁO)
   ========================================= */
#toast {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 9999;
}

.toast-msg {
    display: flex;
    align-items: center;
    background-color: #333;
    color: #fff;
    min-width: 250px;
    margin-bottom: 12px;
    padding: 16px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInLeft 0.5s ease, fadeOut 1s 2.5s forwards;
    border-left: 6px solid #4cd137;
}

.toast-msg span.material-symbols-outlined { margin-right: 12px; color: #4cd137; font-size: 20px; }

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; width: 0; margin: 0; padding: 0; overflow: hidden; }
}

/* =========================================
   8. FOOTER (CHÂN TRANG)
   ========================================= */
.footer {
    background: #222;
    color: #ddd;
    padding: 40px 20px;
    text-align: center;
    margin-top: auto;
}
.footer p { font-size: 14px; color: #888; }

/* =========================================
   9. RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .navbar { padding: 15px 20px; }
    
    .menu-toggle { display: block; }

    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        display: none; /* Ẩn mặc định */
    }

    .nav-links.active { display: flex; } /* Hiện khi bấm menu */

    .hero h1 { font-size: 32px; }
    
    /* Responsive cho controls và modal */
    .controls { flex-direction: column-reverse; align-items: stretch; }
    .search-box { width: 100%; }
    .filter-btns { justify-content: center; }
    
    .modal-body { flex-direction: column; }
    .modal-content { padding: 20px; width: 95%; }
}