/* ==========================================================
   1. THIẾT LẬP CHUNG (RESET & GLOBAL)
   ================================================---------- */
body {
    font-family: Arial, sans-serif;
    background-color: #f7f8fa;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

/* ==========================================================
   2. HEADER & THANH ĐIỀU HƯỚNG
   ================================================---------- */
header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.main-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo a {
    font-size: 22px;
    font-weight: bold;
    color: #ff9900;
    text-decoration: none;
}

.search-form {
    display: flex;
    gap: 5px;
    flex: 1;
    max-width: 400px;
}

.search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.search-form button {
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #ff9900;
}

/* ==========================================================
   3. LƯỚI SẢN PHẨM & TRANG CHỦ
   ================================================---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.product-item {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 6px;
}

.product-item img {
    max-width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
}

.product-item h3 {
    font-size: 16px;
    margin: 10px 0;
    height: 40px;
    overflow: hidden;
}

.add-to-cart {
    background-color: #ff9900;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    margin-top: 10px;
}

.add-to-cart:hover {
    background-color: #e68a00;
}

/* ==========================================================
   4. TRANG CHI TIẾT SẢN PHẨM
   ================================================---------- */
.product-detail-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 20px;
}

.product-image-section img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 6px;
}

.product-category-tag {
    display: inline-block;
    background: #eef2f7;
    color: #007bff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-info-section h1 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.product-price-box {
    margin-bottom: 15px;
}

.price-current {
    font-size: 22px;
    color: #d9534f;
    font-weight: bold;
}

.price-old {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-right: 10px;
}

.product-age, .product-stock {
    margin-bottom: 10px;
    color: #555;
}

.quantity-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.quantity-box input {
    width: 70px;
    padding: 8px;
    font-size: 16px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-add-large {
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.btn-add-large:hover {
    background-color: #e68a00;
}

.product-description-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-top: 20px;
}

.description-content {
    margin-top: 10px;
    line-height: 1.6;
    color: #444;
}

/* ==========================================================
   5. TRANG DANH MỤC SẢN PHẨM (CATEGORY)
   ================================================---------- */
.category-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-filter-bar {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.category-filter-bar h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 2px solid #ff9900;
    padding-bottom: 5px;
}

.category-filter-bar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-filter-bar ul li {
    margin-bottom: 8px;
}

.category-filter-bar ul li a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.category-filter-bar ul li a:hover,
.category-filter-bar ul li a.active {
    background-color: #ff9900;
    color: white;
    font-weight: bold;
}

.category-product-content {
    flex: 1;
}

.category-product-content h1 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #333;
}

/* ==========================================================
   6. GIỎ HÀNG & THANH TOÁN
   ================================================---------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    min-width: 500px;
    background: #fff;
}

.cart-table th, .cart-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
}

.cart-summary {
    text-align: right;
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.btn-checkout {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: bold;
}

.checkout-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.checkout-form, .checkout-summary {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.btn-submit-order {
    background-color: #28a745;
    color: white;
    padding: 12px;
    border: none;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.summary-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.total-highlight {
    color: #d9534f;
    font-size: 18px;
}

/* Nhãn trạng thái đơn hàng */
.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}
.status-pending { background-color: #f0ad4e; }
.status-shipping { background-color: #0275d8; }
.status-completed { background-color: #5cb85c; }
.status-cancelled { background-color: #d9534f; }

/* ==========================================================
   7. FOOTER CHUYÊN NGHIỆP
   ================================================---------- */
.site-footer {
    background-color: #222;
    color: #f1f1f1;
    margin-top: 50px;
    padding-top: 40px;
    font-size: 14px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 0 20px 30px 20px;
}

.footer-col h3 {
    color: #ff9900;
    font-size: 16px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-col p, .footer-col li {
    color: #bbb;
    line-height: 1.6;
    margin-bottom: 8px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: #ff9900;
}

.footer-bottom {
    background-color: #111;
    text-align: center;
    padding: 15px 20px;
    color: #888;
    border-top: 1px solid #333;
}

/* ==========================================================
   8. RESPONSIVE DESIGN (THIẾT KẾ ĐÁP ỨNG CHO MÁY TÍNH)
   ================================================---------- */
@media (min-width: 768px) {
    /* Chi tiết sản phẩm & Thanh toán: Chia 2 cột */
    .product-detail-wrapper,
    .checkout-wrapper {
        flex-direction: row;
    }
    .product-image-section, 
    .product-info-section,
    .checkout-form {
        flex: 2;
    }
    .checkout-summary {
        flex: 1;
    }

    /* Trang danh mục */
    .category-page {
        flex-direction: row;
        align-items: flex-start;
    }
    .category-filter-bar {
        width: 250px;
        flex-shrink: 0;
    }

    /* Footer: 3 cột */
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
    }
    .footer-col {
        flex: 1;
        padding-right: 20px;
    }
}

/* --- Trang chủ: Banner Chào mừng dễ thương --- */
.hero-banner {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    margin: 20px 0 35px 0;
    box-shadow: 0 8px 20px rgba(252, 182, 159, 0.2);
}

.hero-banner h1 {
    font-size: 32px;
    color: #d97706;
    margin-bottom: 10px;
    font-weight: 600;
}

.hero-banner p {
    font-size: 16px;
    color: #4b5563;
    margin-bottom: 20px;
}

.hero-btn {
    display: inline-block;
    background-color: #ff9900;
    color: white;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255, 153, 0, 0.3);
    transition: transform 0.2s, background-color 0.2s;
}

.hero-btn:hover {
    background-color: #e68a00;
    transform: translateY(-2px);
}

/* Tiêu đề phần sản phẩm */
.section-title {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
    width: 6px;
    height: 24px;
    background-color: #ff9900;
    border-radius: 4px;
    display: inline-block;
}

/* Lưới sản phẩm phong cách bo tròn tinh tế */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    padding: 10px 0;
}

.product-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: #fed7aa;
}

.product-item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: transform 0.3s;
}

.product-item:hover img {
    transform: scale(1.03);
}

.product-item h3 {
    font-size: 15px;
    margin: 10px 0;
    height: 40px;
    overflow: hidden;
    color: #374151;
}

.product-item h3 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.product-item h3 a:hover {
    color: #ff9900;
}

.product-price {
    margin: 10px 0 15px 0;
}

.price-current {
    font-size: 18px;
    color: #ef4444;
    font-weight: bold;
}

.price-old {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-right: 8px;
}

.add-to-cart {
    background-color: #ff9900;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: background-color 0.2s;
}

.add-to-cart:hover {
    background-color: #e68a00;
}

/* Responsive cho màn hình di động */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}