
/* File: assets/css/style.css */

:root {
    --primary-color: #d31877; /* Hồng */
    --text-color: #333;
    --white-color: #fff;
    --border-color: #ddd;
}

/* Reset và thiết lập cơ bản */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}


/* === Product Grid Styling === */
.product-grid {
    display: grid;
    /* Mặc định hiển thị 2 cột trên di động */
    grid-template-columns: repeat(2, 1fr);
    gap: 20px; /* Khoảng cách giữa các sản phẩm */
    margin-top: 20px;
}

/* Product Card */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-card img {
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Giữ ảnh luôn là hình vuông */
    object-fit: cover;
    margin-bottom: 1rem;
}

.product-card h3 {
    font-size: 1rem;
    line-height: 1.4; /* Thêm chiều cao cho mỗi dòng chữ */
    height: 2.8em; /* Chiều cao tương đương 2 dòng (1.4 * 2) */
    overflow: hidden;
    margin-bottom: 0.5rem;
    
    /* Thuộc tính bổ sung để hiển thị dấu "..." nếu quá dài */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.product-card .price {
    color: #d0021b;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.product-card .add-to-cart-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    white-space: nowrap; /* Thêm dòng này */
    text-decoration: none; /* Đảm bảo không có gạch chân */
    display: inline-block; /* Đảm bảo padding hoạt động đúng */
    text-align: center; /* Căn giữa chữ */
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

/* Responsive Grid: 4 cột trên màn hình lớn */
@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === Product Detail Page Styling === */
.product-detail-layout {
    display: flex;
    flex-wrap: wrap; /* Cho phép xuống dòng trên màn hình nhỏ */
    gap: 30px;
}

.product-image {
    flex: 1 1 400px; /* co giãn, cơ sở 400px */
}

.product-image img {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.product-info {
    flex: 1 1 500px; /* co giãn, cơ sở 500px */
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-info .price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #d0021b;
    margin-bottom: 1.5rem;
}

.product-info .description {
    margin-bottom: 1.5rem;
}

.add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.add-to-cart-form label {
    font-weight: bold;
}

.add-to-cart-form input[type="number"] {
    width: 70px;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

/* Tái sử dụng class .add-to-cart-btn từ trước */
.add-to-cart-form .add-to-cart-btn {
    width: auto; /* không chiếm 100% chiều rộng nữa */
    padding: 12px 25px;
}

/* === Toast Notification Styling === */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #28a745; /* Màu xanh lá cây thành công */
    color: var(--white-color);
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* === Cart Page Styling === */
.cart-empty {
    text-align: center;
    padding: 3rem 0;
}
.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
}
.cart-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}
.cart-items-list {
    flex: 2 1 600px;
}
/* File: assets/css/style.css */

.cart-item {
    display: flex;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    align-items: center; /* Căn giữa các thành phần theo chiều dọc */
}
.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}
.item-info {
    flex-grow: 1; /* Cho phép tên sản phẩm chiếm nhiều không gian nhất */
}
.item-info h3 { font-size: 1.1rem; margin: 0; }
.item-info .price { color: #555; margin-top: 5px; }

/* Style cho ô nhập số lượng */
.item-quantity {
    flex-basis: 120px; /* Đặt chiều rộng cơ sở */
    text-align: center;
}
.item-quantity label {
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-bottom: 5px;
}
.item-quantity input {
    width: 70px;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

/* Style cho tổng phụ và nút xóa */
.item-subtotal {
    flex-basis: 120px; /* Đặt chiều rộng cơ sở */
    text-align: right;
}
.item-subtotal p {
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0;
}
.remove-item {
    color: #dc3545;
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: 5px;
    display: inline-block;
    transition: color 0.2s;
}
.remove-item:hover {
    color: #a71d2a;
    text-decoration: underline;
}
.cart-summary {
    flex: 1 1 300px;
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 5px;
    height: fit-content;
}
.cart-summary h2 { margin-bottom: 1rem; }
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.summary-row.total {
    font-weight: bold;
    font-size: 1.2rem;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.btn-checkout {
    width: 100%;
    padding: 15px;
    background-color: #d0021b;
    color: var(--white-color);
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
}

/* === Checkout Page Styling === */
.checkout-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
.customer-info-form {
    flex: 2 1 500px;
}
.order-summary {
    flex: 1 1 350px;
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 5px;
    height: fit-content;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.error-messages {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.summary-item img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
}
.summary-item .item-details { flex-grow: 1; }
.summary-item .item-details span { display: block; }
.summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 1.2rem;
}

/* =================================================================== */
/* === HEADER & NAVIGATION STYLING (FINAL & UNIFIED VERSION) === */
/* =================================================================== */

/* --- 1. Top Bar --- */
.top-bar {
    background-color: #f8f9fa;
    font-size: 0.85rem;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    color: #6c757d;
}
.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-contact span { margin-right: 20px; }
.top-bar-links a { color: #6c757d; text-decoration: none; margin-left: 20px; }
.top-bar-links a:hover { color: var(--primary-color); }

/* --- 2. Main Header --- */
.main-header {
    background-color: var(--white-color);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.main-header .logo img { max-height: 50px; }

/* Thanh tìm kiếm */
.header-search-form {
    flex-grow: 1;
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    overflow: hidden;
}
.header-search-form input {
    flex-grow: 1;
    border: none;
    padding: 10px 20px;
    outline: none;
    font-size: 1rem;
}
.header-search-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-weight: bold;
}

/* Các icon hành động */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-color);
}
.action-item .action-text {
    font-size: 0.9rem;
}
.cart-icon-link {
    position: relative;
}
#cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 3. Navigation Bar --- */
.main-navigation {
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.main-navigation > .container > ul { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    display: flex; 
}

.main-navigation ul li a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.main-navigation ul li a:hover {
    background-color: rgba(255,255,255,0.1);
}
.dropdown {
    position: relative;
}
.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 100;
}
.dropdown:hover .mega-menu {
    display: block;
}
/* Các mục con trong menu */
.mega-menu .category-list a {
    color: var(--text-color);
    font-size: 0.9rem;
    text-transform: none;
    font-weight: normal;
    display: block; /* Đảm bảo thẻ a chiếm hết không gian */
    padding: 12px 20px;
    transition: all 0.25s ease-in-out; /* Thêm hiệu ứng chuyển động */
    list-style: none;
}

/* Hiệu ứng khi di chuột qua */
.mega-menu .category-list a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    transform: translateX(5px); /* Trượt nhẹ sang phải 5px */
    font-weight: bold; /* In đậm chữ */
    list-style: none;
}

/* --- 4. Responsive (Mobile View) --- */
.menu-toggle {
    display: none; /* Ẩn nút hamburger trên desktop */
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #333;
}

@media (max-width: 992px) {
    /* Ẩn các phần không cần thiết */
    .top-bar,
    .action-item .action-text {
        display: none;
    }

    /* Sắp xếp lại header thành 2 dòng */
    .main-header .container {
        flex-wrap: wrap; /* Cho phép các mục xuống dòng */
        gap: 15px;
    }
    .logo {
        flex-grow: 1; /* Cho logo chiếm không gian */
    }
    .header-actions {
        order: 2; /* Đưa các icon lên trước nút menu */
    }
    .menu-toggle {
        display: block;
        order: 3; /* Nút menu ở cuối cùng của dòng 1 */
    }
    
    /* HIỂN THỊ THANH TÌM KIẾM Ở DÒNG 2 */
    .header-search-form {
        display: flex;
        order: 4; /* Đẩy xuống dòng thứ 2 */
        width: 100%; /* Chiếm toàn bộ chiều rộng */
        margin-top: 10px;
    }

    /* Style cho menu chính khi xổ ra */
    .main-navigation {
        display: none;
        position: absolute;
        top: 125px; /* Điều chỉnh vị trí để không bị che */
        left: 0;
        width: 100%;
        background-color: white;
        z-index: 999;
    }
    .main-navigation.is-active {
        display: block;
    }
    .main-navigation ul {
        flex-direction: column;
    }
    .main-navigation ul li a {
        color: var(--text-color);
        border-bottom: 1px solid #f0f0f0;
    }
    .dropdown .mega-menu {
        display: none; /* Mặc định ẩn menu con */
        position: static; /* Bỏ định vị tuyệt đối của desktop */
        box-shadow: none;
        border-top: 1px solid #eee;
        background-color: #f8f9fa; /* Màu nền hơi khác để phân biệt */
    }

    /* KHI MỤC CHA CÓ CLASS 'OPEN', MENU CON SẼ HIỆN RA */
    .dropdown.open .mega-menu {
        display: block;
    }

    /* Thụt lề các danh mục con để phân cấp */
    .mega-menu .category-list a {
        padding-left: 40px !important; 
    }
}

/* === Search Form Styling === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-form {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
}

.search-form input[type="text"] {
    border: none;
    padding: 8px 15px;
    outline: none;
    width: 200px; /* Thêm dòng này */
    transition: width 0.3s; /* Thêm hiệu ứng cho mượt mà */
}

/* Tùy chọn: Làm cho ô tìm kiếm rộng ra khi nhấp vào */
.search-form input[type="text"]:focus {
    width: 250px;
}

.search-form button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0 12px;
    font-size: 1.1rem;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* === Pagination Styling === */
.pagination {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    gap: 8px;
}

.pagination a {
    color: var(--primary-color);
    padding: 10px 16px;
    text-decoration: none;
    transition: background-color .3s;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
}

.pagination a.active {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.pagination a:hover:not(.active) {
    background-color: #ddd;
}


/* === Star Rating Display === */
.star-rating-display { display: flex; align-items: center; gap: 8px; margin-bottom: 1rem; }
.stars-outer { position: relative; display: inline-block; font-size: 20px; }
.stars-outer::before { content: "☆☆☆☆☆"; color: #ccc; }
.stars-inner { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; font-size: 20px; }
.stars-inner::before { content: "★★★★★"; color: #f8ce0b; }

/* === Reviews Section === */
.reviews-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #eee; }
.review-form { background-color: #f8f9fa; padding: 25px; border-radius: 8px; margin-bottom: 2rem; }
.review-list { display: flex; flex-direction: column; gap: 25px; }
.review-item { padding-bottom: 25px; border-bottom: 1px solid #eee; }
.review-item:last-child { border-bottom: none; }
.review-author { font-size: 1.1rem; }
.review-rating { margin: 5px 0; }
.review-comment { margin: 10px 0; color: #555; }
.review-date { font-size: 0.85rem; color: #888; }

/* === Star Rating Input === */
.star-rating-input {
    display: inline-block;
    direction: rtl; /* Đảo ngược thứ tự để có hiệu ứng hover đúng */
    border: none;
    padding: 0;
}
.star-rating-input > input[type=radio] {
    display: none; /* Ẩn các nút radio tròn mặc định */
}
.star-rating-input > label {
    color: #ccc;
    font-size: 2rem;
    padding: 0 5px;
    cursor: pointer;
    transition: color 0.2s;
    float: right;
}
/* Hiệu ứng khi di chuột qua */
.star-rating-input > label:hover,
.star-rating-input > label:hover ~ label {
    color: #f8ce0b;
}
/* Hiệu ứng khi một nút radio được chọn */
.star-rating-input > input[type=radio]:checked ~ label {
    color: #f8ce0b;
}

/* === Swiper Banner Styling === */
.swiper-container {
    position: relative; /* << THÊM DÒNG NÀY (RẤT QUAN TRỌNG) */
    width: 100%;
    height: 350px;
    background-color: #f0f0f0;
    margin-bottom: 2rem; /* Thêm khoảng cách với phần sản phẩm bên dưới */
    border-radius: 8px; /* Bo góc cho đẹp hơn */
    overflow: hidden; /* Giấu các phần thừa của ảnh khi bo góc */
}
.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}
.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Giúp ảnh vừa vặn mà không bị méo */
}
/* Tùy chỉnh màu sắc cho nút điều hướng và pagination */
.swiper-button-next, .swiper-button-prev {
    color: var(--primary-color) !important;
}
.swiper-pagination-bullet-active {
    background: var(--primary-color) !important;
}


/* === Advanced Product Gallery & Variations === */

/* Cột gallery ảnh bên trái */
.product-gallery {
    display: flex;
    flex-direction: column;
}

.main-image-display {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.main-image-display img {
    width: 100%;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover;
}
.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Tạo lưới 6 cột cho ảnh phụ */
    gap: 10px;
}
.thumbnail-item {
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.2s;
    aspect-ratio: 1/1;
    object-fit: cover;
    width: 100%;
}
.thumbnail-item:hover, .thumbnail-item.active {
    border-color: var(--primary-color);
}

/* Khu vực phân loại bên phải */
.variations-wrapper {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.variation-group {
    margin-bottom: 1rem;
}
.variation-group label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}
.variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.variation-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 15px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}
.variation-btn img {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    object-fit: cover;
}
.variation-btn:hover {
    border-color: #888;
}
.variation-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

/* === Bố cục cho trang chi tiết sản phẩm === */
.product-detail-layout {
    display: flex;
    flex-wrap: wrap; /* Cho phép xuống dòng trên màn hình nhỏ */
    gap: 30px;
}

.product-gallery {
    flex: 1 1 50%; /* Cột trái chiếm 50% */
    max-width: 50%;
}

.product-info {
    flex: 1 1 45%; /* Cột phải chiếm 45% (còn lại 5% cho khoảng cách) */
}

/* Responsive cho di động: Các cột sẽ tự xếp chồng lên nhau */
@media (max-width: 768px) {
    .product-gallery, .product-info {
        flex-basis: 100%; /* Mỗi cột chiếm 100% chiều rộng */
        max-width: 100%;
    }
}

/* === Gallery ảnh (giữ nguyên như cũ) === */
.main-image-display { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; margin-bottom: 1rem; }
.main-image-display img { width: 100%; display: block; aspect-ratio: 1/1; object-fit: cover; }
.thumbnail-gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.thumbnail-item { border: 2px solid transparent; border-radius: 5px; cursor: pointer; transition: border-color 0.2s; aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.thumbnail-item:hover, .thumbnail-item.active { border-color: var(--primary-color); }

/* === Phân loại sản phẩm (giữ nguyên như cũ) === */
.variations-wrapper { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.variation-group { margin-bottom: 1rem; }
.variation-group label { font-weight: bold; margin-bottom: 0.5rem; display: block; }
.variation-options { display: flex; flex-wrap: wrap; gap: 10px; }
.variation-btn { display: flex; align-items: center; gap: 8px; padding: 5px 15px; background-color: #fff; border: 1px solid var(--border-color); border-radius: 5px; cursor: pointer; }
.variation-btn img { width: 24px; height: 24px; border-radius: 3px; object-fit: cover; }
.variation-btn.active { border-color: var(--primary-color); background-color: var(--primary-color); color: white; }

/* === Product Action Buttons Styling === */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}
.quantity-selector input {
    width: 70px;
    text-align: center;
}

.product-actions {
    display: flex;
    gap: 15px; /* Khoảng cách giữa 2 nút */
}

/* Style chung cho cả 2 nút */
.product-actions button {
    flex-grow: 1; /* Hai nút sẽ có chiều rộng bằng nhau */
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Style riêng cho nút "Thêm vào giỏ" - nút phụ */
.btn-add-to-cart {
    background-color: var(--white-color);
    color: var(--primary-color);
}
.btn-add-to-cart:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

/* Style riêng cho nút "Mua ngay" - nút chính */
.btn-buy-now {
    background-color: var(--primary-color);
    color: var(--white-color);
}
.btn-buy-now:hover {
    background-color: #a7125e; /* Màu hồng đậm hơn một chút */
    border-color: #a7125e;
}

/* === Coupon Ticket Styling === */
.coupon-section {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
}
.coupon-section label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}
.coupon-ticket-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.coupon-ticket {
    background-color: #fff;
    border: 1px dashed var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease-in-out;
}
.coupon-ticket:hover {
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.coupon-ticket.active {
    border-style: solid;
    background-color: var(--primary-color);
    color: white;
}
.coupon-ticket .coupon-value {
    font-size: 1rem;
    font-weight: bold;
}
.coupon-ticket .coupon-code {
    font-size: 0.8rem;
    margin-top: 3px;
}
.coupon-ticket.active .coupon-code strong {
    color: white;
}

/* === Account Page Styling === */
.account-layout {
    display: grid;
    grid-template-columns: 240px 1fr; /* Cột trái 240px, cột phải chiếm phần còn lại */
    gap: 30px;
    align-items: start;
}

/* Sidebar bên trái */
.account-sidebar {
    background-color: var(--light-gray-bg);
    padding: 20px;
    border-radius: 8px;
}
.account-user-info {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.account-user-info h4 {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}
.account-user-info p {
    font-weight: bold;
    color: var(--primary-color);
}
.account-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.account-nav a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
}
.account-nav a:hover {
    background-color: #e9ecef;
}
.account-nav li.active a {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Nội dung bên phải */
.account-content h2 {
    margin-top: 0;
}

/* Bảng lịch sử đơn hàng */
.orders-table-wrapper {
    overflow-x: auto; /* Giúp bảng cuộn ngang trên di động */
}
.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}
.orders-table th, .orders-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}
.orders-table thead {
    background-color: var(--light-gray-bg);
}
.action-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
}

/* Trạng thái khi không có đơn hàng */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--light-gray-bg);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

/* Responsive cho di động */
@media (max-width: 768px) {
    .account-layout {
        grid-template-columns: 1fr; /* Chuyển thành 1 cột */
    }
}

/* === Customer Order View Page === */
.order-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.order-view-header h1 {
    margin-bottom: 0;
    font-size: 1.8rem;
}
.back-link {
    text-decoration: none;
    color: var(--primary-color);
}

.order-detail-layout {
    display: grid;
    grid-template-columns: 1fr; /* Mặc định 1 cột cho di động */
    gap: 30px;
    align-items: start;
}
@media (min-width: 768px) {
    .order-detail-layout {
        grid-template-columns: 300px 1fr; /* 2 cột trên màn hình lớn */
    }
}

.order-summary-box, .order-items-box {
    background-color: var(--light-gray-bg);
    padding: 25px;
    border-radius: 8px;
}
.order-summary-box h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}
.order-summary-box p {
    margin-bottom: 0.5rem;
}
.order-summary-box hr {
    border: 0;
    border-top: 1px dashed var(--border-color);
    margin: 1.5rem 0;
}
.total-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}
.order-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
}
.order-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.order-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}
.order-item .item-info {
    flex-grow: 1;
}
.order-item .variation-info {
    color: #6c757d;
    display: block;
    margin-top: 3px;
}
.order-item .item-price {
    font-weight: bold;
}


/* === Khu vực mô tả chi tiết sản phẩm (với Xem thêm) === */
.product-full-description-wrapper {
    background-color: #f8f9fa;
    padding: 2.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.description-content {
    /* Mặc định giới hạn chiều cao */
    max-height: 300px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s ease-in-out;
}

/* Lớp phủ mờ ở cuối để tạo hiệu ứng "còn nữa" */
.description-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #f8f9fa);
    transition: opacity 0.3s;
    opacity: 1; /* Thêm dòng này */
}

/* Khi mở rộng, bỏ giới hạn chiều cao và lớp phủ */
.description-content.expanded {
    max-height: 10000px; /* Một giá trị đủ lớn */
}
.description-content.expanded::after {
    opacity: 0;
}

.description-content.no-overflow::after { /* Thêm class này */
    opacity: 0;
}

.toggle-description-btn {
    display: block;
    margin: 1.5rem auto 0;
    padding: 10px 25px;
    background-color: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    color: var(--primary-color);
}

/* === New Footer Styling === */
.main-footer {
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 3rem 0 1.5rem 0;
    margin-top: 3rem;
    border-top: 1px solid #dee2e6;
}
.footer-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding-bottom: 2rem;
    text-align: left;
}
@media (min-width: 768px) {
    .footer-layout {
        grid-template-columns: 2fr 1fr; /* Chia 2 cột trên desktop */
    }
}
.footer-column h4 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}
.footer-logo {
    max-height: 40px;
    margin-bottom: 1rem;
}
.footer-column p {
    margin-bottom: 1rem;
}
.footer-contact, .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-contact li, .footer-links li {
    margin-bottom: 0.8rem;
}
.footer-links a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--primary-color);
}
.footer-copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    font-size: 0.9rem;
}

