:root {
    --bg-color: #1a0b12; /* Deep dark plum/burgundy */
    --card-bg: #2a1622;
    --text-main: #f4e8d1; /* Soft cream */
    --text-muted: #b3a394;
    --accent-gold: #d4af37;
    --accent-red: #8b0000;
    --hover-gold: #f3d56a;
    --border-color: rgba(212, 175, 55, 0.3);
}

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

body {
    font-family: 'Noto Serif', 'Playfair Display', serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    background-image: radial-gradient(circle at top, #361726 0%, transparent 40%);
    background-attachment: fixed;
}

/* Header */
header {
    text-align: center;
    padding: 3rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, rgba(26,11,18,0.9), transparent);
}

.logo {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    font-weight: 400;
    color: var(--accent-gold);
    letter-spacing: 2px;
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 15px rgba(212, 175, 55, 0.4);
}

.tagline {
    font-family: 'Charm', cursive;
    font-size: 1.4rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 1px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Categories */
.categories {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.category-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.category-btn:hover, .category-btn.active {
    background: var(--accent-gold);
    color: var(--bg-color);
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

/* Product Card */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.2);
}

.product-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image-wrapper {
    overflow: hidden;
    position: relative;
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.05rem;
    font-weight: normal; /* Chữ mảnh hơn trông sẽ sang trọng và tinh tế hơn */
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 1.15rem;
    color: var(--accent-gold);
    font-weight: bold;
    margin-bottom: 1rem;
    margin-top: auto;
    text-align: center;
}

.buy-btn {
    display: block;
    text-align: center;
    background: transparent;
    color: var(--accent-gold);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--accent-gold);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.buy-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Spinner */
.loader-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 4rem 0;
    grid-column: 1 / -1; /* Đảm bảo loader chiếm toàn bộ chiều ngang nếu nằm trong Grid */
}

.loader {
    width: 45px;
    height: 45px;
    border: 3px solid var(--card-bg);
    border-top: 3px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .categories {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 0.6rem;
    }
    
    .categories::-webkit-scrollbar {
        display: none;
    }
    
    .category-btn {
        flex: 0 0 auto;
        scroll-snap-align: start;
        font-size: 0.9rem;
        padding: 0.4rem 1.2rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 0.6rem;
    }
    
    .product-title {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .buy-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .logo {
        font-size: 3rem;
    }
}
