/* Page-specific styles for search.html */
.top-bar, .main-header {
    background-color: #f7f7f7;
}

.top-bar-btn {
    background: #f7f7f7;
}

.top-bar-btn:hover {
    background: #e5e5e5;
}

.container {
    display: flex;
    gap: 20px;
}

.size-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
}

.size-grid .filter-option {
    margin: 4px 0;
}

/* Product item for search results */
.product-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
    position: relative;
}

.product-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-item.sold {
    opacity: 0.7;
}

.product-img {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    object-fit: cover;
}

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

.product-details {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    height: 40px;
    overflow: hidden;
    line-height: 1.4;
}

.no-results-suggestions {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
    color: #707070;
    font-size: 14px;
    line-height: 1.8;
}

/* Price slider */
.price-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

#price-slider {
    width: 100%;
    accent-color: #c0392b;
    cursor: pointer;
}

/* Trust signals */
.seller-trust {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.trust-badge {
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11px;
    font-weight: 600;
}

/* Watchlist heart on cards */
.product-item {
    position: relative;
}

.heart-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
    z-index: 2;
    transition: transform 0.15s;
}

.heart-btn:hover {
    transform: scale(1.15);
}

/* ── Mobile filter drawer ── */
.mobile-filter-bar {
    display: none; /* hidden on desktop */
}

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

.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 998;
}

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

.filter-drawer-header {
    display: none;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    /* Hide sidebar by default; shown as drawer when toggled */
    .sidebar {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        max-height: 78vh;
        overflow-y: auto;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -6px 32px rgba(0,0,0,0.18);
        padding: 0 20px 80px;
        width: 100%;
    }

    .sidebar.drawer-open {
        display: block;
        animation: slideUpDrawer 0.25s ease-out;
    }

    @keyframes slideUpDrawer {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .filter-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0 12px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 1;
        border-bottom: 1px solid #e5e5e5;
        margin-bottom: 12px;
    }

    .filter-drawer-header strong {
        font-size: 16px;
        color: #1a1a1a;
    }

    .filter-drawer-close {
        background: none;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: #555;
        padding: 0 4px;
        line-height: 1;
    }

    .mobile-filter-bar {
        display: flex;
        align-items: center;
        margin-bottom: 12px;
    }

    .filter-toggle-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 9px 18px;
        background: #1a1a1a;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
    }

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

    .product-img {
        height: 150px;
    }

    .no-results {
        padding: 40px 20px;
    }

    .no-results-icon {
        font-size: 56px;
    }
}

@media (max-width: 480px) {
    .product-img {
        height: 130px;
    }
}
