:root {
    --primary-color: #ff9a9e;
    /* Pink Rose */
    --secondary-color: #fad0c4;
    /* Soft Pink */
    --accent-color: #ffd1ff;
    /* Light Lavender/Pink */
    --gold-color: #d4af37;
    /* Gold */
    --yellow-color: #fff1a8;
    /* Soft Yellow */
    --text-color: #4a4a4a;
    --bg-color: #fff;
    --card-bg: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #fdf2f5;
    /* Very light pink bg */
    color: var(--text-color);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--gold-color));
    padding: 0.8rem 2rem;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: none;
}

nav {
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    font-family: 'Dancing Script', cursive;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: capitalize;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-links a:hover {
    color: var(--yellow-color);
    transform: translateY(-2px);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.user-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.user-actions-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-actions-icons a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.user-actions-icons a:hover {
    color: var(--yellow-color);
}

.user-greeting {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#cart-count {
    background: white;
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Dropdown Styles */
/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
    height: 100%;
    /* Ensure full height for hover area */
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 9999;
    /* Ensure it's on top of everything */
    border-radius: 5px;
    top: 100%;
    /* Position directly below the parent */
    left: 0;
    padding: 10px 0;
    white-space: nowrap;
    /* Prevent text wrapping */
}

@media (max-width: 768px) {
    .dropdown-content {
        position: static !important;
        float: none;
        width: 100% !important;
        box-shadow: none !important;
        background: #f9f9f9 !important;
        padding-left: 0 !important;
        border-radius: 0 !important;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-content a {
        padding-left: 30px;
    }

    .topic-submenu {
        position: static !important;
        box-shadow: none !important;
        width: 100% !important;
        min-width: auto !important;
        background: #f0f0f0 !important;
        border-radius: 0 !important;
    }

    .topic-submenu a {
        padding-left: 40px !important;
        background: #fff0f5 !important;
        /* Light pink background to stand out */
        border-left: 4px solid var(--primary-color) !important;
        /* Accent border */
        margin-bottom: 1px;
        color: #d63031 !important;
        /* Darker text for contrast */
        font-weight: 500;
    }
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-weight: 400;
    text-align: left;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--secondary-color);
    color: #000;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s;
}

/* Nested dropdown styles */
.dropdown-group {
    position: relative;
}

.dropdown-group .group-title:hover {
    background: linear-gradient(135deg, #ff7e85, #c5a028) !important;
}

.dropdown-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    z-index: 10001;
}

.dropdown-submenu a:hover {
    background-color: var(--secondary-color);
    color: #000;
}

@media (min-width: 769px) {
    .dropdown-group:hover .topic-submenu {
        display: block !important;
        position: absolute;
        left: 100%;
        top: 0;
        background: white !important;
        /* Solid white background */
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
        border-radius: 0 5px 5px 5px;
        min-height: 100%;
        /* Match height roughly */
        border: 1px solid #eee;
    }

    .topic-submenu a {
        background: white;
        color: #333;
        transition: background 0.3s;
    }

    .topic-submenu a:hover {
        background-color: #ffeaa7 !important;
        /* Highlight on hover */
        color: #d35400 !important;
    }
}

.fa-rotate-180 {
    transform: rotate(180deg);
    transition: transform 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero {
    background-color: transparent;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color);
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 4rem 1rem;
    background-image: url('../image/logo/nen-chu.webp.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


.hero-content>* {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #6b2737;
    /* Đỏ mận đậm - nổi bật và ấm áp trên nền ảnh */
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6);
    font-family: 'Dancing Script', cursive;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #4a2030;
    /* Nâu đỏ đậm - dễ đọc, hài hòa */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.btn {
    padding: 12px 30px;
    background: #F48FB1;
    /* Pink Pastel for yellow background */
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(244, 143, 177, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    background: #f06292;
    box-shadow: 0 6px 20px rgba(244, 143, 177, 0.6);
}

/* Products Section */
.products {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
}

.product-grid {
    display: grid;
    /* Clean grid layout: auto-fill keeps items sized consistently even if few items exist */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    border: 1px solid var(--secondary-color);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    image-orientation: from-image;
}

/* Compensate Display P3 → sRGB gap for iPhone photos on P3 displays */
@media (color-gamut: p3) {
    .product-image {
        filter: brightness(1.15) saturate(1.25);
    }
}
/* Compensate on standard sRGB displays */
@media not all and (color-gamut: p3) {
    .product-image {
        filter: brightness(1.1) saturate(1.18);
    }
}

.product-info {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    min-height: 2.9em;
    /* đủ 2 dòng, căn đều tên ngắn và dài */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-weight: bold;
    color: var(--gold-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    margin-top: auto;
    /* đẩy giá xuống sát nút, căn đều */
}

.add-to-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart:hover {
    background: #ff7e85;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-number {
    display: inline-block;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.pagination-btn {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

.pagination-btn:hover {
    background: #ff7e85;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pagination-number {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    font-weight: 400;
}

.pagination-number:hover {
    border-color: var(--primary-color);
    background: var(--secondary-color);
}

.pagination-number.active {
    background: var(--gold-color);
    color: white;
    font-weight: 600;
    border-color: var(--gold-color);
}

/* Footer */
footer {
    background: var(--text-color);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.social-links {
    margin: 1rem 0;
}

.social-links a {
    color: white;
    margin: 0 10px;
    font-size: 1.2rem;
    text-decoration: none;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        padding: 1rem 0;
        gap: 0;
        align-items: flex-start;
        z-index: 9999;
    }

    .nav-links.active {
        display: flex;
        animation: fadeIn 0.3s;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        color: #333;
        padding: 15px 20px;
        display: block;
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        background: #f9f9f9;
        min-width: 100%;
        padding-left: 20px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    /* Mobile Product Grid - 2 columns (4 items implied) */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    /* Product Image Fix */
    .product-image {
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        image-orientation: from-image;
    }
    @media (color-gamut: p3) {
        .product-image {
            filter: brightness(1.15) saturate(1.25);
        }
    }

    .product-info {
        padding: 0.8rem;
    }

    .product-title {
        font-size: 1rem;
    }

    .btn-detail {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .hero h1 {
        font-size: 1.6rem;
        white-space: nowrap;
    }

    /* Bỏ khoảng trống hero padding trên mobile */
    .hero {
        min-height: unset;
        padding-top: 0.3rem !important;
        padding-bottom: 0.5rem !important;
    }

    .hero-content {
        margin-bottom: 0.8rem !important;
    }

    /* Bỏ khoảng trống giữa banner và section sản phẩm */
    section.products {
        margin-top: 0 !important;
        padding-top: 1rem !important;
    }
}