body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    background-color: #f9f8ff;
    color: #333;
}

/* Header */
header {
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    padding: 12px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.4em;
    font-weight: bold;
    display: flex;
    gap: 10px;
    align-items: center;
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

nav a:hover {
    text-decoration: underline;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cart-badge {
    position: relative;
    display: inline-block;
}

.cart-badge sup {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
}

/* --- START: CSS CHO THANH TÌM KIẾM --- */
.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    padding: 6px 12px;
    width: 400px;
    /* Giảm độ rộng để vừa vặn hơn */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.search-box input {
    border: none;
    outline: none;
    width: 100%;
    padding: 8px;
    font-size: 14px;
    /* Giảm font-size 1 chút */
    border-radius: 25px;
}

.search-box i {
    color: #667eea;
    /* Đổi màu icon cho khớp theme */
    font-size: 16px;
    margin-right: 8px;
}

/* --- END: CSS CHO THANH TÌM KIẾM --- */

/* Banner Slideshow */
.banner {
    height: 450px;
    position: relative;
    overflow: hidden;
}

/* Slide bố cục 2 phần: trái nội dung, phải ảnh */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0 80px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Bên trái: nội dung */
.banner-content {
    width: 50%;
    text-align: left;
}

.banner-content h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.banner-content p {
    font-size: 18px;
    margin-bottom: 25px;
}

.btn-banner {
    display: inline-block;
    background: white;
    color: #333;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-banner:hover {
    background: #f1f1f1;
}

/* Bên phải: hình ảnh */
.slide img {
    width: 50%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Nút điều hướng */
.banner-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 24px;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.banner-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #333;
}

.banner-btn.prev {
    left: 20px;
}

.banner-btn.next {
    right: 20px;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .slide {
        flex-direction: column;
        padding: 30px 20px;
        text-align: center;
    }

    .banner-content,
    .slide img {
        width: 100%;
    }

    .slide img {
        height: 250px;
        border-radius: 10px;
        margin-top: 15px;
    }
}

.banner-content {
    max-width: 50%;
    text-align: left;
}

.banner-content h1 {
    font-size: 40px;
    margin-bottom: 10px;
}

.banner-content p {
    font-size: 18px;
    margin-bottom: 20px;
}

.btn-banner {
    display: inline-block;
    background: white;
    color: #333;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-banner:hover {
    background: #f1f1f1;
}

/* Nút điều hướng */
.banner-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 24px;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.banner-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #333;
}

.banner-btn.prev {
    left: 20px;
}

.banner-btn.next {
    right: 20px;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 40px 60px;
}

.feature {
    background: white;
    border-radius: 10px;
    text-align: center;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 36px;
    color: #667eea;
    margin-bottom: 10px;
}

/* Sản phẩm nổi bật */
.container {
    padding: 20px 60px 60px;
}

.container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 28px;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.product {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 430px;
    /* Tăng chiều cao 1 chút để chứa mô tả */
    overflow: hidden;
    /* Đảm bảo bo góc hoạt động */
    padding-bottom: 16px;
}

.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product img {
    width: 85%;
    height: 190px;
    object-fit: contain;
    margin: 10px auto;
    transition: transform 0.3s ease;
}

.product:hover img {
    transform: scale(1.05);
}

.product h3 {
    margin: 10px 16px 8px 16px;
    font-size: 17px;
    color: #333;
    height: 40px;
    /* Vừa đủ cho 2 dòng */
    overflow: hidden;
    text-align: left;
    /* Căn trái cho dễ đọc */
}

/* CSS CHO MÔ TẢ SẢN PHẨM */
.product .description {
    font-size: 13px;
    color: #555;
    height: 60px;
    /* Giữ chỗ cho 3-4 dòng */
    overflow: hidden;
    margin-bottom: 10px;
    padding: 0 16px;
    text-align: left;
    /* Căn trái */
    line-height: 1.5;
}

.product .price {
    color: #7158e2;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 0 16px;
    text-align: left;
    /* Căn trái */
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    margin-top: auto;
    /* Đây là trick để đẩy nút xuống dưới cùng */
}

.btn {
    background: #7158e2;
    color: white;
    border: none;
    padding: 9px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    flex: 1;
    /* Hai nút bằng nhau */
    text-align: center;
    transition: background 0.2s;
}

.btn:hover {
    background: #5a3cb7;
}

/* Nút "Xem" có thể để màu khác */
.btn:first-child {
    background-color: #f0f0f0;
    color: #333;
}

.btn:first-child:hover {
    background-color: #e0e0e0;
}

/* Footer */
footer {
    background: #2d3436;
    color: white;
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .banner {
        height: auto;
        min-height: 400px;
    }

    .slide {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .slide img {
        width: 80%;
        margin-top: 15px;
    }

    .banner-content {
        max-width: 100%;
        text-align: center;
    }

    .banner-content h1 {
        font-size: 28px;
    }
}

/* --- CSS MỚI CHO ACCOUNT DROPDOWN --- */
.account-menu {
    position: relative;
    cursor: pointer;
}

.account-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-content {
    display: none;
    /* Ẩn ban đầu */
    position: absolute;
    right: 0;
    top: 150%;
    /* Vị trí dưới nút "Tài khoản" */
    background-color: white;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
    /* Hiện khi có class 'show' */
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #f5f3ff;
    color: #7158e2;
}

.dropdown-content a i {
    width: 16px;
    text-align: center;
}