/* 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: 240px 1fr;
        gap: 40px;
    }
}

/* Facets sidebar */
.grg-ts-facets {
    display: none;
}

@media (min-width: 1024px) {
    .grg-ts-facets { display: block; }
}

.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;
}
