/**
 * Search Sight - Minimal Clean Design
 */

* { box-sizing: border-box; }

.searchsight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: #fff;
    display: none;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
}

.searchsight-overlay.active { display: flex; }

/* Header */
.searchsight-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 40px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.searchsight-logo {
    height: 28px;
    width: auto;
}

.searchsight-logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

/* Search Input */
.searchsight-search-container {
    flex: 1;
    max-width: 500px;
}

.searchsight-search-box {
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid #1a1a1a;
}

.searchsight-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    outline: none;
}

.searchsight-input::placeholder {
    color: #999;
    font-weight: 400;
}

.searchsight-clear-btn {
    padding: 6px 12px;
    font-size: 13px;
    color: #666 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: none;
}

.searchsight-clear-btn.active { display: block; }
.searchsight-clear-btn:hover { color: #1a1a1a !important; }

.searchsight-search-btn {
    padding: 8px;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: #1a1a1a !important;
}

/* Close Button */
.searchsight-header-actions { margin-left: auto; }

.searchsight-close {
    width: 36px;
    height: 36px;
    border: none !important;
    background: #1a1a1a !important;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    transition: background 0.2s;
}

.searchsight-close:hover { background: #333 !important; }
.searchsight-close svg { width: 14px; height: 14px; }

/* Main Content */
.searchsight-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.searchsight-sidebar {
    width: 240px;
    border-right: 1px solid #eee;
    padding: 24px;
    overflow-y: auto;
    background: #fff;
    transition: width 0.2s, padding 0.2s, opacity 0.2s;
}

.searchsight-sidebar.hidden {
    width: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
}

.searchsight-sidebar.hidden #searchsight-filters {
    display: none;
}

/* Collapsed sidebar - button visible, filters hidden */
.searchsight-sidebar.collapsed {
    width: auto !important;
    min-width: 160px !important;
    padding: 24px !important;
    overflow: visible !important;
    opacity: 1 !important;
}

.searchsight-sidebar.collapsed .searchsight-filters-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 0 !important;
}

.searchsight-sidebar.collapsed #searchsight-filters {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Filters toggle button */
.searchsight-filters-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #333 !important;
    background: #f5f5f5 !important;
    border: none !important;
    padding: 10px 14px !important;
    border-radius: 4px !important;
    margin-bottom: 24px;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
}

.searchsight-filters-toggle:hover {
    background: #eee !important;
}

.searchsight-filters-toggle svg { 
    width: 16px; 
    height: 16px; 
    flex-shrink: 0;
}

.searchsight-filter-group { margin-bottom: 28px; }

.searchsight-filter-title {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a !important;
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.searchsight-filter-title svg {
    width: 12px;
    height: 12px;
    color: #999;
}

.searchsight-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.searchsight-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.searchsight-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #1a1a1a;
}

.searchsight-filter-option label,
.searchsight-filter-option .label {
    flex: 1;
    font-size: 13px;
    color: #1a1a1a !important;
}

.searchsight-filter-option .count {
    font-size: 12px;
    color: #666 !important;
}

/* Price Range */
.searchsight-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.searchsight-price-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.searchsight-price-input:focus {
    outline: none;
    border-color: #1a1a1a;
}

.searchsight-price-sep {
    color: #ccc;
    font-size: 11px;
}

/* Content Area */
.searchsight-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafafa;
}

/* Results Header */
.searchsight-results-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 40px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.searchsight-results-count {
    font-size: 13px;
    color: #666;
    margin-right: auto;
}

.searchsight-results-count strong {
    color: #1a1a1a;
    font-weight: 600;
}

.searchsight-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.searchsight-sort-label {
    font-size: 13px;
    color: #666;
}

.searchsight-sort-select {
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
    appearance: none;
    cursor: pointer;
}

.searchsight-sort-select:focus {
    outline: none;
    border-color: #1a1a1a;
}

/* Results Grid */
.searchsight-results {
    flex: 1;
    overflow-y: auto;
    padding: 28px 40px;
}

.searchsight-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Product Card */
.searchsight-product {
    background: #fff;
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s;
}

.searchsight-product:hover {
    transform: translateY(-2px);
}

.searchsight-product-image-wrap {
    position: relative;
    padding-top: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

.searchsight-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.searchsight-product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #1a1a1a;
    color: #fff;
}

