/* Định dạng chung toàn trang */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2c3e50;
    --accent-color: #e67e22;
    --light-bg: #f8f9fa;
    --text-color: #333;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 8%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .logo {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

header .logo i {
    color: var(--accent-color);
}

.search-box {
    display: flex;
    width: 40%;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-box button {
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: 0.3s;
}

.search-box button:hover {
    background-color: #d35400;
}

.nav-icons {
    display: flex;
    align-items: center;
}

/* Biểu tượng Tài khoản trên Header */
.auth-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    margin-right: 25px;
    transition: 0.3s;
}

.auth-icon:hover {
    color: var(--accent-color);
}

.auth-icon i {
    font-size: 18px;
}

/* Biểu tượng Giỏ hàng */
.cart-icon {
    position: relative;
    font-size: 22px;
    cursor: pointer;
}

.cart-icon #cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--accent-color);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Banner chính */
.banner {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1513001900722-370f803f498d?q=80&w=1200') no-repeat center center/cover;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.banner-content h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.banner-content p {
    font-size: 18px;
    margin-bottom: 25px;
}

.btn-shop {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-shop:hover {
    background-color: #d35400;
}

/* Thân trang chính */
main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Bộ lọc danh mục */
.filter-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.filter-btn {
    background-color: white;
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Danh sách Grid Sản phẩm */
.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    border-left: 5px solid var(--accent-color);
    padding-left: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
}

.product-card h4 {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .author {
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

.product-card .price {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
}

.btn-add-cart {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
}

.btn-add-cart:hover {
    background-color: #1a252f;
}

/* Giao diện Slide Modal Giỏ hàng */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: flex-end;
    z-index: 1000;
}

.cart-content {
    background-color: white;
    width: 400px;
    height: 100%;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.close-cart {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
}

.cart-content h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
}

.cart-item img {
    width: 50px;
    height: 70px;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h5 {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-item-info p {
    color: var(--accent-color);
    font-weight: 500;
}

.btn-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 16px;
}

.cart-summary {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.total-price {
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.btn-checkout {
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

/* Modal Popup Đăng ký / Đăng nhập */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001; /* Đảm bảo đè lên trên giỏ hàng */
}

.auth-content {
    background-color: white;
    width: 400px;
    padding: 40px 30px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-auth {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.close-auth:hover {
    color: #333;
}

.auth-content h3 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 22px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
}

.form-group input:focus {
    border-color: var(--accent-color);
}

.btn-auth {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
    transition: 0.3s;
}

.btn-auth:hover {
    background-color: #1a252f;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-switch a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Footer */
/* ==================== FOOTER NÂNG CẤP ==================== */
footer {
    background-color: var(--primary-color);
    color: #ecf0f1;
    padding: 60px 0 20px 0;
    margin-top: 60px;
    font-size: 14px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr; /* Chia footer thành 4 cột tỉ lệ */
    gap: 40px;
}

.footer-col h4 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    font-weight: 600;
}

/* Đường gạch chân trang trí dưới tiêu đề mỗi cột */
.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 35px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-col p {
    line-height: 1.6;
    color: #b2bec3;
}

/* Định dạng danh sách liên kết */
.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #b2bec3;
    text-decoration: none;
    transition: 0.3s;
}

.footer-col ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px; /* Hiệu ứng dịch chuyển nhẹ khi hover */
}

/* Mạng xã hội ở cột 1 */
.social-links {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.social-links a {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.3s;
}

.social-links a:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

/* Khung đăng ký nhận tin ở cột 4 */
.newsletter-form {
    display: flex;
    margin: 15px 0 20px 0;
}

.newsletter-form input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 14px;
}

.newsletter-form button {
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 0 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: 0.3s;
}

.newsletter-form button:hover {
    background-color: #d35400;
}

.contact-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.contact-info p i {
    color: var(--accent-color);
}

/* Thanh Bản quyền dưới đáy */
.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #95a5a6;
    font-size: 13px;
}

/* Xử lý responsive cho màn hình máy tính bảng và điện thoại */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr; /* Màn hình vừa chia làm 2 hàng 2 cột */
    }
}

@media (max-width: 576px) {
    .footer-container {
        grid-template-columns: 1fr; /* Điện thoại xếp thành 1 hàng dọc */
        gap: 30px;
    }
}