/* R4R Routes — Frontend Styles */

/* ── Search wrap ───────────────────────────────────────────────────────────── */
.r4r-search-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

/* ── Filter rows ────────────────────────────────────────────────────────────── */
.r4r-search-filters {
    background: #fff;
    border: 0.5px solid rgba(0,0,0,.1);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.r4r-filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.r4r-filter-input {
    padding: 8px 12px;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 6px;
    font-size: 14px;
    background: #f9f9f9;
    color: #1a1915;
    min-width: 140px;
}

.r4r-filter-input:focus {
    outline: none;
    border-color: #1D9E75;
    background: #fff;
}

.r4r-filter-wide { flex: 1; min-width: 220px; }

/* ── Sliders ────────────────────────────────────────────────────────────────── */
.r4r-filter-row--sliders { gap: 1.5rem; }

.r4r-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}

.r4r-slider-wrap label {
    font-size: 12px;
    color: #5c5a54;
}

.r4r-slider-wrap label strong {
    color: #1D9E75;
}

.r4r-slider {
    width: 100%;
    accent-color: #1D9E75;
    cursor: pointer;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.r4r-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.r4r-btn--primary {
    background: #1D9E75;
    color: #fff;
    border-color: #1D9E75;
}
.r4r-btn--primary:hover { background: #177d5d; }

.r4r-btn--secondary {
    background: #fff;
    color: #1D9E75;
    border-color: #1D9E75;
}
.r4r-btn--secondary:hover { background: #e8f8f2; }
.r4r-btn--secondary.active { background: #1D9E75; color: #fff; }

.r4r-btn--ghost {
    background: transparent;
    color: #9b9890;
    border-color: rgba(0,0,0,.12);
}
.r4r-btn--ghost:hover { background: #f5f5f5; }

/* ── Results meta ───────────────────────────────────────────────────────────── */
.r4r-results-meta {
    font-size: 13px;
    color: #9b9890;
    margin-bottom: .75rem;
}

/* ── Cards grid ─────────────────────────────────────────────────────────────── */
.r4r-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    transition: opacity .2s;
}

/* ── Single card ────────────────────────────────────────────────────────────── */
.r4r-card {
    background: #fff;
    border: 0.5px solid rgba(0,0,0,.09);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .15s;
}
.r4r-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.09);
    transform: translateY(-2px);
}

.r4r-card-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0ede7;
}
.r4r-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.r4r-card:hover .r4r-card-img img { transform: scale(1.03); }
.r4r-card-no-img { width: 100%; height: 100%; background: #ede9e0; }

.r4r-card-body {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.r4r-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1915;
}

.r4r-card-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #5c5a54;
    flex-wrap: wrap;
}

.r4r-card-near {
    font-size: 12px;
    color: #1D9E75;
    font-weight: 500;
}

.r4r-card-attrs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.r4r-card-attr { font-size: 10px; color: #9b9890; }

/* ── Loading / error / no results ───────────────────────────────────────────── */
.r4r-loading, .r4r-no-results, .r4r-error {
    font-size: 14px;
    color: #9b9890;
    padding: 2rem;
    text-align: center;
}
.r4r-error { color: #c0392b; }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.r4r-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.r4r-page-btn {
    padding: 6px 14px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s;
}
.r4r-page-btn:hover { background: #f5f5f5; }
.r4r-page-btn.active {
    background: #1D9E75;
    color: #fff;
    border-color: #1D9E75;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .r4r-filter-row--sliders { flex-direction: column; }
    .r4r-cards { grid-template-columns: 1fr; }
}
