/* Search Page - Daraz-style Layout */

.search-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px 40px;
}

/* Breadcrumb */
.search-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.search-breadcrumb a:hover {
    color: #0066FF;
}

.search-breadcrumb i {
    font-size: 10px;
    color: #d1d5db;
}

.search-breadcrumb span {
    color: #374151;
    font-weight: 500;
}

/* Search Header */
.search-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.search-header h1 strong {
    color: #0066FF;
}

.result-count {
    font-size: 14px;
    color: #9ca3af;
}

/* Search Layout */
.search-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Sidebar */
.search-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.sidebar-header-mobile {
    display: none;
}

.filter-section {
    padding: 18px;
    border-bottom: 1px solid #f0f0f0;
}

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

.filter-title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-title i {
    font-size: 12px;
    color: #6b7280;
}

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

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
    transition: all 0.15s;
}

.filter-option:hover {
    background: #f3f4f6;
}

.filter-option.active {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}

.filter-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #0066FF;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-options-scrollable {
    max-height: 240px;
    overflow-y: auto;
}

.filter-options-scrollable::-webkit-scrollbar {
    width: 4px;
}

.filter-options-scrollable::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.filter-empty-note {
    font-size: 12px;
    color: #9ca3af;
    padding: 8px 10px;
}

.filter-subtitle {
    font-size: 10px;
    font-weight: 400;
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
}

.rating-option .rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
}

.rating-option .rating-stars i {
    font-size: 12px;
    color: #f59e0b;
}

.rating-option .rating-stars i.empty {
    color: #e5e7eb;
}

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

.price-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    flex: 1;
}

.price-input-group .currency {
    padding: 0 8px;
    font-size: 13px;
    color: #6b7280;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    line-height: 34px;
}

.price-input-group input {
    border: none;
    outline: none;
    padding: 8px 6px;
    width: 100%;
    font-size: 13px;
    min-width: 0;
}

.price-separator {
    color: #d1d5db;
    font-size: 14px;
}

.apply-price-btn {
    width: 100%;
    padding: 8px;
    background: #0066FF;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.apply-price-btn:hover {
    background: #0052cc;
}

.clear-filters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    font-size: 13px;
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    border-top: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.clear-filters-btn:hover {
    background: #fef2f2;
}

/* Main Content */
.search-main {
    flex: 1;
    min-width: 0;
}

/* Sort Bar */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.sort-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-toggle-btn:hover {
    background: #f3f4f6;
}

.sort-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.sort-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 7px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sort-btn:hover {
    border-color: #0066FF;
    color: #0066FF;
}

.sort-btn.active {
    background: #0066FF;
    border-color: #0066FF;
    color: white;
}

/* Active Filter Tags */
.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #1e40af;
}

.filter-tag a {
    display: flex;
    align-items: center;
    color: #1e40af;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.filter-tag a:hover {
    opacity: 1;
}

/* Products Grid - matches homepage products-grid */
.search-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.search-products-grid .card {
    min-width: unset;
    max-width: unset;
    width: 100%;
}

/* Empty State */
.search-empty {
    text-align: center;
    padding: 60px 30px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.search-empty i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.search-empty h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.search-empty p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.empty-suggestions {
    text-align: left;
    display: inline-block;
    margin-bottom: 24px;
}

.empty-suggestions p {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-suggestions ul {
    padding-left: 20px;
    margin: 0;
}

.empty-suggestions li {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.btn-browse-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0066FF;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-browse-all:hover {
    background: #0052cc;
}

/* Filter Overlay */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.filter-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 1200px) {
    .search-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .search-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .search-page {
        padding: 10px 12px 30px;
    }

    .search-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 999;
        border-radius: 0;
        border: none;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .search-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 18px;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-header-mobile h3 {
        font-size: 16px;
        font-weight: 700;
        color: #1f2937;
        margin: 0;
    }

    .close-filters {
        background: none;
        border: none;
        font-size: 18px;
        color: #6b7280;
        cursor: pointer;
    }

    .filter-toggle-btn {
        display: flex;
    }

    .sort-options {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sort-options::-webkit-scrollbar {
        display: none;
    }

    .sort-label {
        display: none;
    }

    .search-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .search-header h1 {
        font-size: 16px;
    }

    body.filters-open {
        overflow: hidden;
    }
}

@media (max-width: 400px) {
    .search-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .sort-bar {
        padding: 8px 10px;
    }

    .sort-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}
