

/* ==========================================================================
   1. KHỐI TRANG CHỦ / DANH SÁCH SẢN PHẨM (PRODUCT LIST)
   ========================================================================== */
.product-wrapper {
    width: 100%;
    padding: 30px 0;
    box-sizing: border-box;
}

/* Lưới sản phẩm thông minh - Chia đều 4 cột bằng chằn chặn */
.product-flex-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0 auto;
    width: 100%;
}



/* CỤM BADGES TRẠNG THÁI TRÊN ẢNH */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 6px;
    color: #ffffff;
    width: max-content;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.5px;
}

.badge-hot { background: linear-gradient(135deg, #f97316, #ef4444); }
.badge-new { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.badge-discount { background: linear-gradient(135deg, #22c55e, #15803d); }

/* KHỐI THÔNG TIN CHỮ (TÊN & GIÁ) */
.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Ép cố định chiều cao tên sản phẩm & Tạo hiệu ứng gạch chân slide */

/* ==========================================================================
   2. KHỐI TRANG CHI TIẾT SẢN PHẨM (PRODUCT DETAIL)
   ========================================================================== */
.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 15px;
}

.detail-flex {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Chia đôi màn hình cân đối tỉ lệ 50-50 */
    gap: 50px;
}

/* Khối bên trái: Hình ảnh chi tiết */
.detail-image-box {
    width: 100%;
}

.detail-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.detail-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Khối bên phải: Cụm thông tin & Đặt mua */
.detail-info-box {
    display: flex;
    flex-direction: column;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.detail-price {
    font-size: 26px;
    font-weight: 700;
    color: #ff4d4f;
    margin-bottom: 25px;
    background: #fff5f5;
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-block;
    width: max-content;
}

.attribute-group {
    margin-bottom: 24px;
}

.attribute-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
    display: block;
}

/* Thiết kế lại ô Swatch bấm chọn Màu/Size */
.variant-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.swatch-item {
    position: relative;
}

.swatch-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

.swatch-label {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.2s ease;
    user-select: none;
}

.swatch-label:hover {
    border-color: #4f46e5;
    color: #4f46e5;
}

/* Trạng thái Variant biến thể được chọn */
.swatch-item input[type="radio"]:checked + .swatch-label {
    border-color: #4f46e5;
    background-color: #f5f3ff;
    color: #4f46e5;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

/* Khối nhập số lượng */
.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-input {
    width: 75px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    outline: none;
}

/* Cụm 2 nút bấm Giỏ Hàng & Mua Ngay */
.detail-actions {
    display: flex;
    gap: 16px;
    margin-top: auto; /* Đẩy cụm nút bám cố định đáy hộp thông tin chi tiết */
    padding-top: 30px;
}

.btn-detail {
    flex: 1;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-detail-cart {
    background-color: #ffffff;
    color: #4f46e5;
    border: 2px solid #4f46e5;
}

.btn-detail-cart:hover {
    background-color: #f5f3ff;
}

.btn-detail-buy {
    background-color: #ff4d4f;
    color: #ffffff;
}

.btn-detail-buy:hover {
    background-color: #e03e3e;
}

.section-header {
    display: flex;
    justify-content: space-between; /* Đẩy tiêu đề sang trái, nút xem thêm sang phải */
    align-items: flex-end;         /* Căn chân chữ 2 bên thẳng hàng nhau */
    padding-bottom: 15px;
}

/* Khối chữ bên trái */
.title-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-subtitle {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #4f46e5; /* Màu tím thương hiệu làm điểm nhấn nhỏ */
    letter-spacing: 1px;
}

.section-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a; /* Màu xám đen quý phái */
    letter-spacing: -0.5px;
}

/* Nút "Xem tất cả" bên phải */
.view-all-link {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 4px;
}

.view-all-link span {
    transition: transform 0.2s ease;
}

/* Hiệu ứng khi Hover vào nút Xem tất cả */
.view-all-link:hover {
    color: #4f46e5; /* Đổi chữ sang màu tím */
}

.view-all-link:hover span {
    transform: translateX(4px); /* Mũi tên tự động dịch sang phải sinh động */
}

/* ==========================================================================
   3. HỆ THỐNG ĐÁP ỨNG ĐA MÀN HÌNH (RESPONSIVE CHUẨN ĐẸP)
   ========================================================================== */

/* Màn hình Máy tính bảng / Tablet (Dưới 992px) */
@media (max-width: 992px) {
    .product-flex-container {
        grid-template-columns: repeat(3, 1fr); /* Thu gọn còn 3 sản phẩm một hàng */
        gap: 15px;
    }
    
    .detail-flex {
        grid-template-columns: 1fr; /* Trang chi tiết chuyển về 1 cột dọc */
        gap: 30px;
    }
}

/* Màn hình Điện thoại di động nhỏ gọn (Dưới 640px) */
@media (max-width: 640px) {
    .product-flex-container {
        grid-template-columns: repeat(2, 1fr); /* Tiêu chuẩn TMĐT hiển thị 2 cột cực đẹp */
        gap: 12px;
        padding: 0;
    }

    .product-info {
        padding: 12px;
    }

    .price-current,
    .product-price div:not(.price-old) {
        font-size: 15px;
    }

    .price-old {
        font-size: 12px;
    }

    .badge {
        font-size: 10px;
        padding: 3px 6px;
    }

    .detail-title {
        font-size: 22px;
    }

    .detail-actions {
        flex-direction: column; /* Hai nút lớn chuyển sang xếp chồng hàng dọc */
        gap: 12px;
    }

    .btn-detail {
        width: 100%;
        padding: 14px;
    }
        .section-header {
        margin-bottom: 18px;
        padding-bottom: 10px;
    }
    
    .section-title {
        font-size: 20px; /* Thu nhỏ tiêu đề trên điện thoại tránh chiếm diện tích */
    }
    
    .section-subtitle {
        font-size: 10px;
    }
    
    .view-all-link {
        font-size: 13px;
    }
}


/* ==========================================================================
   THIẾT KẾ ĐẶC BIỆT RIÊNG CHO TIÊU ĐỀ NGÀNH HÀNG (CATEGORY HEADER)
   ========================================================================== */

/* Khung bọc: Biến đường kẻ đáy thành đường xuyên tâm nằm chính giữa dòng */
.category-header-style {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Căn giữa trục dọc */
    margin-bottom: 20px;
    margin-top: 30px;
    border-bottom: none; /* XÓA BỎ ĐƯỜNG KẺ ĐÁY CỦA SẢN PHẨM BÁN CHẠY */
    position: relative;
    width: 100%;
}

/* Tạo đường kẻ ngang hiện đại xuyên qua hông tiêu đề */
.category-header-style::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 1px;
    background-color: #e2e8f0; /* Đường kẻ mảnh sang trọng */
    z-index: 1;
}

/* Đẩy chữ tên ngành hàng và nút Xem tất cả nổi lên trên đường kẻ */
.category-header-style .title-left,
.category-header-style .view-all-link {
    position: relative;
    z-index: 2;
}

/* BIẾN TÊN NGÀNH HÀNG THÀNH DẠNG KHỐI TAG CAPSULE SANG TRỌNG */
.category-header-style .section-title {
    font-size: 16px;            /* Hạ size chữ nhỏ hơn Sản phẩm bán chạy (24px) */
    font-weight: 700;
    color: #4f46e5;             /* Đổi sang màu tím thương hiệu làm điểm nhấn */
    text-transform: uppercase;  /* Viết hoa chữ cái quý phái */
    letter-spacing: 0.5px;
    
    background-color: #f5f3ff;  /* Nền tím mờ nhẹ */
    padding: 8px 20px;          /* Tạo khoảng trống bo góc xung quanh chữ */
    border-radius: 30px;        /* Bo tròn hoàn hảo thành hình viên thuốc */
    border: 1px solid #e0e7ff;  /* Viền mảnh đồng bộ */
    padding-right: 25px;        /* Chừa khoảng trống bên phải cách đường kẻ */
}

/* TINH CHỈNH NÚT XEM TẤT CẢ CHO TIÊU ĐỀ NGÀNH HÀNG */
.category-header-style .view-all-link {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    padding-left: 20px;         /* Tạo khoảng trắng che đường kẻ bên trái nút */
    text-transform: none;
}

.category-header-style .view-all-link span {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Hiệu ứng tương tác riêng khi hover nút của ngành hàng */
.category-header-style .view-all-link:hover {
    color: #4f46e5;
}
.category-header-style .view-all-link:hover span {
    transform: translateX(3px);
}
.pagination{
    display:flex;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    margin:40px 0;
}

.page-item{
    width:42px;
    height:42px;

    display:flex;
    justify-content:center;
    align-items:center;

    text-align:center;
    line-height:1;

    border:1px solid #ddd;
    border-radius:8px;

    background:#fff;
    color:#333;
    text-decoration:none;

    transition:.25s;
}

.page-item:hover{

    color:#fff;
    background:#0d6efd;
    border-color:#0d6efd;

}

.page-item.active{

    color:#fff;
    background:#0d6efd;
    border-color:#0d6efd;

    font-weight:bold;
}

.page-item.disabled{

    color:#aaa;
    background:#f7f7f7;
    border-color:#eee;

    cursor:not-allowed;
}

.page-item i{

    font-size:13px;

}

.search-form{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:30px;
}

.search-form input,
.search-form select{
    height:42px;
    padding:0 12px;
    border:1px solid #ddd;
    border-radius:6px;
    width: 100%;
}

.search-form button{
    height:42px;
    padding:0 20px;
    border:none;
    border-radius:6px;
    background:#0d6efd;
    color:#fff;
    cursor:pointer;
}

.search-form button:hover{
    opacity:.9;
}

@media(max-width:768px){

    .pagination{

        gap:6px;

    }

    .page-item{

        width:36px;
        height:36px;

        font-size:14px;

    }

}

/* ==========================================================================
   TỐI ƯU RESPONSIVE TRÊN MOBILE
   ========================================================================== */
@media (max-width: 640px) {
    .category-header-style {
        margin-bottom: 20px;
    }
    /* Ẩn đường kẻ ngang trên mobile để giao diện đỡ rối mắt */
    .category-header-style::before {
        display: none;
    }
    .category-header-style .section-title {
        font-size: 14px;
        padding: 6px 14px;
    }
    .category-header-style .view-all-link {
        font-size: 12px;
    }
    .search-form input{
        width: calc(50% - (12px / 2)); 
    }
}
/* ==========================================================================
   1. CẤU TRÚC BỐ CỤC 2 CỘT (LAYOUT)
   ========================================================================== */
/* ==========================================================================
   1. CẤU TRÚC CHIA LƯỚI HAI CỘT (LAYOUT GRID)
   ========================================================================== */
.category-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 20px;
}

.category-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-box {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 20px;
}

.sidebar-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #333333;
    color: #333333;
}

.category-main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.pagination-wrapper {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   2. BỘ LỌC TÌM KIẾM DỌC (VERTICAL SEARCH & SLIDER & CHECKBOX)
   ========================================================================== */


/* ==========================================================================
   3. GIAO DIỆN MENU HỆ THỐNG ĐA CẤP (SIDEBAR MENU)
   ========================================================================== */
.sidebar-category-list { list-style: none; padding: 0; margin: 0; }
.category-product-item { position: relative; border-bottom: 1px dashed #eeeeee; }
.category-product-item:last-child { border-bottom: none; }

.category-link-wrapper { display: flex; justify-content: space-between; align-items: center; }
.category-link { flex-grow: 1; display: block; padding: 10px 0; color: #333333; text-decoration: none; font-weight: 500; font-size: 14.5px; transition: all 0.2s; }
.category-link:hover { color: #ff5722; padding-left: 4px; }

.category-product-item.active > .category-link-wrapper .category-link { color: #ff5722; font-weight: bold; }

.toggle-submenu-btn { padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.arrow-icon { font-size: 10px; color: #999999; transition: transform 0.3s ease; }

/* Xoay mũi tên khi menu mở (.open) */
.category-product-item.open > .category-link-wrapper .arrow-icon { transform: rotate(90deg); }

/* Đệ quy thụt lề cấp con */
.category-product-item .sub-category-list { list-style: none; padding-left: 15px; }
.sub-category-list .category-link { font-size: 13.5px; font-weight: normal; padding: 7px 0; color: #555555; }

/* ==========================================================================
   4. ĐÁP ỨNG DI ĐỘNG (RESPONSIVE)
   ========================================================================== */
@media (max-width: 991px) {
    .category-layout { grid-template-columns: 1fr; gap: 20px; }
    .category-sidebar { order: 1; }
    .category-main-content { order: 2; }
}
.price-range-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fafafa;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #eeeeee;
    margin-top: 10px;
}

.price-input-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    padding: 4px 8px;
    width: 45%;
}

.currency-label {
    font-size: 12px;
    color: #888888;
    margin-right: 4px;
    user-select: none;
}

/* Định dạng riêng ô gõ giá tiền */
.price-filter-input {
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    height: auto !important;
    font-size: 13px !important;
    font-weight: 600;
    color: #333333;
    text-align: right;
    outline: none;
    box-shadow: none !important;
}

.price-range-display .range-divider {
    color: #999999;
    font-weight: bold;
}




