/* assets/css/search.css */

:root {
    --s-bg: #ffffff;
    --s-border: #e7e7e7;
    --s-primary-text: #0F1111;
    --s-secondary-text: #565959;
    --s-price-red: #CC0C39;
    --s-link: #007185;
    --s-link-hover: #C7511F;
    --s-star: #FFA41C;
}

body {
    background-color: white; /* Clean background */
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 1. CONTROL BAR (Sort & Counts) --- */
.search-control-bar {
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 10px 0;
    margin-bottom: 20px;
    background: white;
}

.search-control-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-meta {
    font-size: 14px;
    color: var(--s-primary-text);
}

.search-meta .highlight {
    font-weight: 700;
    color: #C45500;
}

.search-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-sort label {
    font-size: 12px;
    color: var(--s-secondary-text);
}

.search-sort select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #F0F2F2;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(15,17,17,0.15);
}

/* --- 2. MAIN LAYOUT (Sidebar + Grid) --- */
.search-layout {
    display: flex;
    gap: 25px;
    padding-bottom: 50px;
}

/* --- 3. SIDEBAR FILTERS --- */
.search-sidebar {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid transparent;
}

.filter-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.filter-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--s-primary-text);
    margin-bottom: 10px;
}

.filter-list li {
    margin-bottom: 6px;
}

.filter-list a {
    font-size: 13px;
    color: var(--s-primary-text);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.filter-list a:hover {
    color: var(--s-link-hover);
}
.filter-list a.active {
    font-weight: 700;
    color: #C45500;
}

.filter-list .count {
    color: var(--s-secondary-text);
    font-size: 12px;
}

/* Star Ratings in Sidebar */
.rating-link .stars {
    color: var(--s-star);
    font-size: 12px;
    margin-right: 5px;
}

.rating-link span {
    font-size: 13px;
    color: var(--s-primary-text);
}

.rating-link:hover span { color: var(--s-link-hover); }

/* Price Inputs */
.price-inputs {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.price-inputs input {
    width: 60px;
    padding: 5px;
    border: 1px solid #888;
    border-radius: 4px;
    font-size: 13px;
}

.price-inputs button {
    padding: 5px 10px;
    background: white;
    border: 1px solid #888;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 12px;
}

/* --- 4. RESULTS GRID & CARDS --- */
.search-results {
    flex: 1;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 15px;
}

.s-product-card {
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    background: white;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.2s;
}

.s-product-card:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-color: #ddd;
}

/* Image Area */
.s-image-container {
    height: 220px;
    padding: 20px;
    background: #F7F7F7;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.s-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply; /* Removes white bg visual artifact */
}

/* Details Area */
.s-details {
    padding: 0 12px 15px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.s-title {
    font-size: 16px;
    line-height: 1.3;
    color: var(--s-primary-text);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px; /* Fixed height for alignment */
}

.s-title:hover { color: var(--s-link-hover); }

/* Rating */
.s-rating {
    margin-bottom: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.s-rating i { color: var(--s-star); margin-right: 1px; }
.s-rating .s-count { color: var(--s-link); margin-left: 5px; }

/* Price Block */
.s-price-block {
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
}

.s-currency {
    font-size: 12px;
    vertical-align: text-top;
    margin-right: 2px;
}

.s-whole {
    font-size: 24px;
    font-weight: 500;
    color: var(--s-primary-text);
    line-height: 1;
}

.s-old-price {
    margin-left: 8px;
    font-size: 12px;
    color: var(--s-secondary-text);
}
.s-old-price span { text-decoration: line-through; }

/* Badges */
.s-badge-deal {
    background: var(--s-price-red);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 2px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 6px;
}

/* Delivery Info */
.s-delivery {
    font-size: 13px;
    color: var(--s-primary-text);
    margin-top: auto; /* Push to bottom */
}
.s-delivery strong { font-weight: 700; }
.s-free { color: var(--s-secondary-text); }

/* --- 5. PAGINATION --- */
.s-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.s-page-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    color: #111;
    font-size: 13px;
    box-shadow: 0 2px 5px rgba(213,217,217,0.5);
    background: white;
    margin: 0 10px;
}

.s-page-btn:hover { background: #f7f7f7; }

.s-pages { display: flex; gap: 5px; }

.s-page-num {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #111;
    font-size: 14px;
}

.s-page-num:hover { background: #f2f2f2; border-color: #eee; }
.s-page-num.active { border: 1px solid #111; font-weight: 700; }

/* --- 6. NO RESULTS --- */
.no-results-container {
    display: flex;
    justify-content: center;
    padding: 50px 0;
}
.no-results-box {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .search-layout { flex-direction: column; }
    .search-sidebar { width: 100%; display: none; /* Hide sidebar on mobile for simplicity, or implement dropdown toggle */ }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    
    .s-image-container { height: 180px; padding: 10px; }
    .s-whole { font-size: 20px; }
    .s-title { font-size: 14px; }
}