/* ============================================
   SIDEBAR LAYOUT - Clean Modern Design
   Based on Alvas.co aesthetic
   ============================================ */

.alvasco-search-sidebar {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 0;
}

.alvasco-search-sidebar .alvasco-search-form {
    display: flex;
    flex-direction: column;
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */

.alvasco-sidebar-section {
    border-bottom: 1px solid #f0f0f0;
}

.alvasco-sidebar-section:last-of-type {
    border-bottom: none;
}

/* Section Title (Clickable) */
.sidebar-section-title {
    margin: 0;
    padding: 18px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.sidebar-section-title:hover {
    background: #f9f9f9;
}

/* Toggle Icon */
.sidebar-section-title .toggle-icon {
    font-size: 12px;
    color: #999999;
    transition: transform 0.3s ease;
}

/* Collapsed State */
.alvasco-sidebar-section.collapsed .sidebar-section-content {
    display: none;
}

.alvasco-sidebar-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* Section Content */
.sidebar-section-content {
    padding: 0 24px 20px 24px;
}

/* Radio Button Filter Options */
.sidebar-filter-option {
    display: flex;
    align-items: center;
    padding: 10px 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.sidebar-filter-option:hover {
    background: #f9f9f9;
    margin: 0 -10px;
    padding: 10px 10px;
    border-radius: 4px;
}

.sidebar-filter-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ff6b35;
    /* Square checkbox style */
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #d0d0d0;
    border-radius: 2px;
    position: relative;
    background: #ffffff;
    transition: all 0.2s ease;
}

.sidebar-filter-option input[type="radio"]:checked {
    background: #ff6b35;
    border-color: #ff6b35;
}

.sidebar-filter-option input[type="radio"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.sidebar-filter-option input[type="radio"]:hover {
    border-color: #ff6b35;
}

.sidebar-filter-option span {
    font-size: 14px;
    color: #333333;
}

.sidebar-section-content select,
.sidebar-section-content input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 15px;
    color: #333333;
    background: #ffffff;
    transition: all 0.2s ease;
}

.sidebar-section-content select:focus,
.sidebar-section-content input[type="text"]:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Submit Button */
.alvasco-sidebar-submit {
    padding: 24px;
    border-top: 1px solid #f0f0f0;
}

.alvasco-sidebar-submit button {
    width: 100%;
    padding: 14px 20px;
    background: #ff6b35;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alvasco-sidebar-submit button:hover {
    background: #e6522a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

/* ============================================
   NON-COLLAPSIBLE SIDEBAR (Original)
   ============================================ */

/* Hide the row wrappers in sidebar mode */
.alvasco-search-sidebar .alvasco-search-row {
    display: contents;
}

/* Each filter field is a full-width section */
.alvasco-search-sidebar .alvasco-search-field {
    width: 100%;
    margin: 0;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.alvasco-search-sidebar .alvasco-search-field:last-of-type {
    border-bottom: none;
}

/* Labels */
.alvasco-search-sidebar .alvasco-search-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 10px;
    text-transform: none;
}

/* Inputs and Selects */
.alvasco-search-sidebar .alvasco-search-field input[type="text"],
.alvasco-search-sidebar .alvasco-search-field select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 15px;
    color: #333333;
    background: #ffffff;
    transition: all 0.2s ease;
}

.alvasco-search-sidebar .alvasco-search-field input[type="text"]:focus,
.alvasco-search-sidebar .alvasco-search-field select:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Search Button */
.alvasco-search-sidebar .alvasco-search-submit {
    padding: 24px;
    border-top: 1px solid #f0f0f0;
    margin: 0;
}

.alvasco-search-sidebar button[type="submit"] {
    width: 100%;
    padding: 14px 20px;
    background: #ff6b35;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alvasco-search-sidebar button[type="submit"]:hover {
    background: #e6522a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

/* Active Filters Indicator */
.alvasco-search-sidebar .alvasco-search-field.has-value label::after {
    content: '●';
    color: #ff6b35;
    margin-left: 8px;
    font-size: 12px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .alvasco-search-sidebar {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .alvasco-search-sidebar .alvasco-search-field,
    .alvasco-sidebar-section {
        padding: 16px 20px;
    }
    
    .sidebar-section-title {
        padding: 16px 20px;
    }
    
    .sidebar-section-content {
        padding: 0 20px 16px 20px;
    }
    
    .alvasco-search-sidebar .alvasco-search-submit,
    .alvasco-sidebar-submit {
        padding: 20px;
    }
}

/* Clean scrollbar for sidebar */
.alvasco-search-sidebar::-webkit-scrollbar {
    width: 6px;
}

.alvasco-search-sidebar::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.alvasco-search-sidebar::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.alvasco-search-sidebar::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}


   RANGE FILTERS - Beautiful Modern Design
   Terra-style paired dropdown filters
======================================== */

.alvasco-range-filters {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-top: 4px;
}

.alvasco-range-field {
    flex: 1;
    position: relative;
}

/* Modern select styling */
.alvasco-range-select {
    width: 100%;
    padding: 11px 35px 11px 14px;
    border: 2px solid #E8E8E8;
    border-radius: 8px;
    background: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    color: #2C2C2C;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M1 1.5L6 6.5L11 1.5" stroke="%23666666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

/* Hover state */
.alvasco-range-select:hover {
    border-color: #F57E36;
    background-color: #FFFAF7;
    box-shadow: 0 2px 8px rgba(245, 126, 54, 0.08);
}

/* Focus state */
.alvasco-range-select:focus {
    outline: none;
    border-color: #F57E36;
    background-color: #FFF;
    box-shadow: 0 0 0 4px rgba(245, 126, 54, 0.12);
}

/* Selected state (has value) */
.alvasco-range-select:not([value=""]) {
    background-color: #FFF9F5;
    border-color: #F57E36;
    color: #F57E36;
    font-weight: 600;
}

/* Disabled state */
.alvasco-range-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #F5F5F5;
}

/* Placeholder styling */
.alvasco-range-select option:first-child {
    color: #999;
    font-weight: 400;
}

/* Optional: Add icons before labels */
.alvasco-range-field:first-child::before {
    content: "↓";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alvasco-range-field:last-child::before {
    content: "↑";
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alvasco-sidebar-section:hover .alvasco-range-field::before {
    opacity: 1;
}

/* Mobile: Stack vertically with better spacing */
@media (max-width: 768px) {
    .alvasco-range-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .alvasco-range-field {
        width: 100%;
    }
    
    .alvasco-range-select {
        padding: 13px 35px 13px 14px;
        font-size: 15px;
    }
}

/* Slideup panel range filters - compact version */


/* Enhanced section title for range filters */
.alvasco-sidebar-section:has(.alvasco-range-filters) .sidebar-section-title {
    color: #2C2C2C;
    font-weight: 600;
}

/* Visual separator between Min/Max */
.alvasco-range-filters::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, #E8E8E8 20%, #E8E8E8 80%, transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alvasco-range-filters:hover::after {
    opacity: 1;
}

@media (max-width: 768px) {
    .alvasco-range-filters::after {
        display: none;
    }
}

   RANGE FILTERS (Min/Max Dropdowns)
   Simple, clean design matching other filters
======================================== */

.alvasco-range-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.alvasco-range-field {
    flex: 1;
}

.alvasco-range-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: #333333;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg"%3e%3cpath d="M1 1L5 5L9 1" stroke="%23333333" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

.alvasco-range-select:hover {
    border-color: #F57E36;
}

.alvasco-range-select:focus {
    outline: none;
    border-color: #F57E36;
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
    .alvasco-range-filters {
        flex-direction: column;
        gap: 8px;
    }
    
    .alvasco-range-field {
        width: 100%;
    }
}

/* Slideup panel range filters */


/* =============================================
   Range Select Dropdowns — Match Sidebar Style
   ============================================= */

/* The select dropdowns */
.alvasco-range-select {
    font-family: 'Outfit', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: rgb(51, 51, 51) !important;
    border: 1px solid rgb(220, 220, 220) !important;
    border-radius: 4px !important;
    height: 40px !important;
    line-height: 40px !important;
    padding: 0 10px !important;
    background-color: #fff !important;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px !important;
}

/* Placeholder text (first option) */
.alvasco-range-select option:first-child {
    color: rgb(153, 153, 153);
}

/* Hover state */
.alvasco-range-select:hover {
    border-color: rgb(180, 180, 180) !important;
}

/* Focus state */
.alvasco-range-select:focus {
    border-color: rgb(51, 51, 51) !important;
    outline: none !important;
}

/* When a value is selected (not placeholder) */
.alvasco-range-select:not([value=""]) {
    color: rgb(51, 51, 51) !important;
}

/* Container for the two dropdowns side by side */
.alvasco-range-filters {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding: 0;
}

/* Each dropdown wrapper takes equal space */
.alvasco-range-field {
    flex: 1;
}

/* Make select fill its wrapper */
.alvasco-range-field .alvasco-range-select {
    width: 100% !important;
}

/* Section title color consistency */
.alvasco-sidebar-section .sidebar-section-title {
    color: rgb(51, 51, 51);
}

   ======================================== */

/* Range panel container in mobile slideup */
}




/* Range panel container in mobile slideup */
.alvasco-slideup-panel .alvasco-range-panel {
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}

.alvasco-slideup-panel .alvasco-range-panel.active {
    display: flex;
}

.alvasco-slideup-panel .alvasco-range-filters {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 0;
}

.alvasco-slideup-panel .alvasco-range-field {
    flex: 1;
}

.alvasco-slideup-panel .alvasco-range-select {
    width: 100%;
}

/* ============================================
   ADD TO QUOTE BUTTON STYLING
   Ensure <button> elements look identical to <a>
   ============================================ */

.alvasco-add-to-quote {
    /* Reset button defaults */
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    text-align: inherit;
    color: inherit;
    
    /* Make button behave like block link */
    display: block;
    width: 100%;
    text-decoration: none;
    
    /* Ensure it inherits theme button styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.alvasco-add-to-quote:hover,
.alvasco-add-to-quote:focus {
    outline: none;
    text-decoration: none;
}

.alvasco-add-to-quote:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
