/**
 * RV Inventory Search - Styles
 * Based on the styling from inventaire-vr.astro
 */

/* Container Styles */
.rv-search-form-container,
.rv-search-results-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.rv-search-results-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* Search Form Styles */
.rv-search-form {
    background: #f9fafb;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rv-search-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.rv-search-field {
    display: flex;
    flex-direction: column;
}

.rv-search-field label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.rv-search-field input[type="text"],
.rv-search-field select {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.rv-radio-group,
.rv-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rv-radio-group label,
.rv-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.rv-search-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.rv-search-submit,
.rv-button-primary {
    background: #2563eb;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.rv-search-submit:hover,
.rv-button-primary:hover {
    background: #1d4ed8;
}

.rv-search-reset,
.rv-button-secondary {
    background: #6b7280;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.rv-search-reset:hover,
.rv-button-secondary:hover {
    background: #4b5563;
}

/* Filters Sidebar */
.rv-filters-sidebar {
    background: #1f2937;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.rv-filters-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

.rv-filter-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #374151;
}

.rv-filter-section:last-child {
    border-bottom: none;
}

.rv-filter-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.rv-filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: #374151;
    color: white;
    font-size: 14px;
}

.rv-filter-select option {
    background: #374151;
    color: white;
}

.rv-search-inline {
    display: flex;
    gap: 8px;
}

.rv-search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: #374151;
    color: white;
    font-size: 14px;
}

.rv-search-button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
}

/* Range Sliders */
.rv-range-slider {
    margin-top: 12px;
}

.rv-range-track {
    position: relative;
    height: 8px;
    background: #374151;
    border-radius: 4px;
    margin-bottom: 12px;
}

.rv-range-active {
    position: absolute;
    height: 8px;
    background: #2563eb;
    border-radius: 4px;
    top: 0;
}

.rv-range-input {
    position: absolute;
    width: 100%;
    height: 8px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    z-index: 2;
}

.rv-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

.rv-range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

.rv-range-input::-webkit-slider-track {
    background: transparent;
}

.rv-range-input::-moz-range-track {
    background: transparent;
}

.rv-range-display {
    display: flex;
    justify-content: space-between;
    color: #d1d5db;
    font-size: 14px;
}

/* Dropdown Filters */
.rv-filter-dropdown-toggle {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    color: white;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.rv-filter-dropdown-toggle i {
    transition: transform 0.2s;
}

.rv-filter-dropdown-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.rv-filter-dropdown-content {
    margin-top: 8px;
    background: #374151;
    border: 1px solid #4b5563;
    border-radius: 6px;
    padding: 16px;
    max-height: 256px;
    overflow-y: auto;
}

.rv-filter-dropdown-content.hidden {
    display: none;
}

.rv-filter-dropdown-content label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    margin-bottom: 8px;
    cursor: pointer;
}

.rv-filter-dropdown-content input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Filter Actions */
.rv-filter-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rv-filter-actions button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

/* Results Area */
.rv-results-area {
    flex: 1;
}

.rv-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rv-results-count {
    font-size: 14px;
    color: #6b7280;
}

.rv-results-sort {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rv-results-sort label {
    font-weight: 600;
    color: #374151;
}

.rv-sort-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* Products Grid */
.rv-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.rv-product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.rv-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rv-product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}

.rv-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rv-product-content {
    padding: 16px;
}

.rv-product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.rv-product-title a {
    color: #1f2937;
    text-decoration: none;
}

.rv-product-title a:hover {
    color: #2563eb;
}

.rv-product-stock {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.rv-product-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.rv-product-spec {
    font-size: 14px;
    color: #4b5563;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.rv-product-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rv-price-regular {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.rv-price-sale {
    font-size: 20px;
    font-weight: 600;
    color: #dc2626;
}

.rv-price-regular.strikethrough {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 16px;
}

/* No Results */
.rv-no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rv-no-results p {
    font-size: 18px;
    color: #6b7280;
}

/* Lazy Loading */
.lazy-load-product.lazy-hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .rv-search-results-container {
        grid-template-columns: 1fr;
    }
    
    .rv-filters-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .rv-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .rv-search-form-grid {
        grid-template-columns: 1fr;
    }
    
    .rv-results-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .rv-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling for Filters Sidebar */
.rv-filters-sidebar::-webkit-scrollbar {
    width: 8px;
}

.rv-filters-sidebar::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

.rv-filters-sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
    transition: background 0.2s;
}

.rv-filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

