/* =========================
   COLLECTION PAGE STYLES
   ========================= */
.page-title-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 10px;
    margin-bottom: 6px;
}
.page-title-bar h1 {
    font-size: 28px;
    font-weight: 900;
    color: var(--color-text);
    font-family: var(--font-heading);
}
.result-count {
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 400;
}
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.active-filter-tag {
    background: #fff3ec;
    color: var(--color-primary);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #ffd8c0;
}
.active-filter-tag:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.active-filter-tag .remove {
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
}
.clear-all-filters {
    font-size: 12px;
    color: var(--color-text-muted);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    transition: 0.2s;
    white-space: nowrap;
}
.clear-all-filters:hover {
    color: var(--color-discount);
}
.collection-layout {
    display: flex;
    gap: 28px;
    margin-top: 10px;
}
.sidebar {
    flex: 0 0 260px;
    background: var(--color-white);
    border-radius: 16px;
    padding: 22px 20px;
    align-self: flex-start;
    position: sticky;
    top: 130px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
}
.sidebar h3 {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-heading);
}
.sidebar-close {
    display: none;
}
.filter-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f2f2f2;
}
.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.filter-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: 0.2s;
    font-weight: 500;
}
.filter-group label:hover {
    color: var(--color-primary);
}
.filter-group input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 17px;
    height: 17px;
    cursor: pointer;
    flex-shrink: 0;
}
.filter-group .filter-count {
    margin-left: auto;
    font-size: 11px;
    color: #bbb;
    font-weight: 400;
}
.filter-cat-list {
    list-style: none;
}
.filter-cat-list li {
    padding: 6px 0;
}
.filter-cat-list a {
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
}
.filter-cat-list a:hover,
.filter-cat-list a.active {
    color: var(--color-primary);
    font-weight: 600;
}
.price-range-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}
.price-range-inputs input {
    width: 100%;
    padding: 9px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    transition: 0.2s;
    color: #333;
}
.price-range-inputs input:focus {
    border-color: var(--color-primary);
}
.price-range-inputs span {
    color: var(--color-text-muted);
    font-weight: 700;
}
.btn-apply-price {
    width: 100%;
    margin-top: 8px;
    padding: 9px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: 0.2s;
}
.btn-apply-price:hover {
    background: var(--color-primary-dark);
}
.mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 14px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #333;
    transition: 0.2s;
    text-align: center;
    margin-bottom: 15px;
}
.mobile-filter-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.product-area {
    flex: 1;
    min-width: 0;
}
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: white;
    padding: 14px 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}
.sort-options {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sort-label {
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 4px;
}
.sort-option {
    padding: 9px 16px;
    border-radius: 20px;
    border: 2px solid #e8e8e8;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    transition: 0.25s;
    white-space: nowrap;
    text-decoration: none;
}
.sort-option:hover {
    border-color: #ffc8a0;
    color: var(--color-primary);
    background: #fffdf9;
}
.sort-option.active-sort {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 3px 12px rgba(255,77,0,0.2);
}
.view-toggle {
    display: flex;
    gap: 4px;
}
.view-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid #e8e8e8;
    background: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    color: var(--color-text-muted);
}
.view-btn:hover {
    border-color: #ffc8a0;
    color: var(--color-primary);
}
.view-btn.active-view {
    background: #fff3ec;
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.product-grid.list-view {
    grid-template-columns: 1fr;
}
.product-grid.list-view .product-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}
.product-grid.list-view .card-inner {
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 16px;
}
.product-grid.list-view .card-img-wrap {
    width: 200px;
    height: 180px;
    flex-shrink: 0;
}
.product-grid.list-view .product-content h3 {
    font-size: 18px;
}
.product-grid.list-view .wholesale-mini {
    display: block;
}
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: 0.3s;
    cursor: pointer;
    border: 1px solid #ddd;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.10);
    border-color: #ffe0ce;
}
.product-content {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.product-card .tag {
    position: absolute;
    top: 12px;
    left: 12px;
    color: white;
    padding: 6px 11px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    letter-spacing: 0.5px;
}
.tag-discount { background: var(--color-discount); }
.tag-hot { background: var(--color-hot); }
.tag-new { background: var(--color-new); }
.tag-stock { background: var(--color-dark); }
.product-content {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.brand-mini {
    font-size: 11px;
    color: var(--color-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.product-content h3 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    min-height: 36px;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-family: var(--font-heading);
}
.rating {
    color: var(--color-rating);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.rating span {
    color: var(--color-text-muted);
    font-size: 11px;
}
.price-row {
    text-align: center;
    margin: 4px 0;
}
.price {
    font-size: 28px;
    font-weight: 900;
    color: var(--color-primary);
    font-family: var(--font-heading);
    display: block;
    line-height: 1.1;
}
.price del {
    font-size: 13px;
    color: #bbb;
    font-weight: 400;
}
.wholesale-mini {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.8;
}
.wholesale-mini b {
    color: var(--color-primary);
}
.stock-info {
    font-size: 11px;
    color: var(--color-success);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.add-to-cart-btn {
    display: block;
    width: 100%;
    background: var(--color-primary);
    border: none;
    color: white;
    padding: 11px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}
.add-to-cart-btn:hover {
    background: var(--color-primary-dark);
    box-shadow: 0 4px 14px rgba(255,77,0,0.25);
    color: white;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 35px;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid #e8e8e8;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.25s;
}
.pagination .page-numbers:hover {
    border-color: #ffc8a0;
    color: var(--color-primary);
}
.pagination .page-numbers.current {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 3px 12px rgba(255,77,0,0.2);
}
.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    font-size: 18px;
}
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
}
.no-results-icon {
    font-size: 60px;
    margin-bottom: 16px;
}
.no-results h3 {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 10px;
}
.no-results p {
    color: var(--color-text-muted);
    margin-bottom: 20px;
}
.no-results .btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(255,77,0,0.25);
    transition: 0.25s;
}
.no-results .btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
}

@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar {
        display: none;
    }
    .sidebar.open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100%;
        z-index: 9999;
        border-radius: 0;
        max-height: 100vh;
    }
    .sidebar-close {
        display: none;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        font-size: 18px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }
    .mobile-filter-toggle {
        display: block;
    }
    .collection-layout {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
}
/* 排序栏内搜索框 */
.sort-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 15px;
}

.sort-search input {
    width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color var(--transition);
}

.sort-search input:focus {
    border-color: var(--color-primary);
}

.sort-search button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0 4px;
    line-height: 1;
}

.sort-search button:hover {
    color: var(--color-text);
}