/* ================================================================
   SWC Search Filter – styles for [swc_product_search] shortcode
   ================================================================ */

/* ── Reset / Scope ─────────────────────────────────────────────── */
.swc-search-page *,
.swc-search-page *::before,
.swc-search-page *::after { box-sizing: border-box; }

.swc-search-page {
    font-family: inherit;
    color: #1a1a1a;
    position: relative;
}

/* ── Top bar ────────────────────────────────────────────────────── */
.swc-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0 14px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 12px;
}

.swc-top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.swc-result-count {
    font-size: 14px;
    color: #555;
}
.swc-result-count span {
    font-weight: 700;
    color: #1a1a1a;
}
.swc-search-term {
    font-size: 14px;
    color: #888;
}

.swc-top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.swc-ctrl-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #555;
}
.swc-ctrl-select {
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    padding: 5px 28px 5px 10px;
    font-size: 13px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
    min-width: 120px;
}
.swc-ctrl-select:focus { outline: 2px solid #F6A01A; border-color: #F6A01A; }

.swc-filter-toggle {
    display: none; /* shown on mobile only */
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.swc-filter-toggle.is-active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }

/* ── Active chips ───────────────────────────────────────────────── */
.swc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
    margin-bottom: 10px;
}
.swc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    color: #333;
    line-height: 1.4;
}
.swc-chip button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 0 2px;
    font-size: 15px;
    line-height: 1;
    color: #888;
    display: inline-flex;
    align-items: center;
}
.swc-chip button:hover { color: #c00; }
.swc-chip--clear {
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    border: none;
}
.swc-chip--clear:hover { background: #333; }

/* ── Main layout ────────────────────────────────────────────────── */
.swc-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.swc-sidebar {
    flex: 0 0 250px;
    width: 250px;
    min-width: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}
.swc-sidebar-scroll {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.swc-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.swc-sidebar-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ── Filter group ───────────────────────────────────────────────── */
.swc-fgroup {
    border-bottom: 1px solid #e8e8e8;
    padding: 2px 0;
}
.swc-fgroup-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}
.swc-fgroup-head:not(button) { cursor: default; }

.swc-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
    color: #888;
}
.swc-fgroup--open .swc-chevron { transform: rotate(180deg); }

.swc-fgroup-body {
    display: none;
    padding-bottom: 10px;
}
.swc-fgroup--open .swc-fgroup-body { display: block; }

/* ── Search within section ──────────────────────────────────────── */
.swc-within-search {
    display: block;
    width: 100%;
    padding: 6px 10px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
}
.swc-within-search:focus { outline: 2px solid #F6A01A; border-color: #F6A01A; }

/* ── Checkbox list ──────────────────────────────────────────────── */
.swc-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.swc-checklist::-webkit-scrollbar { width: 3px; }
.swc-checklist::-webkit-scrollbar-thumb { background: #ddd; }

.swc-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
    border-radius: 4px;
}
.swc-check:hover .swc-check-name { color: #000; }
.swc-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #B5152A;
    cursor: pointer;
}
.swc-check-name {
    flex: 1;
    font-size: 13px;
    color: #444;
    line-height: 1.3;
}
.swc-check.is-checked .swc-check-name { color: #1a1a1a; font-weight: 500; }
.swc-check-count {
    font-size: 11px;
    color: #aaa;
    background: #f4f4f4;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

/* ── Color swatches in sidebar ──────────────────────────────────── */
.swc-swatches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 250px;
    overflow-y: auto;
    padding: 2px;
    scrollbar-width: thin;
}
.swc-swatch-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 44px;
    cursor: pointer;
}
.swc-swatch-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.swc-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    display: block;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}
.swc-swatch-wrap:hover .swc-swatch { transform: scale(1.12); box-shadow: 0 0 0 2px #B5152A; }
.swc-swatch-wrap.is-checked .swc-swatch { border-color: #B5152A; box-shadow: 0 0 0 2px #B5152A; }
.swc-swatch-name {
    font-size: 10px;
    color: #666;
    text-align: center;
    line-height: 1.2;
    max-width: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Price filter ───────────────────────────────────────────────── */
.swc-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.swc-price-field {
    display: flex;
    align-items: center;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    overflow: hidden;
    flex: 1;
    min-width: 70px;
}
.swc-price-sym {
    padding: 0 6px;
    font-size: 13px;
    color: #888;
    background: #f5f5f5;
    border-right: 1px solid #d1d1d1;
    line-height: 32px;
    height: 32px;
    display: flex;
    align-items: center;
}
.swc-price-in {
    width: 100%;
    border: none;
    padding: 0 6px;
    font-size: 13px;
    height: 32px;
    background: #fff;
}
.swc-price-in:focus { outline: none; }
.swc-price-dash { font-size: 13px; color: #aaa; flex-shrink: 0; }
.swc-price-go {
    padding: 0 12px;
    height: 32px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.swc-price-go:hover { background: #333; }

/* ── Search input in sidebar ────────────────────────────────────── */
.swc-search-wrap {
    position: relative;
}
.swc-search-input {
    display: block;
    width: 100%;
    padding: 8px 34px 8px 10px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    font-size: 13px;
}
.swc-search-input:focus { outline: 2px solid #F6A01A; border-color: #F6A01A; }
.swc-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

/* ── Clear all ──────────────────────────────────────────────────── */
.swc-clear-all {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 9px;
    background: none;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    text-align: center;
}
.swc-clear-all:hover { background: #f5f5f5; }

/* ── Products area ──────────────────────────────────────────────── */
.swc-products-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.swc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    transition: opacity 0.2s;
}

.swc-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: #888;
    font-size: 15px;
}

/* ── Product card ───────────────────────────────────────────────── */
.swc-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
}
.swc-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

.swc-card-img-link { display: block; text-decoration: none; }

.swc-card-img-wrap {
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    overflow: hidden;
}
.swc-card-img {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.2s;
}
.swc-card:hover .swc-card-img { transform: scale(1.04); }

.swc-card-swatches {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px 4px;
    flex-wrap: wrap;
}
.swc-card-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,.1);
    flex-shrink: 0;
    cursor: default;
}
.swc-card-dot-more {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 1px 5px;
    line-height: 14px;
}

.swc-card-body {
    padding: 4px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}
.swc-card-brand {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #B5152A;
}
.swc-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}
.swc-card-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.swc-card-title a:hover { color: #B5152A; }
.swc-card-sku {
    font-size: 11px;
    color: #aaa;
}
.swc-card-price {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}
.swc-card-price .woocommerce-Price-amount { font-size: 14px; }
.swc-card-minqty {
    font-size: 11px;
    font-weight: 400;
    color: #888;
}

/* ── Loading overlay ────────────────────────────────────────────── */
.swc-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.65);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    z-index: 10;
    border-radius: 6px;
}
.swc-loading-overlay.is-visible { display: flex; }

.swc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e5e5;
    border-top-color: #B5152A;
    border-radius: 50%;
    animation: swcSpin .7s linear infinite;
}
@keyframes swcSpin { to { transform: rotate(360deg); } }

/* ── Pagination ─────────────────────────────────────────────────── */
.swc-pagination { margin-top: 32px; }
.swc-pag { display: flex; justify-content: center; }
.swc-pag ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.swc-pag-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
}
.swc-pag-btn:hover { background: #f5f5f5; border-color: #ccc; }
.swc-pag-btn.is-current {
    background: #B5152A;
    color: #fff;
    border-color: #B5152A;
    font-weight: 600;
}
.swc-pag-ellipsis { font-size: 14px; color: #aaa; padding: 0 4px; }

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .swc-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .swc-filter-toggle { display: flex; }

    .swc-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        background: #fff;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform .3s ease;
        max-height: 100vh;
        box-shadow: 4px 0 20px rgba(0,0,0,.12);
    }
    .swc-sidebar.is-open { transform: translateX(0); }
    .swc-sidebar-scroll { max-height: 100vh; padding: 16px 12px 80px; }

    body.swc-sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 9998;
    }

    .swc-layout { flex-direction: column; gap: 0; }
    .swc-products-wrap { width: 100%; }
    .swc-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .swc-card-img-wrap { height: 160px; }
}

@media (max-width: 480px) {
    .swc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .swc-top-bar { gap: 6px; }
    .swc-ctrl-label span { display: none; }
}

.swc-card-stock {
    display: inline-block;
    margin: 6px 0 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}
.swc-card-stock.is-in-stock {
    background: #dcfce7;
    color: #166534;
}
.swc-card-stock.is-out-stock {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
