/**
 * Goatceo Smart Universal Filter — Frontend Styles
 * @package GoatceoSmartUniversalFilter
 */

/* ── Reset ─────────────────────────────────────────────────────────────────── */
.gsuf-app *, .gsuf-app *::before, .gsuf-app *::after { box-sizing: border-box; }

.gsuf-app {
    --gsuf-gold       : #c9a84c;
    --gsuf-gold-dark  : #b8943e;
    --gsuf-radius     : 8px;
    --gsuf-shadow     : 0 2px 16px rgba(0,0,0,.07);
    --gsuf-gap        : 24px;
    --gsuf-transition : .18s ease;
    font-family       : inherit;
    width             : 100%;
}

/* ── Layout modes ───────────────────────────────────────────────────────────── */
.gsuf-app--inline  { display: flex; flex-direction: column; gap: var(--gsuf-gap); }
.gsuf-app--sidebar { display: grid; grid-template-columns: 280px 1fr; gap: var(--gsuf-gap); align-items: start; }
.gsuf-app--sticky .gsuf-filterbar { position: sticky; top: 20px; z-index: 100; }

/* ── Filter Bar ─────────────────────────────────────────────────────────────── */
.gsuf-filterbar {
    display       : flex;
    flex-wrap     : wrap;
    gap           : 20px;
    background    : #fff;
    border        : 1px solid #e8e8e8;
    border-radius : 12px;
    padding       : 20px 24px;
    box-shadow    : var(--gsuf-shadow);
}
.gsuf-app--sidebar .gsuf-filterbar {
    flex-direction : column;
    max-height     : 90vh;
    overflow-y     : auto;
}

/* ── Group ──────────────────────────────────────────────────────────────────── */
.gsuf-group { min-width: 120px; flex: 1 1 auto; }
.gsuf-app--sidebar .gsuf-group { width: 100%; min-width: 0; }

