/* GRG Typesense — Full Search Results Page */

.grg-ts-search-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 16px;
}

@media (min-width: 640px) {
    .grg-ts-search-page { padding: 32px 24px; }
}

/* Search bar */
.grg-ts-search-bar {
    margin-bottom: 24px;
}

.grg-ts-search-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 2px solid #e4e4e7;
    border-radius: 12px;
    padding: 4px 16px;
    transition: border-color 0.15s;
}

.grg-ts-search-bar-inner:focus-within {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.grg-ts-search-bar-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #a1a1aa;
}

.grg-ts-search-bar-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 0;
    font-size: 16px;
    color: #18181b;
    background: transparent;
}

.grg-ts-search-bar-input::placeholder { color: #a1a1aa; }

.grg-ts-search-bar-clear {
    flex-shrink: 0;
    padding: 4px;
    color: #a1a1aa;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
}

.grg-ts-search-bar-clear:hover { color: #52525b; }

/* Toolbar */
.grg-ts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e4e4e7;
}

.grg-ts-result-count {
    font-size: 14px;
    color: #52525b;
}

.grg-ts-search-time {
    font-size: 12px;
    color: #a1a1aa;
    margin-left: 4px;
}

.grg-ts-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #52525b;
}

.grg-ts-sort-wrap select {
    border: 1px solid #d4d4d8;
    border-radius: 8px;
    padding: 6px 32px 6px 12px;
    font-size: 14px;
    color: #18181b;
    background: #fff;
    appearance: auto;
}

/* Layout */
.grg-ts-layout {
    display: grid;
    gap: 32px;
}

@media (min-width: 1024px) {
    .grg-ts-layout {
        grid-template-columns: 260px 1fr;
        gap: 40px;
        align-items: start;
    }
}

/* ── Filter sidebar (standaard categorie-filter look) ── */
[x-cloak] { display: none !important; }

.grg-ts-facet-overlay {
    position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45);
}
@media (min-width: 1024px) { .grg-ts-facet-overlay { display: none !important; } }

.grg-ts-facets {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: 320px; max-width: 85vw; background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    transform: translateX(-100%); transition: transform .3s ease; overflow-y: auto;
}
.grg-ts-facets.is-open { transform: translateX(0); }
.grg-ts-facets-inner { padding: 24px; }
@media (min-width: 1024px) {
    .grg-ts-facets {
        position: sticky; top: 24px; width: auto; max-width: none;
        box-shadow: none; transform: none; overflow: visible; z-index: auto;
    }
    .grg-ts-facets-inner { padding: 0; }
    .grg-ts-facets-mhead, .grg-ts-facets-mfoot { display: none; }
}

