/* =====================================================
   SleepShop Catalog – CSS
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Root wrapper */
#ssc-root {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
}
.ssc-page-header { padding: 20px 0 8px; }
.ssc-page-header .woocommerce-breadcrumb { font-size: 13px; color: #999; margin-bottom: 8px; }
.ssc-page-title { font-size: 28px; font-weight: 700; margin: 0 0 24px; color: #1a1a2e; }

.ssc-sidebar-top { display: flex; align-items: center; justify-content: space-between; }
.ssc-reset-btn { background: none; border: none; color: #4a6cf7; font-size: 13px; cursor: pointer; padding: 0; }
.ssc-reset-btn:hover { text-decoration: underline; }

/* Color swatch */
.ssc-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: outline .15s;
}
.ssc-check-label input:checked ~ .ssc-color-swatch {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

/* Layout */
.ssc-catalog-wrap {
    display: flex;
    gap: 32px;
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 20px;
    align-items: flex-start;
}

/* ── Sidebar ─────────────────────────────────────── */
.ssc-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 24px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
}

.ssc-sidebar-section {
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.ssc-sidebar-section:last-child { border-bottom: none; }

.ssc-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #1a1a2e;
}

.ssc-sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    display: flex;
    align-items: center;
}

.ssc-filter-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin: 0 0 14px;
}

/* Price inputs */
.ssc-price-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ssc-price-inputs input {
    width: 50%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: #1a1a2e;
    outline: none;
    transition: border-color .2s;
}
.ssc-price-inputs input:focus { border-color: #4a6cf7; }

/* Dual range slider */
.ssc-range-wrap {
    position: relative;
    height: 26px;
}
.ssc-range-wrap input[type="range"] {
    position: absolute;
    width: 100%;
    appearance: none;
    background: transparent;
    pointer-events: none;
    height: 4px;
    top: 50%;
    transform: translateY(-50%);
}
.ssc-range-wrap input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a6cf7;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    pointer-events: all;
    cursor: pointer;
}
.ssc-range-wrap input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a6cf7;
    border: 2px solid #fff;
    pointer-events: all;
    cursor: pointer;
}
#ssc-range-min { z-index: 3; }
#ssc-range-max { z-index: 4; }

/* Filter list */
.ssc-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ssc-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}
.ssc-check-label input[type="checkbox"] { display: none; }

.ssc-check-box {
    width: 17px;
    height: 17px;
    border: 1.5px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    flex-shrink: 0;
    transition: background .15s, border-color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ssc-check-label input:checked + .ssc-check-box {
    background: #4a6cf7;
    border-color: #4a6cf7;
}
.ssc-check-label input:checked + .ssc-check-box::after {
    content: '';
    width: 9px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}
.ssc-check-label input:checked + .ssc-color-dot {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

.ssc-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: outline .15s;
}

.ssc-count {
    margin-left: auto;
    font-size: 12px;
    color: #aaa;
}

/* ── Main area ───────────────────────────────────── */
.ssc-main { flex: 1; min-width: 0; }

/* Toolbar */
.ssc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.ssc-result-count {
    font-size: 14px;
    color: #888;
}
.ssc-result-count #ssc-count {
    font-weight: 600;
    color: #1a1a2e;
}

#ssc-orderby {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
}

/* Product grid */
.ssc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ── Card ─────────────────────────────────────────── */
.ssc-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
.ssc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.09);
}

.ssc-card-image {
    position: relative;
    background: #f8f8f8;
    aspect-ratio: 1;
    overflow: hidden;
}

.ssc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform .3s;
}
.ssc-card:hover .ssc-card-image img { transform: scale(1.04); }

.ssc-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #bbb;
}

/* Discount badge */
.ssc-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e53e3e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    z-index: 2;
    letter-spacing: .02em;
}

