/* ===================================================
   1. RESET & CHUNG
   =================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.6;
}

a { text-decoration: none; transition: 0.3s; }
ul { list-style: none; }

/* ===================================================
   2. HEADER & NAVIGATION
   =================================================== */
header {
    background: #ffffff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo h1 {
    color: #1a73e8;
    font-size: 28px;
    letter-spacing: -1px;
}

.logo p {
    font-size: 13px;
    color: #65676b;
}

.search-box {
    display: flex;
    width: 450px;
}

.search-box input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 25px 0 0 25px;
    outline: none;
    font-size: 14px;
}

.search-box button {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
}

.search-box button:hover { background: #1557b0; }

nav {
    background: #1a73e8;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
}

nav ul li a {
    display: block;
    padding: 15px 25px;
    color: white;
    font-weight: 500;
}

nav ul li a:hover, nav ul li a.active {
    background: #1557b0;
}

.cart-nav i { margin-right: 5px; }
#cart-count {
    background: #ff4d4d;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 11px;
}

/* ===================================================
   3. LAYOUT CHÍNH (Trang Danh Mục Sản Phẩm)
   =================================================== */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    padding: 0 20px;
}

/* Sidebar lọc */
.sidebar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar h3 { margin-bottom: 20px; font-size: 18px; }

.filter-group { margin-bottom: 20px; }
.filter-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.filter-group select {
    width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #ddd;
}

.category-list button {
    display: block; width: 100%; padding: 12px; margin-bottom: 8px;
    text-align: left; background: #f8f9fa; border: 1px solid transparent;
    border-radius: 8px; cursor: pointer; font-weight: 500;
}

.category-list button:hover, .category-list button.active-cat {
    background: #e8f0fe; color: #1a73e8; border-color: #1a73e8;
}

/* ===================================================
   4. GRID SẢN PHẨM (Card)
   =================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: 0.3s;
}

.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.product-card img { width: 100%; height: 200px; object-fit: cover; }

.card-info { padding: 15px; text-align: center; }

.price { color: #d93025; font-size: 1.2rem; font-weight: bold; margin: 10px 0; }

.view-detail {
    width: 100%; padding: 10px; background: #1a73e8; color: white;
    border: none; border-radius: 6px; cursor: pointer; font-weight: 600;
}

/* ===================================================
   5. CHI TIẾT SẢN PHẨM (Trang sanpham1.html) - MỚI
   =================================================== */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    /* Ghi đè grid của main-container khi ở trang chi tiết */
}

/* Trường hợp dùng main-container bao quanh detail */
.main-container:has(.product-detail-container) {
    grid-template-columns: 1fr; 
}

.main-image-wrapper {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
}

#bigImg { width: 100%; transition: 0.5s; cursor: zoom-in; }
#bigImg:hover { transform: scale(1.05); }

