/* ======================================================================= */
/* MOW GARDEN - NEW MODERN STYLESHEET (OPTIMIZED)                          */
/* ======================================================================= */

/*
 * MỤC LỤC:
 * 1. CSS Variables & Global Resets
 * 2. General Layout & Typography
 * 3. Header & Navigation
 * 4. Hero Section & Slider
 * 5. Section Styles (Features, Bestsellers, About)
 * 6. Component: Buttons & Cards
 * 7. Footer
 * 8. Responsive Design
*/

/* 1. CSS VARIABLES & GLOBAL RESETS */
:root {
    --color-primary: #2E7D32;
    --color-primary-light: #4CAF50;
    --color-dark: #212121;
    --color-text: #616161;
    --color-light: #F5F5F5;
    --color-white: #FFFFFF;
    --color-border: #E0E0E0;

    --font-family: 'Montserrat', sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.7;

    --border-radius: 12px;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: var(--transition-fast);

    &:hover {
        color: var(--color-primary-light);
    }
}

ul { list-style-type: none; }
img { max-width: 100%; display: block; }

/* 2. GENERAL LAYOUT & TYPOGRAPHY */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
}

.bg-light {
    background-color: var(--color-light);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.8rem;
    color: var(--color-dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.text-center { text-align: center; }

/* 3. HEADER & NAVIGATION */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;

    &.scrolled {
        background-color: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: var(--shadow-soft);
    }

    &:not(.scrolled) {
        .nav-logo, .cart-link, .nav-toggle {
            color: var(--color-white);
        }
        .nav-menu a {
            color: var(--color-white);
            &:hover, &.active {
                color: var(--color-white);
                &::after {
                    background-color: var(--color-white);
                }
            }
        }
    }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-dark);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 35px;

    a {
        font-weight: 500;
        font-size: 1rem;
        padding: 5px 0;
        position: relative;
        color: var(--color-text);

        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background-color: var(--color-primary);
            transition: width 0.3s ease;
        }

        &:hover, &.active {
            color: var(--color-primary);
            &::after {
                width: 100%;
            }
        }
    }
}

.nav-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-link {
    position: relative;
    color: var(--color-dark);
}

/* === ĐOẠN CODE ĐÃ SỬA === */
#cart-item-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: none; /* jQuery sẽ chuyển đổi thuộc tính này */
    
    /* Phương pháp căn giữa mới, ổn định hơn */
    line-height: 20px; /* Căn giữa theo chiều dọc */
    text-align: center; /* Căn giữa theo chiều ngang */
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-dark);
}

/* 4. HERO SECTION & SLIDER */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;
}

.hero-slider .slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.1); 
    transition: opacity 1.5s ease-in-out,
                transform 10s linear;
}

.hero-slider .slide.active {
    opacity: 1;           /* Kích hoạt hiệu ứng hiện ra */
    transform: scale(1);  /* Kích hoạt hiệu ứng thu nhỏ lại */
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.2));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 40px 60px;
    border-radius: var(--border-radius);
}

.hero-title {
    font-size: 50px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
}

/* 5. SECTION STYLES */
/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--color-white);
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s, box-shadow 0.3s;

    &:hover {
        transform: translateY(-10px);
        box-shadow: var(--shadow-medium);
    }
    img {
        height: 60px;
        margin: 0 auto 20px auto;
    }
    h3 {
        font-size: 1.4rem;
        color: var(--color-dark);
        margin-bottom: 10px;
    }
}

/* Bestsellers Section */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* About Section */
.about-container {
    display: flex;
    align-items: center;
    gap: 80px;
}
.about-image {
    flex: 1;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}
.about-content {
    flex: 1.2;
}
.about-list {
    margin-top: 20px;
    list-style-type: none;
    
    li {
        padding-left: 30px;
        margin-bottom: 15px;
        position: relative;
        &::before {
            content: '✔';
            color: var(--color-primary);
            position: absolute;
            left: 0;
            font-weight: bold;
            font-size: 1.2rem;
        }
    }
}

/* 6. COMPONENT: BUTTONS & CARDS */
.btn {
    display: inline-block;
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    &:hover {
        background-color: #256a28;
        color: var(--color-white);
        transform: translateY(-3px);
        box-shadow: var(--shadow-medium);
    }
}
.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-border);
    &:hover {
        background-color: var(--color-primary);
        color: var(--color-white);
        border-color: var(--color-primary);
        transform: translateY(-3px);
    }
}

.product-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;

    &:hover {
        transform: translateY(-10px);
        box-shadow: var(--shadow-medium);
        .product-image {
            transform: scale(1.05);
        }
    }
    .product-image-container {
        height: 350px;
        overflow: hidden;
    }
    .product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }
    .product-info {
        padding: 25px;
        text-align: center;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    h3 {
        font-size: 1.3rem;
        color: var(--color-dark);
        margin-bottom: 10px;
    }
    .product-price {
        font-size: 1.2rem;
        color: var(--color-primary);
        font-weight: 700;
        margin-bottom: 20px;
    }
    .add-to-cart-btn {
        margin-top: auto;
    }
}

/* 7. FOOTER */
.main-footer-dark {
    background-color: var(--color-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 80px 0 0 0;
}
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
    padding-bottom: 60px;
}
.footer-col {
    flex: 1;
    min-width: 220px;
    
    h3, h4 {
        color: var(--color-white);
        margin-bottom: 25px;
        font-weight: 700;
    }
    .footer-logo {
        font-size: 1.8rem;
    }
    p {
        margin-bottom: 20px;
    }
    ul li {
        margin-bottom: 12px;
    }
    ul a {
        color: rgba(255, 255, 255, 0.7);
        &:hover {
            color: var(--color-white);
            padding-left: 5px;
        }
    }
}

.social-links {
    display: flex;
    gap: 15px;
    a {
        display: inline-block;
        color: rgba(255, 255, 255, 0.7);
        transition: transform 0.3s, color 0.3s;
        &:hover {
            color: var(--color-primary);
            transform: translateY(-3px);
        }
    }
}

.footer-map {
    width: 100%;
    height: 350px;
    padding-bottom: 60px;
    iframe {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: var(--border-radius);
        filter: grayscale(1);
    }
}

.footer-bottom {
    text-align: center;
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* 8. RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .features-grid, .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .section-title { font-size: 2.2rem; }
    .hero-title { font-size: 2.5rem; }

    .nav-menu {
        position: fixed;
        top: 0; right: -100%;
        width: 100%; height: 100vh;
        background-color: var(--color-white);
        flex-direction: column;
        justify-content: center;
        gap: 30px;
        transition: right 0.5s ease-in-out;
        z-index: 1000;
        
        &.active {
            right: 0;
        }
        a {
            color: var(--color-dark);
        }
    }
    
    .main-header:not(.scrolled) .nav-menu a {
         &:hover, &.active {
            color: var(--color-primary);
        }
    }

    .nav-toggle { 
        display: block; 
        z-index: 1001; 
    }

    .features-grid, .product-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-col {
        min-width: 100%;
    }
    .social-links {
        justify-content: center;
    }
    
    .hero-content {
        padding: 30px;
        margin: 0 15px;
    }
}