/* === Social Media Icons in Footer === */
.footer-socials {
    margin-top: 1.5rem;
    display: flex;
    gap: 15px; /* Khoảng cách giữa các icon */
    align-items: center;
}
.footer-socials a {
    display: inline-block;
}
.footer-socials img {
    height: 30px; /* Chiều cao của icon */
    width: auto;
    transition: transform 0.2s;
}
.footer-socials img:hover {
    transform: scale(1.1);
}

/* File: assets/css/style.css (thêm vào cuối file) */

/* === Flash Sale Styling (Polished Version) === */

/* Vùng chứa có nền hồng nhạt full-width */
.flash-sale-container {
    background-color: #FFF0F5; /* Màu hồng nhạt (Lavender Blush) */
    padding: 2.5rem 0;
    margin-top: 2rem; /* Thêm margin để tách biệt với banner */
}

.flash-sale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 1.5rem;
}
.flash-sale-header h2 {
    color: var(--primary-color);
    margin: 0;
    border-bottom: none; /* Bỏ gạch chân mặc định của h2 */
}
.countdown-timer {
    background-color: white;
    color: #333;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.countdown-timer span {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Vùng sản phẩm có nền trắng, bo góc */
.flash-sale-grid {
    background-color: var(--white-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.product-card .sale-price {
    color: #d0021b;
    font-weight: bold;
    font-size: 1.1rem;
}
.product-card .original-price {
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: 10px;
}

/* === Standalone Flash Sale Page Styling === */
.flash-sale-header {
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

/* === Sửa lỗi co chữ trên di động cho Flash Sale === */
@media (max-width: 480px) {
    .flash-sale-grid {
        /* Giảm khoảng đệm trên màn hình nhỏ hơn 480px */
        padding: 1rem;
    }
}

/* === Vô hiệu hóa nút phân loại khi hết hàng === */
.variation-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa !important; /* Ghi đè lên các style active */
    color: #6c757d !important;
    border-color: #dee2e6 !important;
}

/* Thêm hiệu ứng gạch ngang qua chữ */
.variation-btn.disabled span {
    text-decoration: line-through;
}

/* Ngăn chặn tương tác với nút đã bị vô hiệu hóa */
.variation-btn.disabled {
    pointer-events: none;
}

/* === Floating Action Buttons (Call & Zalo) === */
.floating-buttons {
    position: fixed; /* Giúp các nút luôn nổi trên màn hình */
    bottom: 20px;
    right: 20px;
    z-index: 999; /* Đảm bảo nó nằm trên các nội dung khác */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Khoảng cách giữa 2 nút */
}

@keyframes pulse {
0% {
transform: scale(1);
}
100% {
transform: scale(1.1);
}
}

.phone-button, .zalo-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: pulse 1.5s infinite alternate;
}

.phone-button a, .zalo-button a {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-button {
    background-color: #e4405f; /* Màu hồng đậm */
}
.zalo-button {
    background-color: #0068ff; /* Màu xanh của Zalo */
}

.phone-button:hover, .zalo-button:hover {
    transform: scale(1.1); /* Hiệu ứng phóng to khi di chuột qua */
}

/* Style cho icon bên trong */
.phone-button svg {
    color: white;
}
.zalo-button img {
    width: 36px;
    height: 36px;
}

/* === Blog/Post Styling === */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.post-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.post-card .post-image-link {
    display: block;
}
.post-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}
.post-card:hover img {
    transform: scale(1.05);
}
.post-content {
    padding: 15px;
    flex-grow: 1;
}
.post-content h3 {
    font-size: 1.1rem;
    margin: 10px 0 0 0;
}
.post-content h3 a {
    text-decoration: none;
    color: var(--text-color);
}
.post-content h3 a:hover {
    color: var(--primary-color);
}
.post-date {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

/* === Tinh chỉnh Bài viết Nổi bật trên Trang chủ === */

/* Ghi đè lại grid thành flex để xếp hàng ngang */
.recent-posts-container .post-grid {
    display: flex;
    overflow-x: auto; /* Cho phép cuộn ngang nếu có nhiều bài viết */
    padding-bottom: 20px; /* Thêm khoảng đệm cho thanh cuộn */
    grid-template-columns: unset; /* Xóa bỏ cài đặt grid cũ */
    gap: 20px;
}

/* Ẩn thanh cuộn trên một số trình duyệt cho đẹp hơn */
.recent-posts-container .post-grid::-webkit-scrollbar {
    height: 8px;
}
.recent-posts-container .post-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Đặt chiều rộng cố định cho mỗi bài viết trong hàng ngang */
.recent-posts-container .post-card {
    flex: 0 0 280px; /* Không co, không giãn, chiều rộng cơ sở 280px */
    width: 280px;
}

/* Tinh chỉnh lại ảnh và tiêu đề cho gọn hơn */
.recent-posts-container .post-card img {
    height: 150px;
}
.recent-posts-container .post-content h3 {
    font-size: 1rem;
    height: 42px; /* Giới hạn chiều cao cho 2 dòng */
    overflow: hidden;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* === Bố cục Dọc cho Trang Blog chính === */

/* Chỉ áp dụng cho .post-grid bên trong .blog-list-page */
.blog-list-page .post-grid {
    display: grid;
    grid-template-columns: 1fr; /* Luôn là 1 cột */
    gap: 30px;
}

.blog-list-page .post-card {
    display: flex; /* Sắp xếp nội dung và ảnh theo hàng ngang */
    flex-direction: row;
    align-items: stretch;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: box-shadow 0.3s;
}

.blog-list-page .post-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.blog-list-page .post-content {
    flex: 1; /* Phần nội dung chiếm hết không gian còn lại */
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-list-page .post-image-link {
    flex-basis: 300px; /* Đặt chiều rộng cố định cho ảnh */
    flex-shrink: 0; /* Ngăn ảnh bị co lại */
}

.blog-list-page .post-card img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* Responsive cho di động: chuyển về layout dọc bình thường */
@media (max-width: 768px) {
    .blog-list-page .post-card {
        flex-direction: column; /* Xếp ảnh lên trên, nội dung xuống dưới */
    }
    .blog-list-page .post-image-link {
        flex-basis: 200px; /* Đặt lại chiều cao cho ảnh */
    }
}

/* === Post Detail Page Styling === */

.post-container {
    max-width: 800px; /* Giới hạn chiều rộng nội dung để dễ đọc */
    margin: 2rem auto;
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.post-header h1 {
    font-size: 2.5rem;
    line-height: 1.3;
    color: #222;
}

.post-meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 1rem;
}

.post-featured-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.post-body {
    font-size: 1.1rem; /* Tăng kích thước chữ cho dễ đọc */
    line-height: 1.8; /* Tăng khoảng cách dòng */
    color: #333;
}

/* Định dạng các thẻ HTML do TinyMCE tạo ra */
.post-body p {
    margin-bottom: 1.5em;
}
.post-body h2, .post-body h3 {
    margin-top: 2.5em;
    margin-bottom: 1em;
}
.post-body ul, .post-body ol {
    margin-left: 2em;
    margin-bottom: 1.5em;
}
.post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5em;
    margin: 2em 0;
    font-style: italic;
    color: #555;
}
.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Khu vực bài viết liên quan */
.related-posts-section {
    background-color: #f8f9fa;
    padding: 3rem 0;
    margin-top: 3rem;
    border-top: 1px solid #eee;
}

/* === Nút Quay lại Đầu trang === */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    left: 20px; /* Đặt ở góc dưới bên trái để tránh vướng các nút khác */
    z-index: 998;
    
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5); /* Nền đen mờ */
    color: white;
    border-radius: 50%;
    
    display: none; /* Mặc định ẩn, JS sẽ điều khiển */
    justify-content: center;
    align-items: center;
    
    text-decoration: none;
    
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.back-to-top-btn.show {
    display: flex;
    opacity: 1;
}

.back-to-top-btn:hover {
    background-color: var(--primary-color); /* Đổi sang màu hồng khi di chuột qua */
    transform: translateY(-5px); /* Hiệu ứng nhích lên */
}

/* === Sale Badge Styling === */

/* Thẻ cha cần có position: relative để định vị mác con */
.product-card {
    position: relative;
    overflow: hidden; /* Giấu phần thừa của mác */
}

.sale-badge {
    position: absolute;
    top: 12px;
    left: -35px; /* Đẩy mác ra ngoài một chút để tạo hiệu ứng đẹp */
    
    background-color: var(--primary-color);
    color: white;
    
    padding: 5px 35px;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    
    transform: rotate(-45deg); /* Xoay nghiêng 45 độ */
    
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1; /* Đảm bảo mác nằm trên ảnh */
}

/* File: assets/css/style.css (thêm vào cuối file) */

/* === 404 Error Page Styling === */
.error-page-container {
    text-align: center;
    padding: 4rem 1rem;
}

.error-404-visual svg {
    color: var(--primary-color);
    opacity: 0.5;
}

.error-page-container h1 {
    font-size: 6rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

.error-page-container h2 {
    font-size: 1.8rem;
    color: #333;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.error-page-container p {
    color: #6c757d;
    margin-bottom: 2.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions .btn-primary {
    font-size: 1rem;
    padding: 12px 30px;
}

/* === Cải thiện Font chữ và Bố cục cho Bài viết === */

.post-body {
    font-size: 1.1rem; /* Tăng kích thước chữ một chút cho dễ đọc */
    line-height: 1.8;  /* Tăng khoảng cách giữa các dòng */
    color: #333;      /* Màu chữ đậm hơn một chút */
}

/* Định dạng các thẻ HTML do trình soạn thảo tạo ra */
.post-body p {
    margin-bottom: 1.5em;
}
.post-body h2, 
.post-body h3, 
.post-body h4 {
    margin-top: 2.5em;
    margin-bottom: 1em;
    line-height: 1.4;
    font-weight: 700; /* In đậm các tiêu đề phụ */
    color: #222;
}
.post-body ul, 
.post-body ol {
    margin-left: 2em;
    margin-bottom: 1.5em;
    padding-left: 1em;
}
.post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5em;
    margin: 2em 0;
    font-style: italic;
    color: #555;
}
.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem auto; /* Căn giữa ảnh và tạo khoảng cách */
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* === Trang trí Tiêu đề Bộ sưu tập === */

/* Tiêu đề chính */
.collection-title {
    display: flex;          /* Dùng flexbox để căn chỉnh */
    align-items: center;    /* Căn giữa các mục theo chiều dọc */
    text-align: center;
    margin: 3rem 0 2rem 0;  /* Tăng khoảng cách trên dưới */
    color: #555;
    border: none;           /* Bỏ gạch chân mặc định của h2 */
}

/* Hai đường kẻ trang trí */
.collection-title::before,
.collection-title::after {
    content: '';
    flex-grow: 1;           /* Tự động lấp đầy không gian trống */
    background-color: #ddd; /* Màu của đường kẻ */
    height: 1px;            /* Độ dày của đường kẻ */
}

/* Phần chữ bên trong */
.collection-title span {
     background-color: var(--white-color); /* Nền trắng để nổi bật */
    color: var(--primary-color);
    border: 2px dashed var(--primary-color); /* Viền đứt khúc */
    padding: 10px 25px;
    border-radius: 8px; /* Bo góc nhẹ */
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
    
    position: relative; /* Nâng nó lên trên các đường kẻ */
    z-index: 1;
}