.image-select { display: flex; gap: 10px; margin-top: 15px; }
.thumb {
    width: 80px; height: 60px; border: 2px solid #eee;
    border-radius: 5px; cursor: pointer; overflow: hidden;
}
.thumb.active { border-color: #1a73e8; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-title { font-size: 28px; color: #202124; margin: 10px 0; }

.price-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.detail-price { font-size: 30px; color: #d93025; font-weight: 800; }

.specs { margin: 20px 0; }
.specs li { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.specs li i { color: #1a73e8; }

.qty-btn { display: flex; margin: 20px 0; align-items: center; gap: 10px; }
.qty-btn input { width: 60px; padding: 8px; text-align: center; border: 1px solid #ddd; border-radius: 5px; }

.btn-group { display: flex; gap: 15px; }
.btn-add {
    flex: 1; padding: 15px; border: 1px solid #1a73e8;
    background: #e8f0fe; color: #1a73e8; font-weight: bold; border-radius: 8px; cursor: pointer;
}
.btn-buy {
    flex: 1; padding: 15px; background: #1a73e8;
    color: white; border: none; font-weight: bold; border-radius: 8px; cursor: pointer;
}
.btn-buy:hover { background: #1557b0; }

.trust-badges {
    display: grid; grid-template-columns: repeat(3, 1fr);
    margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; gap: 10px;
}
.badge-item { text-align: center; font-size: 12px; color: #666; }
.badge-item i { display: block; font-size: 20px; margin-bottom: 5px; }

/* ===================================================
   6. LIÊN HỆ & PHỤ TRỢ
   =================================================== */
.contact-container {
    display: grid; grid-template-columns: 350px 1fr; gap: 30px;
}

.contact-info { background: #1a73e8; color: white; padding: 30px; border-radius: 15px; }

.contact-form { background: white; padding: 30px; border-radius: 15px; }

.input-group { margin-bottom: 15px; }
.input-group input, .input-group textarea {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px;
}

/* ===================================================
   7. FOOTER
   =================================================== */
footer {
    background: #202124;
    color: #bdc1c6;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #3c4043;
    margin-top: 20px;
}

/* ===================================================
   8. ĐIỀU CHỈNH RESPONSIVE
   =================================================== */
@media (max-width: 992px) {
    .main-container, .product-detail-container, .contact-container {
        grid-template-columns: 1fr !important;
    }
    .search-box { width: 100%; }
}
/* ===================================================
   9. TRANG GIỎ HÀNG (giohang.html)
   =================================================== */

.cart-page-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.cart-title {
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Layout Giỏ hàng: 2 cột (Danh sách sản phẩm | Hóa đơn) */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* Bảng sản phẩm */
.cart-table-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #f0f2f5;
    color: #65676b;
    font-size: 14px;
    text-transform: uppercase;
}

.cart-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
}

/* Sản phẩm trong giỏ */
.cart-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-item-info img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.btn-remove {
    color: #d93025;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.btn-remove:hover { text-decoration: underline; }

/* Cột số lượng trong giỏ */
.cart-qty-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

/* Cột thanh toán (Tổng đơn) */
.cart-summary {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 100px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #65676b;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f2f5;
    font-size: 20px;
    font-weight: bold;
    color: #d93025;
}

.btn-checkout {
    width: 100%;
    padding: 18px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}

.btn-checkout:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 115, 232, 0.3);
}

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #1a73e8;
    font-size: 14px;
}

/* Trạng thái giỏ hàng trống */
.empty-cart {
    text-align: center;
    padding: 50px;
}
.empty-cart i {
    font-size: 80px;
    color: #ddd;
    margin-bottom: 20px;
}

@media (max-width: 850px) {
    .cart-layout { grid-template-columns: 1fr; }
}

/* ===================================================
   10. TRANG ĐĂNG NHẬP (dangnhap.html)
   =================================================== */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 10px;
    color: #1a73e8;
    font-size: 28px;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
}

.login-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
}

.login-form input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 8px rgba(26, 115, 232, 0.2);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login:hover {
    background: #1557b0;
    transform: translateY(-2px);
}

.login-footer {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-footer a {
    color: #1a73e8;
    font-weight: bold;
}

/* ===================================================
   11. TRANG ĐĂNG KÝ (dangky.html)
   =================================================== */
.register-card {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.register-card h2 {
    color: #28a745; /* Màu xanh lá cho khác biệt với Đăng nhập */
    margin-bottom: 10px;
}

.btn-register {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-register:hover {
    background: #218838;
    transform: translateY(-2px);
}


.view-detail-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    font-weight: bold;
}
.view-detail-btn:hover {
    background-color: #2980b9;
}

/* Bố cục chính cho Giỏ hàng */
.cart-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.cart-title {
    font-size: 24px;
    margin-bottom: 20px;
    border-left: 5px solid #ff4757;
    padding-left: 15px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px; /* Chia 2 cột: Danh sách và Tổng tiền */
    gap: 30px;
    align-items: start;
}

/* Từng dòng sản phẩm */
.cart-items {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.cart-item:hover {
    background: #f9f9f9;
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
}

.item-info {
    flex: 1; /* Đẩy các phần khác sang phải */
}

.item-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.item-price {
    color: #ff4757;
    font-weight: bold;
}

/* Cụm nút tăng giảm số lượng */
.item-qty {
    display: flex;
    align-items: center;
    margin: 0 30px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
}

.item-qty input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
}

.item-total {
    width: 120px;
    font-weight: bold;
    color: #2f3542;
    text-align: right;
}

.remove-btn {
    background: none;
    border: none;
    color: #ff4757;
    margin-left: 20px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.2s;
}

.remove-btn:hover {
    transform: scale(1.2);
}

/* Cột tóm tắt đơn hàng (Bên phải) */
.cart-summary {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 20px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #666;
}

.total-price {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-top: 15px;
}

#final-total {
    color: #ff4757;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}

.checkout-btn:hover {
    background: #e84118;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.3);
}

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #57606f;
    text-decoration: none;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}


