/* ======================
   SEARCH BAR & FILTERS
   ====================== */

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
    padding: 10px 20px;
    max-width: 400px;
    flex: 1;
    transition: all 0.3s;
}

.search-container:focus-within {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.search-icon {
    color: white;
    margin-right: 12px;
    font-size: 16px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    flex: 1;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-clear {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.search-clear:hover {
    opacity: 1;
}

.filter-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
}

/* Filters Panel */
.filters-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0,0,0,0.2);
    z-index: 10000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.filters-panel.active {
    right: 0;
}

.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.filters-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.filters-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s;
}

.filters-close:hover {
    transform: rotate(90deg);
}

.filters-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.filter-group {
    margin-bottom: 35px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.filter-label i {
    color: #667eea;
}

/* Price Inputs */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.price-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    width: 0;
    min-width: 0;
}

.price-input:focus {
    border-color: #667eea;
    outline: none;
}

.price-range-slider {
    margin-top: 15px;
}

.price-range-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.price-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

.price-range-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
}

.range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Discount Options */
.discount-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.discount-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.discount-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.discount-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* Filter Select */
.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    border-color: #667eea;
    outline: none;
}

/* Filters Footer */
.filters-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 15px;
}

.btn-filter-reset,
.btn-filter-apply {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-filter-reset {
    background: #f5f5f5;
    color: #666;
}

.btn-filter-reset:hover {
    background: #e0e0e0;
}

.btn-filter-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-filter-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #666;
}

.results-count {
    font-weight: 600;
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

/* Desktop: hide search outside nav-actions, show inside */
@media (min-width: 769px) {
    .nav-container > .search-container {
        display: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Hide search inside nav-actions, show outside */
    .nav-actions .search-container {
        display: none;
    }
    
    /* Navbar mobile layout */
    .nav-container {
        flex-wrap: wrap;
        gap: 12px;
        padding: 15px 20px !important;
        align-items: center;
    }
    
    .nav-brand {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .nav-actions {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        justify-content: flex-end;
        order: 1;
    }
    
    /* Hide text on mobile, keep icons only */
    #login-btn span {
        display: none;
    }
    
    /* Search bar takes full width on new row */
    .search-container {
        width: 100%;
        padding: 10px 16px;
        order: 2;
        margin: 0;
    }
    
    .search-input {
        font-size: 14px;
    }
    
    .filters-panel {
        width: 100%;
        right: -100%;
    }
    
    .filters-header {
        padding: 20px;
    }
    
    .filters-header h3 {
        font-size: 18px;
    }
    
    .filters-content {
        padding: 20px;
    }
    
    .filter-group {
        margin-bottom: 25px;
    }
    
    .filter-label {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .price-inputs {
        gap: 8px;
    }
    
    .price-input {
        padding: 10px;
        font-size: 14px;
    }
    
    .discount-options {
        gap: 8px;
    }
    
    .discount-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .filter-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .filters-footer {
        padding: 15px 20px;
        gap: 10px;
    }
    
    .btn-filter-reset,
    .btn-filter-apply {
        padding: 12px;
        font-size: 14px;
    }
}