.grg-ts-facets-mhead {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.grg-ts-facets-mhead span { font-size: 18px; font-weight: 700; color: #18181b; }
.grg-ts-facets-mhead button { color: #a1a1aa; background: none; border: none; cursor: pointer; padding: 4px; }

.grg-ts-fgroup { margin-bottom: 28px; }
.grg-ts-fgroup:last-child { margin-bottom: 0; }
.grg-ts-fgroup-title { display: block; font-size: 14px; font-weight: 700; color: #20454b; margin-bottom: 12px; }

.grg-ts-cat-search { position: relative; margin-bottom: 12px; }
.grg-ts-cat-search input {
    width: 100%; font-size: 14px; color: #3f3f46; padding: 10px 36px 10px 40px;
    background: #fff; border: 1px solid #e4e4e7; border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
.grg-ts-cat-search input:focus { outline: none; border-color: #20454b; box-shadow: 0 0 0 3px rgba(32,69,75,.12); }
.grg-ts-cat-search input::placeholder { color: #a1a1aa; }
.grg-ts-cat-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #a1a1aa; pointer-events: none; }
.grg-ts-cat-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 999px; color: #a1a1aa; background: none; border: none; cursor: pointer; }
.grg-ts-cat-search-clear:hover { background: #f4f4f5; color: #52525b; }

.grg-ts-flist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.grg-ts-fitem { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.grg-ts-check {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 5px; border: 1px solid #d4d4d8;
    display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s;
}
.grg-ts-fitem:hover .grg-ts-check { border-color: #a1a1aa; }
.grg-ts-check.checked { background: #20454b; border-color: #20454b; }
.grg-ts-check svg { width: 12px; height: 12px; color: #fff; }
.grg-ts-fitem-label { flex: 1; color: #3f3f46; }
.grg-ts-fitem:hover .grg-ts-fitem-label { color: #18181b; }
.grg-ts-fitem-count { font-size: 12px; color: #a1a1aa; }
.grg-ts-fempty { font-size: 14px; color: #a1a1aa; font-style: italic; padding: 4px 0; }
.grg-ts-more { margin-top: 10px; font-size: 12px; font-weight: 500; color: #20454b; background: none; border: none; cursor: pointer; padding: 0; }
.grg-ts-more:hover { text-decoration: underline; }

.grg-ts-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.grg-ts-chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #20454b;
    background: #f0f7f8; padding: 5px 10px; border-radius: 999px; border: none; cursor: pointer;
}
.grg-ts-chip:hover { background: #e2eef0; }
.grg-ts-chip svg { width: 12px; height: 12px; }

.grg-ts-price-labels { display: flex; justify-content: space-between; font-size: 12px; color: #71717a; margin-bottom: 8px; }
.grg-ts-range { position: relative; height: 6px; background: #e4e4e7; border-radius: 999px; margin: 10px 0 22px; }
.grg-ts-range-fill { position: absolute; height: 100%; background: #20454b; border-radius: 999px; pointer-events: none; }
.grg-ts-range-thumb {
    position: absolute; top: 50%; transform: translateY(-50%); width: 100%; height: 6px; margin: 0;
    background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.grg-ts-range-thumb::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 2px solid #20454b; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.grg-ts-range-thumb::-moz-range-thumb {
    pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #20454b; cursor: pointer;
}
.grg-ts-price-inputs { display: flex; align-items: center; gap: 8px; }
.grg-ts-price-inputs input {
    width: 100%; border: 1px solid #e4e4e7; border-radius: 8px; padding: 6px 8px; font-size: 14px;
    text-align: center; color: #18181b; -moz-appearance: textfield;
}
.grg-ts-price-inputs input::-webkit-outer-spin-button, .grg-ts-price-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.grg-ts-price-inputs input:focus { outline: none; border-color: #20454b; box-shadow: 0 0 0 3px rgba(32,69,75,.12); }
.grg-ts-price-inputs span { color: #a1a1aa; }

.grg-ts-toolbar-left { display: flex; align-items: center; gap: 12px; }
.grg-ts-filter-btn {
    display: inline-flex; align-items: center; gap: 6px; position: relative; font-size: 14px; color: #20454b;
    background: #fff; border: 1px solid #e4e4e7; border-radius: 8px; padding: 7px 12px; cursor: pointer;
}
.grg-ts-filter-btn:hover { border-color: #20454b; }
.grg-ts-filter-dot { position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; background: #f18700; border-radius: 999px; }
@media (min-width: 1024px) { .grg-ts-filter-btn { display: none; } }

.grg-ts-facets-mfoot { margin-top: 24px; }
.grg-ts-apply-btn { width: 100%; background: #20454b; color: #fff; border: none; border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }

.grg-ts-facet-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e4e4e7;
}

.grg-ts-facet-section:last-child {
    border-bottom: none;
}

.grg-ts-facet-title {
    font-size: 13px;
    font-weight: 600;
    color: #18181b;
    margin-bottom: 10px;
}

.grg-ts-facet-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: #18181b;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-bottom: 10px;
}

.grg-ts-facet-chevron {
    width: 16px;
    height: 16px;
    color: #a1a1aa;
    transition: transform 0.2s;
}

.grg-ts-facet-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 14px;
    cursor: pointer;
}

.grg-ts-facet-item:hover .grg-ts-facet-label { color: #18181b; }

.grg-ts-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #d4d4d8;
    transition: all 0.15s;
    flex-shrink: 0;
}

.grg-ts-checkbox.checked {
    background: #059669;
    border-color: #059669;
}

.grg-ts-facet-label {
    flex: 1;
    color: #52525b;
    transition: color 0.15s;
}

.grg-ts-facet-count {
    font-size: 12px;
    color: #a1a1aa;
    margin-left: auto;
}

/* Active filters */
.grg-ts-active-filters {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e4e4e7;
}

.grg-ts-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    margin: 4px 4px 0 0;
    transition: background 0.15s;
}

.grg-ts-active-chip:hover { background: #d1fae5; }

.grg-ts-clear-link {
    display: block;
    font-size: 12px;
    color: #71717a;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 8px;
    padding: 0;
}

.grg-ts-clear-link:hover { color: #dc2626; }

/* Collection tabs */
.grg-ts-collection-tabs {
    display: flex;
    gap: 4px;
}

.grg-ts-tab {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #52525b;
    background: #f4f4f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.grg-ts-tab:hover { background: #e4e4e7; }
.grg-ts-tab.active { background: #059669; color: #fff; }

/* Results grid */
.grg-ts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .grg-ts-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Result card */
.grg-ts-result-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.grg-ts-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d4d4d8;
}

.grg-ts-card-thumb {
    position: relative;
    aspect-ratio: 1;
    background: #f4f4f5;
    overflow: hidden;
}

.grg-ts-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grg-ts-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d4d4d8;
}

.grg-ts-sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.grg-ts-card-info {
    padding: 12px;
}

.grg-ts-card-cat {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a1a1aa;
    margin-bottom: 4px;
}

.grg-ts-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #18181b;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grg-ts-card-price {
    font-size: 14px;
    font-weight: 600;
    color: #059669;
}

.grg-ts-card-price del {
    color: #a1a1aa;
    font-weight: 400;
}

.grg-ts-card-price ins {
    text-decoration: none;
}

.grg-ts-card-date {
    font-size: 12px;
    color: #a1a1aa;
}

.grg-ts-card-excerpt {
    font-size: 13px;
    color: #71717a;
    line-height: 1.4;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading */
.grg-ts-page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
    color: #71717a;
    font-size: 14px;
}

.grg-ts-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e4e4e7;
    border-top-color: #059669;
    border-radius: 50%;
    animation: grg-ts-spin 0.6s linear infinite;
}

@keyframes grg-ts-spin {
    to { transform: rotate(360deg); }
}

/* No results */
.grg-ts-no-results-page {
    text-align: center;
    padding: 60px 16px;
}

.grg-ts-no-results-page h3 {
    font-size: 18px;
    font-weight: 600;
    color: #18181b;
    margin-bottom: 8px;
}

.grg-ts-no-results-page p {
    color: #71717a;
    margin-bottom: 16px;
}

.grg-ts-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #059669;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.grg-ts-clear-btn:hover { background: #047857; }

/* Pagination */
.grg-ts-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e4e4e7;
}

.grg-ts-page-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #18181b;
    background: #fff;
    border: 1px solid #d4d4d8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.grg-ts-page-btn:hover:not(:disabled) {
    background: #f4f4f5;
    border-color: #a1a1aa;
}

.grg-ts-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.grg-ts-page-info {
    font-size: 14px;
    color: #71717a;
}
