.warehouse-banner {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100vh; /* chiếm toàn bộ chiều cao viewport */
    max-height: none;
}

/* Buộc item và ảnh chiếm 100% chiều cao container */
.warehouse-banner .carousel-item,
.warehouse-banner .carousel-item img {
    width: 100%;
    height: 100% !important; /* phủ đầy chiều cao container */
}

/* Ảnh phủ toàn bộ vùng bằng object-fit */
.warehouse-banner .carousel-item img {
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
    background-color: #f5f7fa;
}

@media (max-width: 992px) {
    .warehouse-banner { height: 100%; }
}

@media (max-width: 576px) {
    .warehouse-banner { height: 100%; }
}

/* Kiểu cho thanh bên cửa hàng */
.store-sidebar .sidebar-widget {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.store-sidebar .widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.category-list .category-item {
    display: block;
    padding: 0.5rem 0;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.category-list .category-item:hover {
    color: #007bff;
    padding-left: 0.5rem;
}

.category-list .category-item.active {
    color: #007bff;
    font-weight: 600;
}

/* Kiểu mới cho nhóm danh sách danh mục (UL/LI) */
.category-list-group li + li { border-top: 1px solid #f1f3f5; }
.category-list-group .category-item {
    padding: 0.55rem 0.25rem;
    font-size: 0.88rem;
    position: relative;
}
.category-list-group .category-item:hover {
    background: #f8fafd;
    padding-left: 0.4rem;
    text-decoration: none;
}
.category-list-group .category-item.active {
    background: #eef6ff;
    font-weight: 600;
    color: #0d6efd;
    border-left: 3px solid #0d6efd;
    padding-left: 0.5rem;
}
.category-list-group .badge { font-size: 0.65rem; }

/* Collapsible category widget */
/* Widget danh mục thu gọn */
.category-collapsible { padding: 1rem 1.1rem 0.85rem; }
.category-collapsible-header { cursor: pointer; user-select: none; padding: 0.25rem 0; }
.category-collapsible-header:hover { color:#0d6efd; }
.category-collapsible.collapsed .toggle-icon { transform: rotate(-90deg); }
.category-collapsible .category-collapsible-body { max-height:0; overflow:hidden; transition:max-height .4s ease, opacity .35s ease; opacity:0; }
.category-collapsible.expanded .category-collapsible-body { max-height:520px; opacity:1; }
.category-collapsible .category-list { margin-top:0.4rem; }
.category-collapsible .category-list-group .category-item { border-radius:4px; }
.category-collapsible .category-list-group .category-item.active { box-shadow:0 0 0 1px #0d6efd inset; }

/* ===== Bộ lọc nâng cao V2 - Cải tiến giao diện ===== */
.advanced-filters-v2 { background: linear-gradient(145deg,#ffffff 0%, #f9fbfd 100%); border:1px solid #e9eef3; position:relative; }
.advanced-filters-v2 .advanced-filters-title { border-bottom: none; padding-bottom: 0; margin-bottom: .75rem; font-size: 0.95rem; letter-spacing: .3px; display:flex; align-items:center; gap:.5rem; }
.advanced-filters-v2 .advanced-filters-title:before { content:""; width:6px; height:18px; background:#0d6efd; border-radius:3px; display:inline-block; }
.advanced-filters-v2 .filter-section-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .6px; font-weight:600; color:#5b6b7b; }
.advanced-filters-v2 .price-range-inline { background:#f1f5f9; padding:.55rem .6rem; border-radius:8px; border:1px solid #e2e8f0; }
.advanced-filters-v2 .price-range-inline .price-input-wrapper { display:flex; align-items:center; gap:.35rem; background:#fff; padding:.3rem .55rem; border:1px solid #d8e2ec; border-radius:6px; flex:1 1 0; min-width:130px; }
.advanced-filters-v2 .price-range-inline .price-input-wrapper:focus-within { border-color:#0d6efd; box-shadow:0 0 0 2px rgba(13,110,253,.15); }
.advanced-filters-v2 .price-range-inline .prefix { font-size:.68rem; font-weight:600; text-transform:uppercase; color:#6c7a86; }
.advanced-filters-v2 .price-range-inline input { border:none; box-shadow:none !important; padding:.15rem .25rem; height:32px; font-size:.8rem; width:100%; flex:1 1 auto; text-align:right; font-family:monospace; letter-spacing:.5px; }
.advanced-filters-v2 .price-range-inline input:focus { outline:none; }
.advanced-filters-v2 .price-range-inline .range-sep { font-size:.85rem; color:#6e7b87; font-weight:600; }
.advanced-filters-v2 .helper-text { font-size:.65rem; letter-spacing:.3px; }

.advanced-filters-v2 .advanced-filters-list { display:grid; gap:.45rem; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item { background:#f8fafc; padding:.4rem .55rem; border:1px solid #e3e9ef; border-radius:8px; display:flex; align-items:center; transition:.25s; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item:hover { background:#eef6ff; border-color:#c9dff7; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item .form-check-input { cursor:pointer; width:2.3rem; height:1.05rem; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item .form-check-input:checked { background-color:#0d6efd; border-color:#0d6efd; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item .form-check-label { cursor:pointer; font-size:.78rem; font-weight:600; color:#374553; padding-left:.35rem; display:flex; align-items:center; gap:.35rem; }
/* Sửa: tránh margin trái âm của Bootstrap .form-switch làm nút bật bị tràn */
.advanced-filters-v2 .advanced-filters-list .filter-switch-item.form-switch { padding-left:.55rem; position:relative; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item.form-switch .form-check-input { margin-left:0; margin-right:.55rem; flex-shrink:0; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item.form-switch .form-check-label { padding-left:0; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item.form-switch { display:flex; align-items:center; min-height:36px; }
.advanced-filters-v2 .advanced-filters-list .filter-switch-item.form-switch .form-check-input { top:0; }

.advanced-filters-v2 .filter-switches-wrapper { background:#fff; border:1px dashed #d7dee5; padding:.7rem .75rem .55rem; border-radius:10px; position:relative; }
.advanced-filters-v2 .filter-switches-wrapper:before { content:""; position:absolute; inset:0; border-radius:10px; background:linear-gradient(135deg, rgba(13,110,253,0.08), rgba(255,255,255,0)); pointer-events:none; }

.advanced-filters-v2 #active-adv-filter-count { font-size:.55rem; letter-spacing:.5px; border:1px solid #d0dae4; }

.advanced-filters-v2 .filter-actions { margin-top:.85rem; }
.advanced-filters-v2 .filter-actions .btn { font-size:.7rem; letter-spacing:.5px; font-weight:600; }
.advanced-filters-v2 .filter-actions .btn:hover { transform:translateY(-1px); }

/* Xếp các input giá dọc (theo yêu cầu) */
.advanced-filters-v2 .price-range-inline { display:flex; flex-direction:column !important; align-items:stretch !important; gap:.5rem !important; }
.advanced-filters-v2 .price-range-inline .range-sep { display:none !important; }
.advanced-filters-v2 .price-range-inline .price-input-wrapper { min-width:100% !important; }

@media (max-width: 576px) {
    .advanced-filters-v2 .price-range-inline { flex-direction:column; align-items:stretch; }
    .advanced-filters-v2 .price-range-inline .range-sep { display:none; }
    .advanced-filters-v2 .price-range-inline .price-input-wrapper { width:100%; }
}

/* Tùy chọn sắp xếp */
.sort-options {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sort-select {
    width: auto;
    min-width: 200px;
}

/* ================= Hộp tìm kiếm sản phẩm hiện đại ================= */
/* Cập nhật kiểu cho nhóm tìm kiếm sản phẩm */
.store-search-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: .35rem;
    background: linear-gradient(145deg,#ffffff 0%, #f4f8fb 100%);
    border: 1px solid #d9e2ec;
    border-radius: 14px !important;
    padding: .25rem .55rem .25rem .65rem;
    box-shadow: 0 1px 2px rgba(219, 216, 216, 0.05), 0 0 0 0 rgba(238, 239, 241, 0);
    transition: box-shadow .25s ease, border-color .25s ease, background .3s ease;
    max-width: 480px;
}
.store-search-group:before { /* viền trong mờ nhẹ để nhấn */
    content:"";
    position:absolute; inset:0; border-radius:14px; pointer-events:none;
    background:linear-gradient(120deg,rgba(255,255,255,.6),rgba(246, 241, 241, 0.79));
    mix-blend-mode:overlay; opacity:.6;
}
.store-search-group:focus-within {
    border-color:#0d6efd;
    box-shadow:0 0 0 3px rgba(13,110,253,.15), 0 3px 10px rgba(0,0,0,0.08);
    background:linear-gradient(145deg,#ffffff 0%, #eef6ff 100%);
}
/* Loại bỏ viền mặc định của input-group */
.store-search-group .input-group-text {
    background:transparent !important;
    border:none !important;
    padding:.25rem .25rem .25rem 0 !important;
    color:#6c7a86;
    font-size:.85rem;
}
.store-search-group .input-group-text i { transition: color .25s ease, transform .35s ease; }
.store-search-group:focus-within .input-group-text i { color:#0d6efd !important; transform:scale(1.05); }

.store-search-group .form-control {
    border:none !important;
    background:transparent !important;
    box-shadow:none !important;
    font-size:.85rem;
    padding:.4rem .25rem .35rem .15rem;
    letter-spacing:.2px;
    color:#2f3f4f;
}
.store-search-group .form-control::placeholder {
    color:#96a4b2;
    font-style:italic;
    opacity:.9;
}
.store-search-group .form-control:focus { outline:none !important; }

/* Clear button restyle */
#clear-search.btn, .store-search-group #clear-search {
    border:none !important;
    background:transparent !important;
    color:#8a99a8 !important;
    padding:.3rem .4rem !important;
    line-height:1;
    display:none; /* shown dynamically */
    box-shadow:none !important;
    transition: color .2s ease, background .25s ease;
}
.store-search-group #clear-search:hover { color:#dc3545 !important; background:rgba(220,53,69,.08) !important; border-radius:6px; }
.store-search-group #clear-search:active { transform:scale(.92); }

/* Shortcut hint (Ctrl+F) as a subtle floating badge inside placeholder area */
.store-search-group[data-hint]:after {
    content:attr(data-hint);
    position:absolute;
    top:50%; right:8px;
    transform:translateY(-50%);
    font-size:.6rem;
    letter-spacing:.5px;
    background:#f1f5f9;
    color:#5c6b78;
    padding:.15rem .4rem .18rem;
    border-radius:20px;
    font-weight:600;
    pointer-events:none;
    opacity:.85;
    transition:opacity .25s ease, transform .25s ease;
}
.store-search-group:focus-within[data-hint]:after { opacity:0; transform:translateY(-50%) scale(.85); }

/* Mobile adjustments */
@media (max-width: 576px) {
    .store-search-group { max-width:100%; border-radius:10px !important; padding:.2rem .5rem; }
    .store-search-group .form-control { font-size:.8rem; }
    .store-search-group[data-hint]:after { display:none; }
}

/* Darker system prefers-color-scheme support (optional) */
@media (prefers-color-scheme: dark) {
    .store-search-group {
        background:linear-gradient(145deg,#1f242a,#2a3138);
        border-color:#3a4652;
        box-shadow:0 1px 2px rgba(0,0,0,.6);
    }
    .store-search-group:focus-within { background:linear-gradient(145deg,#242c33,#31404d); }
    .store-search-group .form-control { color:#e2e8ef; }
    .store-search-group .form-control::placeholder { color:#788995; }
    .store-search-group #clear-search { color:#9aa8b4 !important; }
    .store-search-group #clear-search:hover { background:rgba(220,53,69,.15) !important; }
    .store-search-group[data-hint]:after { background:#2f3942; color:#91a2b1; }
}

/* High contrast / accessibility tweak: if user tabs, ensure clear focus ring */
@media (hover: none) {
    .store-search-group:focus-within { box-shadow:0 0 0 3px rgba(13,110,253,.35); }
}

/* Product name with line clamp for all breakpoints */
.product-card .product-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    height: 220px; /* further reduced */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 1px solid #f3f4f6;
}

.product-card .product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Make entire product card clickable */
.product-link-wrapper { display:block; cursor:pointer; }
.product-link-wrapper:hover .product-name { color:#0d6efd; }
.product-link-wrapper .card-footer { display:none !important; }


/* Discount % badge (top-right) */
.discount-percent-badge { position:absolute; top:6px; right:6px; background:linear-gradient(135deg,#ff3d2f,#ff7a18); color:#fff; font-size:.62rem; font-weight:700; padding:4px 6px 3px; border-radius:6px; line-height:1; box-shadow:0 2px 6px rgba(0,0,0,.18); letter-spacing:.5px; }
@media (max-width:576px){
    .discount-percent-badge { font-size:.55rem; padding:3px 5px 2px; }
        /* flag badges removed */
}

/* Style cho logo khi làm ảnh sản phẩm mặc định */
.product-card img[src*="Logo1.png"] {
    background-color: #ffffff;
    padding: 30px;
    object-fit: contain !important;
}

.product-card .product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card .product-badges .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-card .product-info {
    padding: 0.28rem 0.3rem 0.3rem; /* tighter */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    gap: .2rem;
}

/* Replace margin-top:auto which pushed actions to the very bottom with a small gap */
.product-card .product-actions { margin-top: .25rem; }

.product-card .product-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.product-card .product-price .discount-price {
    font-weight: 700;
    white-space: nowrap; /* keep main price together */
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .product-price .original-price {
    color: #95a5a6;
    text-decoration: line-through;
    white-space: nowrap;
    flex-shrink: 0;
}

.product-card .discount-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e74c3c;
    margin-right: 0.5rem;
}

.product-card .original-price {
    font-size: 0.85rem;
    color: #95a5a6;
    text-decoration: line-through;
}

.product-card .product-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    padding: 0.25rem 0;
    border-top: 1px solid #f8f9fa;
    font-size: 0.72rem;
}

.product-card .product-stats .sold-count {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-card .product-stats .rating {
    color: #f39c12;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.rating-inline {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    color: #f39c12;
    font-weight: 600;
}

.rating-inline .fas.fa-star {
    color: #ffc107 !important;
    font-size: 0.8rem;
}

.rating-inline .rating-score {
    margin-left: 0.25rem;
    font-weight: 600;
    color: #333;
}

.rating-inline .review-count {
    color: #6c757d;
    font-size: 0.7rem;
    margin-left: 0.15rem;
}

.product-card .product-actions {
    margin-top: auto;
}

.product-card .product-actions .btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    transition: all 0.3s ease;
    text-transform: none;
}

.product-card .product-actions .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.product-card .product-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,123,255,0.4);
}

/* Card footer for "Xem chi tiết" button */
.product-card .card-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    margin: 0;
}

.product-card .card-footer .btn {
    font-size: 0.78rem; /* slightly smaller text */
    padding: 0.35rem 0.6rem; /* reduce vertical and horizontal padding */
    border-radius: 6px;
    line-height: 1;
}

.product-card .card-footer .btn i {
    font-size: 0.92rem; /* scale icon down */
    vertical-align: middle;
}

.product-card .card-footer .btn.btn-primary {
    padding: 0.35rem 0.6rem;
}

/* Tighter layout on very small screens */
@media (max-width: 576px) {
    .product-card .card-footer {
        padding: 0.45rem 0.6rem;
    }
    .product-card .card-footer .btn {
        font-size: 0.72rem;
        padding: 0.28rem 0.5rem;
    }
    .product-card .card-footer .btn i {
        font-size: 0.85rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-card .product-image {
        height: 180px;
    }
    
    .product-card .product-info {
        padding: 0.75rem;
    }
    
    .product-card .product-name {
        font-size: 0.82rem; /* smaller on mobile */
        min-height: 2.0rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.4;
    }
    
    .product-card .product-description {
        font-size: 0.75rem;
        min-height: 2rem;
    }
    
    .product-card .card-footer {
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile: place original (struck) price on the next line under discount price */
@media (max-width: 576px) {
    .product-price .discount-price,
    .product-price .original-price {
        display: block;
        width: 100%;
    }

    .product-price .original-price {
        margin-top: 0.18rem;
        font-size: 0.78rem;
        color: #95a5a6;
        text-decoration: line-through;
    }

    .product-price {
        line-height: 1.1;
    }
}

/* Platform Icons - Compact Variant for Mobile */
@media (max-width: 576px) {
    /* Force platform icons into a single compact horizontal row on phones - compacted further */
    .platform-icons .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0.35rem !important;
        overflow-x: auto !important;
        padding: 0 0.35rem !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        align-items: center;
        scroll-snap-type: x mandatory; /* snap for nicer swiping */
    }

    /* Ensure the bootstrap column wrappers don't force 50% width on mobile */
    .platform-icons .row > div[class*="col-"] {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .platform-icons .platform-item {
        min-width: 64px; /* smaller tile */
        padding: 0.25rem !important; /* less padding */
        border-radius: 6px;
        margin-bottom: 0 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #fff;
        box-shadow: 0 1px 6px rgba(0,0,0,0.06);
        scroll-snap-align: center;
    }

    .platform-icons .platform-item i {
        font-size: 1.1rem !important; /* reduce icon size further */
        margin-bottom: 0.25rem;
        line-height: 1;
    }

    .platform-icons .platform-item p {
        font-size: 0.65rem !important; /* smaller label */
        margin: 0;
        white-space: nowrap;
    }

    /* Slim scrollbar so it doesn't take much space but remains usable */
    .platform-icons .row::-webkit-scrollbar {
        height: 6px;
    }
    .platform-icons .row::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.12);
        border-radius: 6px;
    }
}

/* Make banner full-bleed across desktop width */
.warehouse-banner {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw; /* pull out of centered container */
    margin-right: -50vw;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    z-index: 0;
}

.warehouse-banner .carousel,
.warehouse-banner .carousel-inner,
.warehouse-banner .carousel-item {
    width: 100vw;
    max-width: 100vw;
}

/* Ensure images fill the viewport width and not constrained by parent */
.warehouse-banner .carousel-item img {
    width: 100vw !important;
    max-width: none !important;
    display: block;
}

/* Giới thiệu Kho Online */
.warehouse-intro {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.warehouse-intro .section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.warehouse-intro .intro-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

.warehouse-intro .tagline-box {
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.warehouse-intro .tagline-box:hover {
    transform: translateY(-5px);
}

/* Compact Platform Icons - reduce vertical spacing and padding */
.platform-icons {
    margin-top: 0.4rem !important; /* reduce space above section */
    margin-bottom: 0.4rem !important; /* reduce space below section */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.platform-icons h5 {
    margin-bottom: 0.5rem !important; /* tighten heading spacing */
    font-size: 0.95rem;
}
.platform-icons .row {
    gap: 0.25rem !important;
}
.platform-icons .platform-item {
    padding: 0.45rem !important; /* smaller padding */
    margin-bottom: 0.25rem !important; /* tighter vertical rhythm */
    min-width: 56px;
}

@media (max-width: 576px) {
    .platform-icons { margin-top: 0.3rem !important; margin-bottom: 0.3rem !important; }
    .platform-icons h5 { margin-bottom: 0.35rem !important; font-size: 0.9rem; }
    .platform-icons .platform-item { padding: 0.35rem !important; min-width: 48px; }
}

/* Extra tiny-screen override for very small devices */
@media (max-width: 360px) {
    .warehouse-intro .tagline-box {
        padding: 0.25rem 0.4rem !important;
        border-radius: 6px;
    }
    .warehouse-intro .tagline-box h4 {
        font-size: 0.78rem !important;
        gap: 0.15rem;
    }
    /* hide the decorative icon on very small screens to save space */
    .warehouse-intro .tagline-box i {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .warehouse-intro .section-title {
        font-size: 1.5rem;
    }
    
    .warehouse-intro .intro-text {
        font-size: 1rem;
    }
}

/* Mobile: make tagline single-line and reduce icon size */
@media (max-width: 576px) {
    .warehouse-intro .tagline-box h4 {
        font-size: 0.95rem; /* smaller so it fits on one line */
        white-space: nowrap; /* prevent wrapping */
        overflow: hidden;
        text-overflow: ellipsis; /* if still too long, show ellipsis */
        margin-bottom: 0;
    }
    .warehouse-intro .tagline-box h4 i.fas,
    .warehouse-intro .tagline-box h4 i.fa-bullseye {
        font-size: 0.95rem; /* reduce icon size on mobile */
        margin-right: 0.4rem;
        vertical-align: -0.05em;
    }
}

/* 🚀 V2 Quick Filters */
.quick-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.quick-filters h6 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
}

.quick-filter-btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-filter-btn.active {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    font-weight: 700;
}

/* 🆕 Advanced Filters V2 */
.advanced-filters-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.advanced-filters-list .form-check {
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0;
    transition: background-color 0.3s ease;
}

.advanced-filters-list .form-check:hover {
    background: #e9ecef;
}

.advanced-filters-list .form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.advanced-filters-list .form-check-label {
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

/* 🔧 Applied Filters Display */
.applied-filters-display {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.filter-tag {
    display: inline-block;
    background: #17a2b8;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

/* 📊 Product Stats Enhanced */
.product-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    margin-bottom: 0.5rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.78rem;
}

.stock-info {
    padding: 0.25rem 0;
    text-align: center;
    background: #f8fff8;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.review-count {
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* 💰 Enhanced Price Display */
.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.product-price .discount-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc3545;
}

.product-price .original-price {
    font-size: 0.9rem;
    color: #6c757d;
    text-decoration: line-through;
}

/* 🏷️ Product Badges V2 */
.product-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: calc(100% - 1rem);
}

.product-badges .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 📄 Enhanced Pagination V2 */
.pagination-container {
    margin-top: 2rem;
}

.pagination .page-link {
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    color: #007bff;
    background-color: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.pagination .page-item.disabled .page-link {
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    margin-top: 0.75rem;
    text-align: center;
}

.pagination-info small {
    color: #6c757d;
    font-size: 0.85rem;
}

/* ============================= */
/* 🧭 Toolbar & Layout Enhancements */
/* ============================= */
.store-toolbar {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 0.85rem 1rem 0.9rem;
    box-shadow: 0 4px 12px -2px rgba(0,0,0,0.05);
    position: sticky; /* sẽ chỉ cố định khi chạm mép trên */
    top: var(--sticky-offset, 0px);
    z-index: 50; /* cao hơn nội dung nhưng dưới header chính nếu header có z-index lớn hơn */
}
.store-toolbar .store-title { font-size: 1.05rem; font-weight: 600; }
.store-toolbar .input-group.store-search-group { max-width: 340px; }
.store-toolbar .input-group.store-search-group input { border-left: none; }
.store-toolbar .input-group-text { border-right: none; }
.store-toolbar .dropdown-menu .active { background: #0d6efd; color: #fff; }

/* ================= Full Toolbar Frame Refresh (Override) ================= */
/* Re-style the entire toolbar "khung" per request */
.store-toolbar {
    --tb-bg-start: #ffffff;
    --tb-bg-end: #f4f8fb;
    --tb-border: #dbe3ea;
    --tb-shadow: 0 4px 14px -4px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --tb-radius: 18px;
    background: linear-gradient(140deg,var(--tb-bg-start) 0%, var(--tb-bg-end) 100%) !important;
    border: 1px solid var(--tb-border) !important;
    border-radius: var(--tb-radius) !important;
    padding: 1rem 1.15rem 1.05rem !important;
    box-shadow: var(--tb-shadow) !important;
    position: sticky;
    top: var(--sticky-offset,0px);
    backdrop-filter: saturate(1.4) blur(6px);
    -webkit-backdrop-filter: saturate(1.4) blur(6px);
    overflow: visible;
    transition: box-shadow .35s ease, border-color .35s ease, background .45s ease, padding .3s ease, border-radius .3s ease;
}
.store-toolbar:before { /* subtle inner glow */
    content:""; position:absolute; inset:0; border-radius:calc(var(--tb-radius) - 2px); pointer-events:none;
    background:linear-gradient(120deg,rgba(255,255,255,.6),rgba(255,255,255,0)) !important;
    opacity:.85 !important;
    mix-blend-mode:overlay;
}
.store-toolbar:after { /* bottom accent hairline */
    content:""; position:absolute; left:18px; right:18px; bottom:4px; height:3px;
    background:linear-gradient(90deg,rgba(13,110,253,.15),rgba(13,110,253,0.05),rgba(13,110,253,.15)) !important;
    border-radius:2px; opacity:.75 !important;
}
.store-toolbar:hover { box-shadow:0 6px 20px -4px rgba(0,0,0,.12), 0 3px 8px -2px rgba(0,0,0,.08) !important; }
.store-toolbar:focus-within { border-color:#0d6efd !important; box-shadow:0 0 0 3px rgba(13,110,253,.18), 0 6px 20px -4px rgba(13,110,253,.25) !important; }

/* Layout refinements */
.store-toolbar .toolbar-row { display:flex; flex-wrap:wrap; gap:.75rem 1rem; align-items:stretch; }
.store-toolbar .toolbar-actions { display:flex; gap:.5rem; align-items:center; }
.store-toolbar .toolbar-actions .btn { border-radius:10px; font-weight:600; letter-spacing:.3px; }
.store-toolbar .toolbar-actions .btn-outline-dark { border-color:#cad3dc; color:#374452; background:#ffffff; }
.store-toolbar .toolbar-actions .btn-outline-dark:hover { background:#0d6efd; color:#fff; border-color:#0d6efd; }

/* Integrate search group spacing inside toolbar */
.store-toolbar .store-search-group { flex:1 1 340px; max-width:460px; }
.store-toolbar .toolbar-search-group { flex:1 1 380px; min-width:260px; }

/* Page size select refine */

/* Sort dropdown refine */
.store-toolbar .sort-dropdown .btn { border-radius:10px; font-size:.72rem; font-weight:600; letter-spacing:.4px; }
.store-toolbar .sort-dropdown .dropdown-menu { border-radius:14px; padding:.4rem .5rem; box-shadow:0 10px 28px -6px rgba(0,0,0,.15); }
.store-toolbar .sort-dropdown .dropdown-menu .sort-item { font-size:.72rem; border-radius:8px; padding:.4rem .6rem; }
.store-toolbar .sort-dropdown .dropdown-menu .sort-item:hover { background:#eef6ff; }

/* View toggle buttons unify */
.store-toolbar .view-toggle .btn { border:1px solid #ced6dd; background:#fff; color:#4a5966; font-weight:600; }
.store-toolbar .view-toggle .btn.active { background:#0d6efd !important; border-color:#0d6efd !important; color:#fff !important; box-shadow:0 2px 6px rgba(13,110,253,.35); }
.store-toolbar .view-toggle .btn:not(.active):hover { background:#f1f6fb; }

/* Meta area styling */
.store-toolbar .toolbar-meta { margin-top:.55rem; padding-top:.5rem; border-top:1px dashed #d3dbe2; }
.store-toolbar .store-title { font-size:1rem; font-weight:700; letter-spacing:.25px; }
.store-toolbar #pagination-brief { font-size:.65rem; letter-spacing:.5px; font-weight:600; opacity:.85; }

/* Condensed (e.g., on scroll) variant */
.store-toolbar.toolbar-condensed { padding:.55rem .85rem .65rem !important; border-radius:14px !important; }
.store-toolbar.toolbar-condensed .store-title { font-size:.88rem; }
.store-toolbar.toolbar-condensed .toolbar-meta { margin-top:.35rem; padding-top:.35rem; }

/* Mobile refinements */
@media (max-width: 768px) {
    .store-toolbar { padding:.85rem .75rem .9rem !important; border-radius:14px !important; }
    .store-toolbar .toolbar-row { gap:.65rem .65rem; }
    .store-toolbar .toolbar-meta { margin-top:.45rem; }
    .store-toolbar .store-search-group { flex:1 1 100%; max-width:100%; }
    .store-toolbar .toolbar-actions { flex-wrap:wrap; gap:.4rem; }
}

@media (max-width: 576px) {
    .store-toolbar { padding:.75rem .65rem .8rem !important; }
    .store-toolbar .store-title { font-size:.95rem; }
    .store-toolbar .toolbar-meta { border-top:none; padding-top:0; margin-top:.2rem; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .store-toolbar {
        --tb-bg-start:#1f252b; --tb-bg-end:#2a3137; --tb-border:#39434c; --tb-shadow:0 4px 14px -4px rgba(0,0,0,.65);
        color:#d8e2eb;
    }
    .store-toolbar:after { background:linear-gradient(90deg,rgba(13,110,253,.35),rgba(13,110,253,.08),rgba(13,110,253,.35)); }
    .store-toolbar .toolbar-actions .btn-outline-dark { background:#2e363d; border-color:#3c4751; color:#b7c3cc; }
    .store-toolbar .toolbar-actions .btn-outline-dark:hover { background:#0d6efd; color:#fff; }
    .store-toolbar .view-toggle .btn { background:#2c343a; border-color:#404b54; color:#b9c4cd; }
    .store-toolbar .view-toggle .btn:not(.active):hover { background:#344047; }
    .store-toolbar .view-toggle .btn.active { box-shadow:0 2px 8px rgba(13,110,253,.5); }
    .store-toolbar .sort-dropdown .btn { background:#2e363d; border-color:#3c4650; color:#c3ced6; }
    .store-toolbar .sort-dropdown .dropdown-menu { background:#2d353b; border-color:#3a444c; }
    .store-toolbar .sort-dropdown .dropdown-menu .sort-item { color:#d0d9e0; }
    .store-toolbar .sort-dropdown .dropdown-menu .sort-item:hover { background:#36424a; }
    .store-toolbar .toolbar-meta { border-top:1px dashed #404a52; }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    .store-toolbar, .store-toolbar * { transition:none !important; }
}

/* ================= Theme Adjustment V2 (Light Harmonized Palette) ================= */
/* User feedback: previous dark / desaturated palette felt mismatched. Force a clean light style regardless of OS dark mode. */
html body .store-toolbar {
    background: linear-gradient(180deg,#ffffff 0%, #f6f9fc 100%) !important;
    border:1px solid #d6e2ec !important;
    box-shadow: 0 4px 12px -4px rgba(13,110,253,0.08), 0 2px 4px -1px rgba(0,0,0,0.05) !important;
    border-radius:16px !important;
    color:#2f3f4f;
}
html body .store-toolbar:before { /* soften internal sheen */
    background:linear-gradient(120deg,rgba(255,255,255,.8),rgba(255,255,255,0)) !important;
    opacity:.85 !important;
}
html body .store-toolbar:after { /* thin blue accent line */
    left:14px !important; right:14px !important; bottom:6px !important; height:2px !important;
    background:linear-gradient(90deg,#0d6efd 0%, rgba(13,110,253,.35) 50%, #0d6efd 100%) !important;
    opacity:.55 !important;
}
html body .store-toolbar:hover { box-shadow:0 6px 18px -4px rgba(13,110,253,.18), 0 3px 6px -2px rgba(0,0,0,.06) !important; }
html body .store-toolbar:focus-within { box-shadow:0 0 0 3px rgba(13,110,253,.18), 0 6px 20px -4px rgba(13,110,253,.25) !important; border-color:#0d6efd !important; }

html body .store-toolbar .store-search-group {
    background:#ffffff !important;
    border:1px solid #d8e3ec !important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.4), 0 1px 2px rgba(0,0,0,0.04) !important;
    border-radius:12px !important;
    padding:.3rem .6rem !important;
}
html body .store-toolbar .store-search-group:focus-within { border-color:#0d6efd !important; box-shadow:0 0 0 2px rgba(13,110,253,.15), 0 2px 6px rgba(13,110,253,.25) !important; background:#ffffff !important; }
html body .store-toolbar .store-search-group .form-control { color:#243544 !important; }
html body .store-toolbar .store-search-group .form-control::placeholder { color:#7c8b98 !important; }
html body .store-toolbar .store-search-group .input-group-text i { color:#688195 !important; }
html body .store-toolbar .store-search-group:focus-within .input-group-text i { color:#0d6efd !important; }

/* Page size select refine for light */

/* Sort & view toggle unify with lighter surfaces */
html body .store-toolbar .sort-dropdown .btn { background:#ffffff !important; border:1px solid #cfdbe4 !important; color:#2f4656 !important; }
html body .store-toolbar .sort-dropdown .btn:hover { background:#f0f6fc !important; }
html body .store-toolbar .sort-dropdown .dropdown-menu { background:#fff !important; border:1px solid #d9e4ec !important; }
html body .store-toolbar .view-toggle .btn { background:#ffffff !important; border:1px solid #cfdbe4 !important; color:#2f4656 !important; }
html body .store-toolbar .view-toggle .btn:not(.active):hover { background:#f0f6fc !important; }
html body .store-toolbar .view-toggle .btn.active { background:#0d6efd !important; color:#fff !important; border-color:#0d6efd !important; }

/* Meta area: lighter divider */
html body .store-toolbar .toolbar-meta { border-top:1px dashed #d5e1ea !important; }
html body .store-toolbar #pagination-brief { color:#5a6b78 !important; }
html body .store-toolbar .store-title { color:#2f3f4f !important; }

/* Remove dark mode override for toolbar (force light) */
@media (prefers-color-scheme: dark) {
  html body .store-toolbar { background:linear-gradient(180deg,#ffffff 0%, #f6f9fc 100%) !important; color:#2f3f4f !important; }
  html body .store-toolbar .store-search-group { background:#ffffff !important; }
}

/* Compact variant alignment with new light palette */
html body .store-toolbar.toolbar-condensed { background:linear-gradient(180deg,#ffffff 0%, #f3f7fa 100%) !important; }

/* Mobile fine-tune */
@media (max-width: 576px) {
  html body .store-toolbar { border-radius:14px !important; }
  html body .store-toolbar .toolbar-meta { border-top:none !important; margin-top:.3rem !important; padding-top:.2rem !important; }
}

/* ===== Height Reduction Override (khung thấp hơn) ===== */
html body .store-toolbar { padding:.65rem .85rem .7rem !important; }
html body .store-toolbar .toolbar-row { gap:.55rem .75rem !important; }
html body .store-toolbar .store-search-group { padding:.2rem .55rem !important; }
html body .store-toolbar .store-search-group .form-control { padding:.3rem .2rem .28rem .1rem !important; font-size:.8rem !important; }
html body .store-toolbar .store-search-group .form-control { line-height:1.1 !important; height:28px !important; }
html body .store-toolbar .store-search-group #clear-search { padding:.25rem .35rem !important; }
@media (max-width:576px){
    html body .store-toolbar .store-search-group { min-height:32px !important; padding:.18rem .5rem !important; }
    html body .store-toolbar .store-search-group .form-control { height:26px !important; font-size:.75rem !important; }
}
html body .store-toolbar .toolbar-actions .btn { padding:.35rem .55rem !important; font-size:.7rem !important; }
html body .store-toolbar .toolbar-meta { margin-top:.35rem !important; padding-top:.3rem !important; }
html body .store-toolbar .store-title { font-size:.95rem !important; }
@media (max-width: 576px){
    html body .store-toolbar { padding:.55rem .65rem .6rem !important; }
    html body .store-toolbar .toolbar-meta { margin-top:.25rem !important; }
}

/* View toggle */
.view-toggle .btn { min-width: 38px; }
.view-toggle .btn.active { background: #0d6efd; color: #fff; }

/* Skeleton Loading */
[data-skeleton="true"] { position: relative; }
.product-skeleton::before {
    content: "";
    display: block;
    width: 100%;
    padding-top: 160%;
    background: linear-gradient(120deg,#f0f3f5 0%,#e2e6ea 40%,#f0f3f5 80%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: skeletonPulse 1.2s ease-in-out infinite;
}
@keyframes skeletonPulse { 0% { background-position: 100% 0;} 100% { background-position: -100% 0;} }

/* List View Mode */
.list-view #products-container { display: flex; flex-direction: column; }
.list-view #products-container > div[class*="col-"] { width: 100%; max-width: 100%; }
.list-view .product-card { flex-direction: row; height: auto; min-height: 160px; }
.list-view .product-card .product-image { width: 150px; height: 150px; flex: 0 0 150px; border-right: 1px solid #f1f1f1; }
.list-view .product-card .product-info { padding: 0.8rem 1rem; }
.list-view .product-card .card-footer { border-left: 1px solid #e9ecef; display: flex; align-items: center; justify-content: center; }
.list-view .product-card .card-footer .btn { width: 100%; }

/* Applied Filters tags inside toolbar area */
#applied-filters-display { min-height: 10px; }

/* Mobile filter slide panel (reuse sidebar) */
@media (max-width: 991.98px) {
    .store-sidebar { position: fixed; top: 0; left: -100%; width: 85%; max-width: 360px; height: 100vh; overflow-y: auto; background: #fff; padding: 1.25rem 1rem 3rem; z-index: 1050; box-shadow: 4px 0 18px rgba(0,0,0,.12); transition: left .35s ease; }
    .store-sidebar.open { left: 0; }
    body.sidebar-open { overflow: hidden; }
    .sidebar-overlay { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1045; opacity: 0; visibility: hidden; transition: all .35s ease; }
    .sidebar-overlay.show { opacity: 1; visibility: visible; }
    /* Mobile vẫn dùng sticky; offset sẽ được tính động nếu header cố định */
    .store-toolbar { top: var(--sticky-offset, 0px); }
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .store-toolbar { padding: 0.75rem 0.75rem 0.8rem; }
    .store-toolbar .store-title { font-size: 0.92rem; }
    .store-toolbar .toolbar-meta { margin-top: 0.4rem; }
    .store-toolbar .input-group.store-search-group { max-width: 100%; }
    .store-toolbar .toolbar-actions { flex-wrap:wrap; gap:.4rem; }
}

@media (max-width: 576px) {
    .product-card .product-image { height:105px; }
    .product-card .product-price .discount-price { font-size:.85rem; }
    #products-container > div[class*="col-"] { margin-bottom:.25rem !important; }
    .product-card .product-name { font-size:.8rem; }
    .product-card .product-stats { font-size:.6rem; }
}

/* Optional: if discount + original price create extra height, reduce original font */
.product-card .product-price .original-price { font-size: .7rem; }

/* Ensure list view overrides width */
.list-view #products-container > div { flex: 0 0 100% !important; max-width:100% !important; }

/* Improve price layout: allow flex shrinking and wrapping so discount + original fit on small cards */
.product-card .product-info { min-width: 0; }
.product-card .product-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
.product-card .product-price .discount-price {
    font-weight: 700;
    white-space: nowrap; /* keep main price together */
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-card .product-price .original-price {
    color: #95a5a6;
    text-decoration: line-through;
    white-space: nowrap;
    flex-shrink: 0;
}
@media (max-width: 576px) {
    .product-card .product-price .discount-price { font-size: 1rem; }
    .product-card .product-price .original-price { font-size: 0.78rem; }
}

/* Narrow the sidebar on larger screens to make category column slimmer */
@media (min-width: 992px) {
    .store-section .col-lg-3 {
        flex: 0 0 22% !important;
        max-width: 22% !important;
    }
    .store-section .col-lg-9 {
        flex: 0 0 78% !important;
        max-width: 78% !important;
    }
    .store-sidebar {
        padding: 1.25rem;
    }
}

/* Make price filter inputs smaller and more compact */
#filter-form #minPrice,
#filter-form #maxPrice {
    font-size: 0.85rem !important;
    padding: 0.35rem 0.5rem !important;
    height: auto !important;
}
/* Ensure the input's placeholder and number controls stay legible on small screens */
@media (max-width: 576px) {
    #filter-form #minPrice,
    #filter-form #maxPrice {
        font-size: 0.82rem !important;
        padding: 0.32rem 0.45rem !important;
    }
}

/* Rating filter: stack each rating option vertically */
.rating-list {
    display: block;
    padding: 0;
    margin: 0;
}
.rating-list .form-check {
    display: block;
    width: 100%;
    margin: 0 0 0.45rem 0;
}
.rating-list .form-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem; /* reduced label size */
    color: #444;
    line-height: 1;
}
.rating-list .form-check-label .fa-star {
    font-size: 0.95rem; /* smaller star icons */
    color: #f39c12;
    line-height: 1;
}
.rating-list .form-check-input {
    margin-right: 0.4rem;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}
@media (max-width: 576px) {
    .rating-list .form-check { margin-bottom: 0.35rem; }
    .rating-list .form-check-label { font-size: 0.8rem; gap: 0.35rem; }
    .rating-list .form-check-label .fa-star { font-size: 0.85rem; }
    .rating-list .form-check-input { width: 0.95rem; height: 0.95rem; }
}

/* Inline rating next to sold count (single star + score) */
.product-stats .rating-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.product-stats .rating-inline i {
    color: #f39c12;
    line-height: 1;
    font-size: 0.95rem;
}
.product-stats .rating-score {
    font-size: 0.78rem;
    color: #6c757d;
    vertical-align: middle;
}

@media (max-width: 576px) {
    .product-stats .rating-inline i { font-size: 0.8rem !important; }
    .product-stats .rating-score { font-size: 0.72rem !important; }
}

/* Force platform icons to render in one horizontal row on desktop */
@media (min-width: 992px) {
    /* Force a single row for platform icons on desktop and distribute icons evenly to both sides */
    .platform-icons .row {
        display: flex !important;
        flex-flow: row nowrap !important;
        justify-content: space-between !important; /* spread icons evenly to both sides */
        align-items: center !important;
        gap: 0.75rem !important;
        width: 100% !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Make each column wrapper flexible so icons share the available width evenly */
    .platform-icons .row > div[class*="col-"] {
        flex: 1 1 0 !important; /* allow even distribution */
        width: auto !important;
        max-width: none !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Ensure no bootstrap utility margins add space */
    .platform-icons .row > div[class*="mb-"] { margin-bottom: 0 !important; }

    /* Platform item sizing: full width of its column but keep internal padding small */
    .platform-icons .platform-item {
        width: 100%;
        min-width: 56px;
        padding: 0.35rem 0.6rem !important;
        margin-bottom: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: none; /* keep it visually light */
        background: transparent; /* avoid strong backgrounds pushing layout */
    }

    /* Icon and label sizing tweaks for desktop */
    .platform-icons .platform-item i { font-size: 1.05rem !important; margin-bottom: 0 !important; }
    .platform-icons .platform-item p { font-size: 0.82rem !important; margin: 0 !important; }
}

/* Reduce bottom spacing under platform icons (override bootstrap margins) */
.platform-icons {
    margin-bottom: 0.35rem !important;
}
.platform-icons h5 { margin-bottom: 0.35rem !important; }
/* Remove default column bottom margins inside platform-icons */
.platform-icons .row > div[class*="col-"] {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
/* Ensure platform items themselves have minimal bottom margin */
.platform-icons .platform-item {
    margin-bottom: 0 !important;
}
@media (max-width: 576px) {
    .platform-icons .row > div[class*="col-"] { margin-bottom: 0 !important; }
    .platform-icons .platform-item { margin-bottom: 0 !important; }
}

/* Mobile: keep all platform icons on a single centered row */
@media (max-width: 576px) {
    .platform-icons .row {
        display: flex !important;
        flex-wrap: nowrap !important; /* keep all icons on one line */
        justify-content: center !important; /* center the group */
        gap: 0.45rem !important;
        overflow-x: auto !important; /* allow slight scroll if space is too tight */
        -webkit-overflow-scrolling: touch;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Keep column wrappers shrink-to-fit so icons line up on one row */
    .platform-icons .row > div[class*="col-"] {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        margin-bottom: 0 !important;
    }

    .platform-icons .platform-item {
        width: auto !important;
        min-width: 40px !important; /* allow four icons to fit on one line */
        padding: 0.25rem !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: transparent;
        box-shadow: none;
    }

    .platform-icons .platform-item i {
        font-size: 1.2rem !important; /* slightly larger but compact */
        margin-bottom: 0.25rem;
        line-height: 1;
    }

    .platform-icons .platform-item p {
        font-size: 0.72rem !important;
        margin: 0 !important;
        white-space: nowrap;
        text-align: center !important;
    }
}

/* Double the visible icon size on desktop and adjust spacing */
@media (min-width: 992px) {
    .platform-icons .platform-item i {
        font-size: 2.1rem !important; /* ~2x of previous 1.05rem */
        line-height: 1;
        margin-bottom: 0.25rem !important;
    }

    .platform-icons .platform-item {
        padding: 0.6rem 0.8rem !important; /* more room for larger icons */
    }

    .platform-icons .platform-item p {
        font-size: 0.95rem !important; /* slightly larger label to match */
        margin: 0 !important;
    }
}

/* Keep store title and sort controls on one line (tablet and up) */
@media (min-width: 576px) {
    .sort-options .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    /* Let the title take remaining space while the controls stay compact to the right */
    .sort-options .col-md-6:first-child { flex: 1 1 auto !important; min-width: 0 !important; }
    .sort-options .col-md-6:last-child { flex: 0 0 auto !important; }

    .store-title {
        font-size: 1.15rem !important; /* slightly smaller so it fits on one line */
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: middle;
        margin-bottom: 0;
    }

    .sort-controls {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 0.5rem !important;
        white-space: nowrap !important;
    }

    .sort-controls .form-label { margin-bottom: 0 !important; }
}

/* Mobile: stack store title and sort controls into two lines */
@media (max-width: 576px) {
    /* Allow wrapping so columns stack vertically */
    .sort-options .row {
        display: flex !important;
        flex-wrap: wrap !important; /* allow stacking */
        align-items: center !important;
        gap: 0.35rem !important;
    }

    /* Make both columns full width so they appear as two rows */
    .sort-options .col-md-6:first-child,
    .sort-options .col-md-6:last-child {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Title: smaller and allow normal wrapping (two-line layout will place it on its own row) */
    .store-title {
        font-size: 0.95rem !important; /* reduced on phones */
        white-space: normal !important; /* allow wrapping if needed */
        overflow: visible !important;
        text-overflow: unset !important;
        margin-bottom: 0.25rem !important;
        text-align: left !important;
    }

    /* Controls: occupy second row, keep items in a horizontal line */
    .sort-controls {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important; /* left align controls on second row */
        gap: 0.4rem !important;
        white-space: nowrap !important;
        margin-top: 0 !important;
    }

    .sort-controls .form-label {
        font-size: 0.82rem !important;
        margin-bottom: 0 !important;
    }

    /* Keep sort buttons compact */
    .sort-controls .btn-group .btn {
        padding: 0.28rem 0.5rem !important;
        font-size: 0.78rem !important;
    }
}

/* Sidebar collapse behavior */
.store-sidebar-col.collapsed {
    width: 0;
    overflow: hidden;
    flex: 0 0 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    transition: all 0.3s ease;
}

.store-sidebar-col.collapse-hidden {
    display: none !important;
}

/* Floating FAB for opening filters when sidebar is collapsed */
#open-filters-fab {
    position: fixed;
    top: 160px;
    left: 14px;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

#open-filters-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Hide FAB on mobile since sidebar slides in */
@media (max-width: 991.98px) {
    #open-filters-fab {
        display: none !important;
    }
}

/* Expand products area when sidebar is collapsed */
.store-sidebar-col.collapsed ~ .col-lg-9 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    transition: all 0.3s ease;
}

/* Also expand when sidebar is completely hidden */
.store-sidebar-col.collapse-hidden ~ .col-lg-9 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Enhanced responsive product grid */
@media (max-width: 575.98px) {
    /* Mobile: 2 sản phẩm/hàng */
    .product-grid-wrapper .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* Small tablets: 2 sản phẩm/hàng */
    .product-grid-wrapper .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Tablets: 3 sản phẩm/hàng */
    .product-grid-wrapper .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
   
    /* Desktop: 5 sản phẩm/hàng */
    .product-grid-wrapper .col-lg-2 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

@media (min-width:   1200px) {
    /* Large desktop: 6 sản phẩm/hàng */
    .product-grid-wrapper .col-xl-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

/* Ensure proper spacing between products */
.product-grid-wrapper .col-6,
.product-grid-wrapper .col-sm-6,
.product-grid-wrapper .col-md-4,
.product-grid-wrapper .col-lg-2,
.product-grid-wrapper .col-xl-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Product card responsive adjustments */
@media (max-width: 575.98px) {
    .product-card .product-image {
        height: 160px;
    }
    .product-card .product-name {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .product-card .product-image {
        height: 180px;
    }
    .product-card .product-name {
        font-size: 0.85rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}