.searchsight-product-badge.outofstock { background: #888; }

.searchsight-product-info {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.searchsight-product-title {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a !important;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.searchsight-product-title mark {
    background: #fff3cd;
    color: inherit;
}

.searchsight-product-category {
    font-size: 12px;
    color: #888 !important;
    margin: 0;
}

.searchsight-product-price {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a !important;
    margin-top: 4px;
}

.searchsight-product-price del {
    color: #aaa !important;
    font-weight: 400;
    margin-right: 6px;
}

.searchsight-product-price .sale-price {
    color: #c00 !important;
}

/* States */
.searchsight-loading,
.searchsight-no-results,
.searchsight-initial {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.searchsight-loading.active,
.searchsight-no-results.active,
.searchsight-initial.active { display: flex; }

.searchsight-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #eee;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-bottom: 16px;
}

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

.searchsight-state-icon {
    width: 48px;
    height: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.searchsight-state-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.searchsight-state-text {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* Footer */
.searchsight-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    background: #fff;
    border-top: 1px solid #eee;
}

.searchsight-powered {
    font-size: 11px;
    color: #aaa;
}

.searchsight-powered a {
    color: #666;
    text-decoration: none;
}

.searchsight-keyboard-hints {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: #aaa;
}

.searchsight-keyboard-hints kbd {
    padding: 2px 5px;
    font-size: 10px;
    background: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 3px;
    margin-right: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .searchsight-sidebar { display: none; }
    .searchsight-header { padding: 16px 20px; gap: 16px; }
    .searchsight-results { padding: 20px; }
    .searchsight-results-header { padding: 12px 20px; }
    .searchsight-footer { padding: 10px 20px; }
    .searchsight-products-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .searchsight-keyboard-hints { display: none; }
}

@media (max-width: 500px) {
    .searchsight-logo, .searchsight-logo-text { display: none; }
    .searchsight-input { font-size: 16px; }
    .searchsight-products-grid { gap: 12px; }
    .searchsight-product-info { padding: 10px 0; }
}

/* Force override theme styles */
.searchsight-overlay button,
.searchsight-overlay .searchsight-clear-btn,
.searchsight-overlay .searchsight-search-btn,
.searchsight-overlay .searchsight-close,
.searchsight-overlay .searchsight-filters-toggle {
    box-shadow: none !important;
    text-shadow: none !important;
}

.searchsight-overlay .searchsight-clear-btn {
    background: #f5f5f5 !important;
    color: #666 !important;
    border-radius: 4px !important;
    padding: 8px 14px !important;
}

.searchsight-overlay .searchsight-clear-btn:hover {
    background: #eee !important;
    color: #333 !important;
}

.searchsight-overlay .searchsight-search-btn {
    background: none !important;
    color: #333 !important;
    padding: 8px !important;
}

.searchsight-overlay .searchsight-close {
    background: #1a1a1a !important;
    color: #fff !important;
    position: absolute !important;
    top: 20px !important;
    right: 40px !important;
}

/* Force filter title text to be BLACK - very strong override */
.searchsight-overlay h4.searchsight-filter-title,
.searchsight-overlay .searchsight-filter-title,
.searchsight-sidebar h4,
.searchsight-sidebar .searchsight-filter-title,
#searchsight-filters h4,
#searchsight-filters .searchsight-filter-title,
.searchsight-filter-group h4,
.searchsight-filter-group .searchsight-filter-title,
.searchsight-overlay .searchsight-sidebar h4,
.searchsight-overlay #searchsight-filters h4,
.searchsight-overlay .searchsight-filter-group h4 {
    color: #1a1a1a !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #1a1a1a !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 0 14px 0 !important;
    visibility: visible !important;
    display: block !important;
    background: transparent !important;
    border: none !important;
    text-shadow: none !important;
}

.searchsight-overlay .searchsight-filter-option .label,
.searchsight-overlay .searchsight-filter-option label,
.searchsight-sidebar label,
#searchsight-filters label,
.searchsight-filter-options label,
.searchsight-overlay .searchsight-sidebar label,
.searchsight-overlay #searchsight-filters label {
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Override Price title specifically */
.searchsight-filter-group:last-child h4,
.searchsight-filter-group:last-child .searchsight-filter-title {
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
}
