/**
 * Global Search Page Styles
 * Add this to your theme's stylesheet or enqueue separately
 */

/* Search Page Container */
.leco-search-page {
    --filter-border: #e5e7eb;
    --filter-heading-color: #1f2937;
    --checkbox-color: #2563eb;
    --tag-bg: #1e3a8a;
    --tag-text: #ffffff;
    --card-border: #e5e7eb;
    --card-hover-shadow: rgba(0, 0, 0, 0.08);
}

/* Left Sidebar - Filters */
.search-filters-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid var(--filter-border);
    padding: 1.25rem 0;
}

.filter-section:first-child {
    padding-top: 0;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--filter-heading-color);
    margin: 0 0 1rem 0;
    cursor: pointer;
    user-select: none;
}

.filter-heading span {
    flex: 1;
}

.filter-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
    color: #6b7280;
}

.filter-toggle svg {
    width: 14px;
    height: 14px;
}

.filter-section.expanded .filter-toggle {
    transform: rotate(180deg);
}

.filter-content {
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.filter-section:not(.expanded) .filter-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

/* Custom Scrollbar for Filter Content */
.filter-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Loading Spinner for Filters */
.filter-heading::after {
    content: '';
    display: none;
    width: 14px;
    height: 14px;
    margin-left: 0.5rem;
    border: 2px solid var(--filter-border);
    border-top-color: var(--checkbox-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.filter-section.is-loading .filter-heading::after {
    display: block;
}

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

/* Refinement List Styling */
.refinement-list {
    margin: 0;
    padding: 0;
}

.refinement-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.refinement-item {
    margin: 0 0 0.625rem 0;
}

.refinement-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4b5563;
    transition: color 0.2s ease;
    padding: 0.125rem 0;
}

.refinement-label:hover {
    color: #1f2937;
}

.refinement-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    position: relative;
    transition: all 0.15s ease;
    background-color: white;
}

.refinement-checkbox:hover {
    border-color: #9ca3af;
}

.refinement-checkbox:checked {
    background-color: var(--checkbox-color);
    border-color: var(--checkbox-color);
}

.refinement-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.refinement-text {
    flex: 1;
    line-height: 1.4;
}

.refinement-count {
    color: #9ca3af;
    font-size: 0.8125rem;
    margin-left: auto;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--checkbox-color);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.5rem 0 0 0;
    text-decoration: none;
    transition: opacity 0.2s ease;
    font-weight: 500;
}

.show-more-btn:hover {
    text-decoration: underline;
}

/* Right Side - Search Results */
.search-results-content {
    min-height: 60vh;
}

.search-header {
    margin-bottom: 2rem;
}

#search-stats,
.ais-Stats {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 2rem 0 !important;
    color: #1f2937;
    line-height: 1.3;
    padding-bottom: 0.75rem;
}

.ais-Stats-text {
    font-size: 1.5rem;
    font-weight: 400;
    color: #1f2937;
}

/* Search Controls */
.search-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: center;
    margin-top: 1.25rem;
}

.search-box-wrapper {
    flex: 1;
    min-width: 0;
}

/* InstantSearch renders a form inside search-box-wrapper */
.search-box-wrapper form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box-wrapper .ais-SearchBox-form {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-box-wrapper .ais-SearchBox-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.5rem !important;
    border: 1.5px solid var(--filter-border) !important;
    border-radius: 4px !important;
    font-size: 0.9375rem !important;
    transition: all 0.2s ease;
    background-color: white !important;
    box-sizing: border-box;
    line-height: 1.5;
}

