/* RESET CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f1f8e9;
    color: #4a3429;
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}

/* HEADER */
.site-header {
    background-color: #ffffff;
    border-bottom: 2px solid #a5d6a7;
    padding: 15px 0;
}

.header-container {
    width: 96%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-logo {
    width: 12%;
    min-width: 100px;
}

.brand-logo img {
    width: 150%;
    height: 150px;
    object-fit: contain;
}

.header-banner {
    flex: 1;
}

.header-banner img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

/* MENU */
.main-menu {
    background-color: #ffffff;
    border-bottom: 1px solid #a5d6a7;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.menu-container {
    width: 96%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-left,
.menu-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.menu-link,
.cart-button {
    display: inline-block;
    padding: 15px 18px;
    color: #2e7d32;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.menu-link:hover,
.cart-button:hover,
.menu-link.active {
    background-color: #e8f5e9;
    color: #1b5e20;
}

/* HERO BANNER */
.hero-section {
    width: 100%;
    height: 500px;
    overflow: hidden;
    background-color: #f9fdf9;
}

.hero-slider {
    display: flex;
    width: 300%;
    height: 100%;
    animation: slideBanner 9s infinite;
}

.hero-slider img {
    width: 33.333%;
    height: 100%;
    object-fit: cover;
}

@keyframes slideBanner {
    0%, 28% {
        transform: translateX(0);
    }

    33%, 61% {
        transform: translateX(-33.333%);
    }

    66%, 95% {
        transform: translateX(-66.666%);
    }

    100% {
        transform: translateX(0);
    }
}

/* MAIN CONTENT */
.main-content {
    width: 100%;
}

/* PRODUCT SECTION */
.product-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 32px;
    color: #1b5e20;
    margin-bottom: 35px;
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Sửa từ center sang flex-start để hàng cuối thẳng lề trái */
    gap: 24px;
}

.product-card {
    /* ĐÃ SỬA: Chia chính xác 4 sản phẩm trên 1 hàng cho màn hình máy tính lớn */
    width: calc((100% - (24px * 3)) / 4); 
    background-color: #ffffff;
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    transition: 0.3s;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 22px rgba(76, 175, 80, 0.25);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
}

.product-card h3 {
    font-size: 19px;
    color: #4a3429;
    margin-bottom: 8px;
}

.product-desc {
    font-size: 14px;
    color: #7d665a;
    min-height: 45px;
    margin-bottom: 10px;
}

.product-price {
    font-size: 17px;
    color: #2e7d32;
    font-weight: bold;
    margin-bottom: 14px;
}

.product-card button {
    background-color: transparent;
    color: #2e7d32;
    border: 2px solid #2e7d32;
    padding: 9px 24px;
    border-radius: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.product-card button:hover {
    background-color: #2e7d32;
    color: #ffffff;
}

/* CART MODAL */
.cart-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.cart-modal.show {
    display: flex;
}

.cart-box {
    width: 90%;
    max-width: 650px;
    background-color: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    animation: showCart 0.25s ease;
}

@keyframes showCart {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f8e9;
    padding-bottom: 14px;
    margin-bottom: 15px;
}

.cart-header h2 {
    color: #1b5e20;
    font-size: 24px;
}

.close-cart {
    background: none;
    border: none;
    color: #7d665a;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
}

.close-cart:hover {
    color: #2e7d32;
}

.cart-list {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 8px;
}

.empty-cart {
    text-align: center;
    color: #7d665a;
    padding: 25px 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #c8e6c9;
}

.cart-item img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 16px;
    color: #4a3429;
    margin-bottom: 4px;
}

.cart-item-info p {
    font-size: 14px;
    color: #2e7d32;
    font-weight: bold;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: none;
    background-color: #f1f8e9;
    color: #1b5e20;
    font-weight: bold;
    cursor: pointer;
}

.quantity-control button:hover {
    background-color: #a5d6a7;
}

.quantity-control span {
    width: 34px;
    text-align: center;
    font-size: 14px;
}

.delete-button {
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    font-size: 14px;
}

.delete-button:hover {
    color: #2e7d32;
}

.cart-footer {
    border-top: 2px solid #f1f8e9;
    margin-top: 18px;
    padding-top: 16px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4a3429;
    font-size: 18px;
    margin-bottom: 15px;
}

.cart-total strong {
    color: #1b5e20;
    font-size: 22px;
}

.checkout-button {
    width: 100%;
    padding: 14px;
    background-color: #4caf50;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.checkout-button:hover {
    background-color: #2e7d32;
}

/* FOOTER */
.site-footer {
    background-color: #ffffff;
    border-top: 2px solid #a5d6a7;
    margin-top: 70px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 45px 20px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 30px;
}

.footer-column h3 {
    font-size: 18px;
    color: #1b5e20;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-column p,
.footer-column a {
    display: block;
    font-size: 15px;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 8px;
}

.footer-column a:hover {
    color: #1b5e20;
}

.footer-bottom {
    background-color: #e8f5e9;
    text-align: center;
    padding: 16px 20px;
}

.footer-bottom p {
    color: #4a3429;
    font-size: 15px;
}

/* RESPONSIVE */
/* ĐÃ THÊM: Màn hình trung bình/máy tính bảng (dưới 1100px) sẽ chuyển thành 2 sản phẩm/hàng để không bị vỡ chữ */
@media (max-width: 1100px) {
    .product-card {
        width: calc((100% - 24px) / 2);
    }
}

@media (max-width: 900px) {
    .header-container {
        flex-direction: column;
    }

    .brand-logo {
        width: 160px;
    }

    .header-banner {
        width: 100%;
    }

    .menu-container {
        flex-direction: column;
    }

    .menu-left,
    .menu-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-section {
        height: 330px;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    /* ĐÃ SỬA: Màn hình điện thoại nhỏ sẽ hiển thị 1 sản phẩm chiếm trọn 1 hàng */
    .product-card {
        width: 100%;
    }

    .cart-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }
}