/* Quick view button */
.ssc-quick-view-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s, transform .2s;
    color: #555;
    z-index: 2;
}
.ssc-card:hover .ssc-quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}
.ssc-quick-view-btn:hover { background: #f0f4ff; color: #4a6cf7; }

/* Card body */
.ssc-card-body { padding: 14px 16px 16px; }

.ssc-cat-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #4a6cf7;
    background: #eef1ff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Stars */
.ssc-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-bottom: 6px;
}
.ssc-stars .star { font-size: 13px; }
.ssc-stars .star.full  { color: #f6a609; }
.ssc-stars .star.half  { color: #f6a609; }
.ssc-stars .star.empty { color: #ddd; }
.ssc-rating-count { font-size: 12px; color: #aaa; margin-left: 4px; }

.ssc-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
    color: #1a1a2e;
}
.ssc-card-title a { color: inherit; text-decoration: none; }
.ssc-card-title a:hover { color: #4a6cf7; }

/* Price */
.ssc-card-price { margin-bottom: 12px; }
.ssc-card-price .woocommerce-Price-amount { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.ssc-card-price del .woocommerce-Price-amount {
    font-size: 13px;
    font-weight: 400;
    color: #aaa;
    margin-right: 6px;
}
.ssc-card-price ins { text-decoration: none; }

.ssc-card-footer { display: flex; }

.ssc-add-to-cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s;
    width: 100%;
    justify-content: center;
}
.ssc-add-to-cart:hover { background: #4a6cf7; color: #fff; }

.ssc-add-to-cart.ssc-loading {
    background: #555;
    pointer-events: none;
    position: relative;
    color: transparent;
}
.ssc-add-to-cart.ssc-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ssc-spin .7s linear infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
@keyframes ssc-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.ssc-add-to-cart.ssc-added {
    background: #38a169;
    pointer-events: none;
}
.ssc-add-to-cart.ssc-added svg { display: none; }
.ssc-add-to-cart.ssc-added::before { content: '✓  '; }

/* Loader dots */
.ssc-loader {
    display: none;
    justify-content: center;
    gap: 7px;
    padding: 32px 0;
}
.ssc-loader.active { display: flex; }
.ssc-loader span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4a6cf7;
    animation: ssc-bounce .8s infinite ease-in-out both;
}
.ssc-loader span:nth-child(1) { animation-delay: -.32s; }
.ssc-loader span:nth-child(2) { animation-delay: -.16s; }
@keyframes ssc-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: .4; }
    40%            { transform: scale(1); opacity: 1; }
}

.ssc-no-products {
    grid-column: 1/-1;
    text-align: center;
    color: #aaa;
    padding: 48px 0;
    font-size: 15px;
}

/* ── Quick View Modal ────────────────────────────── */
.ssc-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ssc-modal-overlay.open { display: flex; }

.ssc-modal-wrap {
    background: #fff;
    border-radius: 16px;
    max-width: 840px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.ssc-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    color: #555;
    transition: background .15s;
}
.ssc-modal-close:hover { background: #ffe0e0; color: #e53e3e; }

.ssc-modal-content { padding: 32px; }

.ssc-modal-loading {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 48px 0;
}
.ssc-modal-loading span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4a6cf7;
    animation: ssc-bounce .8s infinite ease-in-out both;
}
.ssc-modal-loading span:nth-child(1) { animation-delay: -.32s; }
.ssc-modal-loading span:nth-child(2) { animation-delay: -.16s; }

/* Quick view inner layout */
.ssc-qv-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.ssc-qv-gallery img#ssc-qv-main-img {
    width: 100%;
    border-radius: 10px;
    object-fit: contain;
    background: #f8f8f8;
    aspect-ratio: 1;
}

.ssc-qv-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.ssc-qv-thumb {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    background: #f8f8f8;
    padding: 4px;
    transition: border-color .15s;
}
.ssc-qv-thumb.active,
.ssc-qv-thumb:hover { border-color: #4a6cf7; }

.ssc-qv-title { font-size: 22px; font-weight: 700; margin: 0 0 10px; color: #1a1a2e; }
.ssc-qv-price { margin-bottom: 14px; }
.ssc-qv-price .woocommerce-Price-amount { font-size: 22px; font-weight: 700; color: #1a1a2e; }
.ssc-qv-price del .woocommerce-Price-amount { font-size: 15px; color: #aaa; font-weight: 400; }
.ssc-qv-price ins { text-decoration: none; }

.ssc-qv-desc { font-size: 14px; color: #555; line-height: 1.7; margin-bottom: 16px; }

.ssc-qv-attrs { list-style: none; padding: 0; margin: 0 0 20px; font-size: 13px; color: #555; }
.ssc-qv-attrs li { padding: 5px 0; border-bottom: 1px solid #f0f0f0; }
.ssc-qv-attrs strong { color: #333; }

.ssc-qv-actions { display: flex; flex-direction: column; gap: 10px; }

.ssc-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}
.ssc-btn-primary:hover { background: #4a6cf7; color: #fff; }

.ssc-btn-link {
    text-align: center;
    color: #4a6cf7;
    font-size: 13px;
    text-decoration: none;
}
.ssc-btn-link:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
    .ssc-catalog-wrap { flex-direction: column; }
    .ssc-sidebar { flex: unset; width: 100%; position: static; }
    .ssc-qv-inner { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .ssc-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .ssc-modal-content { padding: 20px; }
}