.search-box-wrapper .ais-SearchBox-input:focus {
    outline: none !important;
    border-color: var(--checkbox-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.search-box-wrapper .ais-SearchBox-submit,
.search-box-wrapper .ais-SearchBox-reset {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: #6b7280;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    transform: translateY(-50%);
}

.search-box-wrapper .ais-SearchBox-submit {
    left: 0.5rem;
    pointer-events: none;
}

.search-box-wrapper .ais-SearchBox-reset {
    right: 0.5rem;
}

.search-box-wrapper .ais-SearchBox-submit:hover,
.search-box-wrapper .ais-SearchBox-reset:hover {
    color: var(--checkbox-color);
}

.search-box-wrapper .ais-SearchBox-submitIcon,
.search-box-wrapper .ais-SearchBox-resetIcon {
    width: 16px;
    height: 16px;
}

/* Hide loading indicator */
.search-box-wrapper .ais-SearchBox-loadingIndicator {
    display: none;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sort-wrapper label {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
}

.ais-SortBy-select,
.sort-select {
    padding: 0.625rem 2rem 0.625rem 0.75rem !important;
    border: 1.5px solid var(--filter-border) !important;
    border-radius: 4px !important;
    font-size: 0.875rem !important;
    background-color: white !important;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: all 0.2s ease;
    min-width: 150px;
}

.ais-SortBy-select:focus,
.sort-select:focus {
    outline: none !important;
    border-color: var(--checkbox-color) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* Active Filters Row */
.active-filters-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    min-height: 32px;
}

.current-refinements {
    flex: 1;
    display: flex;
    align-items: center;
}

.refinement-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ais-CurrentRefinements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ais-CurrentRefinements-item {
    margin: 0;
}

.ais-CurrentRefinements-label {
    display: none !important; /* Hide the "Taxonomies.product-line:" label */
}

.ais-CurrentRefinements-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0;
}

.ais-CurrentRefinements-categoryLabel {
    line-height: 1.4;
}

.ais-CurrentRefinements-delete {
    background: none;
    border: none;
    color: var(--tag-text);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: background-color 0.2s ease;
    margin-left: 0.25rem;
}

.ais-CurrentRefinements-delete:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.refinement-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.tag-label {
    line-height: 1.4;
}

.tag-remove {
    background: none;
    border: none;
    color: var(--tag-text);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: background-color 0.2s ease;
    margin-left: 0.25rem;
}

.tag-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Clear Refinements Button */
.clear-refinements {
    display: flex;
    align-items: center;
}

.clear-all-btn {
    background: none;
    border: none;
    color: var(--checkbox-color);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
    padding: 0.375rem 0.5rem;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    font-weight: 500;
}

.clear-all-btn:hover {
    opacity: 0.7;
}

.clear-all-btn-disabled {
    display: none;
}

/* Search Results Grid */
.search-results-grid {
    margin-bottom: 3rem;
}

.hits-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hit-item {
    margin: 0;
}

.search-result-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: white;
}

.search-result-card:hover {
    box-shadow: 0 4px 12px var(--card-hover-shadow);
    transform: translateY(-2px);
    border-color: #d1d5db;
}

.result-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background-color: #f9fafb;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-image-placeholder {
    color: #d1d5db;
}

.result-image-placeholder svg {
    width: 48px;
    height: 48px;
}

.result-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-type {
    font-size: 0.6875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 600;
}

.result-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 0.625rem 0;
    line-height: 1.4;
    color: #1f2937;
}

.result-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-title a:hover {
    color: var(--checkbox-color);
}

.result-excerpt {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.result-meta {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin: 0.75rem 0 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.no-results svg {
    margin: 0 auto 1.5rem;
    opacity: 0.2;
    width: 64px;
    height: 64px;
}

.no-results h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
}

.no-results p {
    margin: 0.5rem 0;
    font-size: 0.9375rem;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-list {
    display: flex;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-item {
    margin: 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--filter-border);
    background-color: white;
    color: #4b5563;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.page-link:hover {
    background-color: #f9fafb;
    border-color: var(--checkbox-color);
    color: var(--checkbox-color);
}

.page-item-active .page-link {
    background-color: var(--checkbox-color);
    color: white;
    border-color: var(--checkbox-color);
}

.page-item-disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-item-disabled .page-link:hover {
    background-color: white;
    border-color: var(--filter-border);
    color: #4b5563;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hits-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .wp-block-columns {
        flex-direction: column;
    }
    
    .search-filters-sidebar,
    .search-results-content {
        width: 100% !important;
        flex-basis: 100% !important;
    }
    
    .search-filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .hits-list {
        grid-template-columns: 1fr;
    }
    
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-wrapper {
        justify-content: space-between;
    }
    
    #search-stats {
        font-size: 1.25rem;
    }
    
    .result-content {
        padding: 1rem;
    }
}

/* Algolia Highlighting */
.ais-Highlight-highlighted,
em {
    background-color: #fef3c7;
    font-style: normal;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* Hide elements when empty */
.current-refinements:empty {
    display: none;
}

.refinement-tags:empty + .clear-all-btn {
    display: none;
}


/* Left Sidebar - Filters */
.search-filters-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid var(--filter-border);
    padding: 1.5rem 0;
}

.filter-section:first-child {
    padding-top: 0;
}

.filter-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--filter-heading-color);
    margin: 0 0 1rem 0;
    cursor: pointer;
    user-select: none;
}

.filter-heading span {
    flex: 1;
}

.filter-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    color: var(--filter-heading-color);
}

.filter-section.expanded .filter-toggle {
    transform: rotate(180deg);
}