.gsuf-group__title {
    font-size      : .7rem;
    font-weight    : 700;
    letter-spacing : .09em;
    text-transform : uppercase;
    color          : var(--gsuf-title, #111);
    margin         : 0 0 10px;
    display        : flex;
    align-items    : center;
    justify-content: space-between;
    cursor         : default;
}
.gsuf-group--collapsible .gsuf-group__title { cursor: pointer; user-select: none; }
.gsuf-toggle-icon { transition: transform .2s; font-size: 14px !important; }
.gsuf-group--collapsible.is-collapsed .gsuf-toggle-icon { transform: rotate(-90deg); }
.gsuf-group--collapsible.is-collapsed .gsuf-group__body { display: none; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.gsuf-options--buttons { display: flex; flex-wrap: wrap; gap: var(--gsuf-gap, 8px); }

.gsuf-btn-term {
    display       : inline-flex;
    align-items   : center;
    gap           : 5px;
    padding       : 6px 13px;
    background    : var(--gsuf-btn-bg, #f0f0f0);
    color         : var(--gsuf-btn-text, #333);
    border        : 1px solid rgba(0,0,0,.08);
    border-radius : var(--gsuf-radius, 6px);
    font-size     : .82rem;
    font-weight   : 500;
    cursor        : pointer;
    transition    : background var(--gsuf-transition), color var(--gsuf-transition), transform .1s;
    line-height   : 1.3;
}
.gsuf-btn-term:hover {
    background: var(--gsuf-hover-bg, #b8943e);
    color     : var(--gsuf-hover-text, #fff);
}
.gsuf-btn-term.is-active {
    background : var(--gsuf-active-bg, #c9a84c);
    color      : var(--gsuf-active-text, #fff);
    border-color: transparent;
}
.gsuf-btn-term:active { transform: scale(.96); }
.gsuf-btn-term__cnt {
    font-size  : .72rem;
    opacity    : .75;
    font-weight: 400;
}

/* ── Checkbox / Radio ───────────────────────────────────────────────────────── */
.gsuf-options--checkbox, .gsuf-options--radio { display: flex; flex-direction: column; gap: 8px; }
.gsuf-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .85rem; }
.gsuf-opt input { width: 16px; height: 16px; accent-color: var(--gsuf-active-bg, #c9a84c); cursor: pointer; }
.gsuf-cnt { font-size: .75rem; color: #999; font-style: normal; }

/* ── Dropdown / Multiselect ─────────────────────────────────────────────────── */
.gsuf-select {
    width        : 100%;
    padding      : 8px 12px;
    border       : 1px solid #ddd;
    border-radius: var(--gsuf-radius, 6px);
    font-size    : .85rem;
    background   : #fff;
    cursor       : pointer;
}
.gsuf-select--multi { min-height: 100px; }

/* ── Range Slider ───────────────────────────────────────────────────────────── */
.gsuf-range-wrap { width: 100%; padding: 10px 0; }
.gsuf-range-track {
    position     : relative;
    height       : 6px;
    background   : #e0e0e0;
    border-radius: 3px;
    margin       : 20px 0 10px;
}
.gsuf-range-fill {
    position     : absolute;
    height       : 100%;
    background   : var(--gsuf-active-bg, #c9a84c);
    border-radius: 3px;
    left         : 0;
    width        : 100%;
}
.gsuf-range {
    position  : absolute;
    top       : 50%;
    transform : translateY(-50%);
    width     : 100%;
    height    : 6px;
    background: transparent;
    appearance: none;
    pointer-events: none;
}
.gsuf-range::-webkit-slider-thumb {
    appearance   : none;
    width        : 18px;
    height       : 18px;
    background   : var(--gsuf-active-bg, #c9a84c);
    border-radius: 50%;
    cursor       : pointer;
    pointer-events: all;
    border       : 2px solid #fff;
    box-shadow   : 0 1px 4px rgba(0,0,0,.2);
    transition   : transform .1s;
}
.gsuf-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.gsuf-range::-moz-range-thumb {
    width        : 18px;
    height       : 18px;
    background   : var(--gsuf-active-bg, #c9a84c);
    border-radius: 50%;
    cursor       : pointer;
    pointer-events: all;
    border       : 2px solid #fff;
}
.gsuf-range-labels { display: flex; justify-content: space-between; font-size: .82rem; color: #555; margin-top: 6px; }

/* ── Reset Button ───────────────────────────────────────────────────────────── */
.gsuf-filterbar__foot { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 4px; }
.gsuf-reset-btn {
    display      : inline-flex;
    align-items  : center;
    gap          : 5px;
    padding      : 6px 14px;
    background   : transparent;
    border       : 1px solid #ccc;
    border-radius: 6px;
    color        : #555;
    font-size    : .82rem;
    cursor       : pointer;
    transition   : all var(--gsuf-transition);
}
.gsuf-reset-btn:hover, .gsuf-reset-btn.has-filters {
    background   : #ff4757;
    border-color : #ff4757;
    color        : #fff;
}
.gsuf-active-summary { font-size: .8rem; color: var(--gsuf-gold); font-weight: 600; }

/* ── Results ────────────────────────────────────────────────────────────────── */
.gsuf-results__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 28px; }
.gsuf-count { font-size: .85rem; color: #666; }

/* ── Product Grid ───────────────────────────────────────────────────────────── */
.gsuf-grid {
    display              : grid;
    grid-template-columns: repeat(4, 1fr);
    gap                  : 20px;
    transition           : opacity .2s;
}
.gsuf-grid--loading { opacity: .45; pointer-events: none; }

/* ── Product Card ───────────────────────────────────────────────────────────── */
.gsuf-product {
    position     : relative;
    background   : #fff;
    border-radius: 10px;
    overflow     : hidden;
    box-shadow   : 0 1px 8px rgba(0,0,0,.06);
    transition   : box-shadow .2s, transform .2s;
}
.gsuf-product:hover { box-shadow: 0 4px 20px rgba(0,0,0,.12); transform: translateY(-2px); }

.gsuf-badge {
    position     : absolute;
    top          : 10px;
    left         : 10px;
    z-index      : 2;
    font-size    : .7rem;
    font-weight  : 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding      : 3px 8px;
    border-radius: 4px;
}
.gsuf-badge--sale { background: #c9a84c; color: #fff; }
.gsuf-badge--oos  { background: #555;    color: #fff; }

.gsuf-product__img-wrap { display: block; aspect-ratio: 1; overflow: hidden; background: #f5f5f5; }
.gsuf-product__img      { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gsuf-product:hover .gsuf-product__img { transform: scale(1.04); }

.gsuf-product__body { padding: 14px 14px 8px; }
.gsuf-product__name { margin: 0 0 6px; font-size: .9rem; line-height: 1.4; }
.gsuf-product__name a { text-decoration: none; color: inherit; }
.gsuf-product__name a:hover { color: var(--gsuf-gold); }
.gsuf-product__price { font-size: .95rem; font-weight: 700; color: #111; }
.gsuf-product__price del { color: #aaa; font-weight: 400; font-size: .85em; }
.gsuf-product__rating { margin-bottom: 4px; }

.gsuf-product__foot { padding: 0 14px 14px; }
.gsuf-atc-btn, .gsuf-view-btn {
    display      : block;
    width        : 100%;
    padding      : 9px;
    text-align   : center;
    font-size    : .82rem;
    font-weight  : 600;
    border-radius: 6px;
    cursor       : pointer;
    transition   : background var(--gsuf-transition);
    text-decoration: none;
    border       : none;
}
.gsuf-atc-btn  { background: #c9a84c; color: #fff; }
.gsuf-atc-btn:hover { background: #b8943e; }
.gsuf-view-btn { background: #f0f0f0; color: #333; }
.gsuf-view-btn:hover { background: #ddd; }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.gsuf-pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.gsuf-page {
    width        : 36px;
    height       : 36px;
    border       : 1px solid #ddd;
    background   : #fff;
    border-radius: 6px;
    cursor       : pointer;
    font-size    : .85rem;
    transition   : all var(--gsuf-transition);
}
.gsuf-page:hover    { background: #c9a84c; color: #fff; border-color: #c9a84c; }
.gsuf-page.is-current { background: #c9a84c; color: #fff; border-color: #c9a84c; font-weight: 700; }

/* ── Spinner ────────────────────────────────────────────────────────────────── */
.gsuf-spinner__ring {
    display      : block;
    width        : 22px;
    height       : 22px;
    border       : 3px solid rgba(201,168,76,.25);
    border-top-color: #c9a84c;
    border-radius: 50%;
    animation    : gsuf-spin .7s linear infinite;
}
@keyframes gsuf-spin { to { transform: rotate(360deg); } }

/* ── No results / Error ─────────────────────────────────────────────────────── */
.gsuf-no-results, .gsuf-error { text-align: center; padding: 40px; color: #888; font-size: .9rem; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .gsuf-app--sidebar { grid-template-columns: 220px 1fr; }
    .gsuf-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
    .gsuf-app--sidebar { grid-template-columns: 1fr; }
    .gsuf-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .gsuf-filterbar { padding: 14px 16px; gap: 14px; }
}
@media (max-width: 480px) {
    .gsuf-grid { grid-template-columns: 1fr !important; }
}

/* ── Notices ────────────────────────────────────────────────────────────────── */
.gsuf-notice {
    background   : #fff8e5;
    border-left  : 4px solid #c9a84c;
    padding      : 12px 16px;
    font-size    : .85rem;
    border-radius: 4px;
    margin       : 12px 0;
}