.filter-content {
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.filter-section:not(.expanded) .filter-content {
    max-height: 0;
    overflow: hidden;
}

/* Loading Spinner for Filters */
.filter-heading::after {
    content: '';
    display: none;
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    border: 2px solid var(--filter-border);
    border-top-color: var(--checkbox-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.filter-section.is-loading .filter-heading::after {
    display: block;
}

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

/* Refinement List Styling */
.refinement-list {
    margin: 0;
    padding: 0;
}

.refinement-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.refinement-item {
    margin: 0 0 0.75rem 0;
}

.refinement-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: color 0.2s ease;
}

.refinement-label:hover {
    color: #333;
}

.refinement-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    position: relative;
    transition: all 0.2s ease;
}

.refinement-checkbox:checked {
    background-color: var(--checkbox-color);
    border-color: var(--checkbox-color);
}

.refinement-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.refinement-text {
    flex: 1;
}

.refinement-count {
    color: #999;
    font-size: 0.85rem;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--checkbox-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.show-more-btn:hover {
    opacity: 0.8;
}

/* Right Side - Search Results */
.search-results-content {
    min-height: 60vh;
}

.search-header {
    margin-bottom: 2rem;
}

#search-stats {
    font-size: 1.75rem;
    font-weight: 300;
    margin: 0 0 1.5rem 0;
    color: #333;
}

/* Search Controls */
.search-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.search-box-wrapper {
    flex: 1;
}

.search-box {
    position: relative;
}

.search-box .search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 1px solid var(--filter-border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-box .search-input:focus {
    outline: none;
    border-color: var(--checkbox-color);
}

.search-box .search-submit,
.search-box .search-reset {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #666;
    transition: color 0.2s ease;
}

.search-box .search-submit {
    left: 0.5rem;
}

.search-box .search-reset {
    right: 0.5rem;
}

.search-box .search-submit:hover,
.search-box .search-reset:hover {
    color: var(--checkbox-color);
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-wrapper label {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.sort-select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid var(--filter-border);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    transition: border-color 0.2s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--checkbox-color);
}

/* Active Filters Row */
.active-filters-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    min-height: 36px;
}

.current-refinements {
    flex: 1;
    display: flex;
    align-items: center;
}

.refinement-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.refinement-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.tag-label {
    margin-right: 0.25rem;
}

.tag-remove {
    background: none;
    border: none;
    color: var(--tag-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.tag-remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Clear Refinements Button */
.clear-refinements {
    display: flex;
    align-items: center;
}

.clear-all-btn {
    background: none;
    border: none;
    color: var(--checkbox-color);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0.5rem;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.clear-all-btn:hover {
    opacity: 0.8;
}

.clear-all-btn-disabled {
    display: none;
}

/* Search Results Grid */
.search-results-grid {
    margin-bottom: 3rem;
}

.hits-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hit-item {
    margin: 0;
}

.search-result-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.search-result-card:hover {
    box-shadow: 0 4px 12px var(--card-hover-shadow);
    transform: translateY(-2px);
}

.result-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.result-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-type {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: block;
    font-weight: 600;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.result-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-title a:hover {
    color: var(--checkbox-color);
}

.result-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.result-meta {
    font-size: 0.85rem;
    color: #999;
    margin: 0.75rem 0 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-results svg {
    margin: 0 auto 1.5rem;
    opacity: 0.3;
}

.no-results h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.no-results p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-list {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-item {
    margin: 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--filter-border);
    background-color: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.page-link:hover {
    background-color: #f5f5f5;
    border-color: var(--checkbox-color);
    color: var(--checkbox-color);
}

.page-item-active .page-link {
    background-color: var(--checkbox-color);
    color: white;
    border-color: var(--checkbox-color);
}

.page-item-disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-item-disabled .page-link:hover {
    background-color: white;
    border-color: var(--filter-border);
    color: #333;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hits-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .wp-block-columns {
        flex-direction: column;
    }
    
    .search-filters-sidebar,
    .search-results-content {
        width: 100% !important;
        flex-basis: 100% !important;
    }
    
    .search-filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .hits-list {
        grid-template-columns: 1fr;
    }
    
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-wrapper {
        justify-content: space-between;
    }
    
    #search-stats {
        font-size: 1.5rem;
    }
    
    .result-content {
        padding: 1.25rem;
    }
}

/* Algolia Highlighting */
.ais-Highlight-highlighted,
em {
    background-color: #fff4cc;
    font-style: normal;
    font-weight: 600;
}

/* Hide elements when empty */
.current-refinements:empty {
    display: none;
}

.refinement-tags:empty + .clear-all-btn {
    display: none;
}