/* ════════════════════════════════════════════════════════════
   RANKING TOOL (shed finder) - scripts/ranking-tool.php
   Home page and every collection page. Garden green on slate.
   ════════════════════════════════════════════════════════════ */
.rl-section {
    --p: #2E7D5B;        /* garden green */
    --p-d: #23634A;      /* hover */
    --p-dd: #1D553F;     /* text on tint */
    --p-l: #EEF7F2;      /* tint */
    --dark: #1F2A33;     /* slate ink */
    --mid: #45515A;
    --muted: #5A6670;
    --border: #DAE0E4;
    background: #F4F6F7;
    padding: 52px 20px 72px;
    font-family: 'Roboto', sans-serif;
}
.rl-section *, .rl-section *::before, .rl-section *::after { box-sizing: border-box; }
.rl-inner { max-width: 1040px; margin: 0 auto; }
.rl-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.rl-h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 900; color: var(--dark); margin: 0 0 6px; letter-spacing: -0.5px; }
.rl-intro { font-size: 0.95rem; color: var(--mid); margin: 0 0 8px; line-height: 1.55; max-width: 760px; }
.rl-header-meta { display: flex; gap: 10px; font-size: 0.76rem; color: var(--muted); align-items: center; flex-wrap: wrap; }
.rl-header-meta span { display: inline-flex; align-items: center; gap: 5px; }
.rl-header-meta i { color: var(--p); }

/* Dropdown filters (roof, floor, windows, lock, base, capacity, brand) */
.rl-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; margin: 0 0 14px; }
.rl-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rl-filter-group[hidden] { display: none; }
.rl-filter-group label { font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.9px; }
.rl-filter-group select { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.86rem; font-family: inherit; background: #F4F6F7; color: var(--dark); outline: none; transition: border-color 0.15s; }
.rl-filter-group select:focus { border-color: var(--p); background: #fff; }

.rl-reset-btn { padding: 8px 14px; background: transparent; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.76rem; font-weight: 700; font-family: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; transition: border-color 0.2s, color 0.2s; }
.rl-reset-btn:hover { border-color: #C62828; color: #C62828; }
.rl-count { font-size: 0.78rem; color: var(--muted); margin-bottom: 14px; }
.rl-list { display: flex; flex-direction: column; gap: 0; }

/* Cards */
.rl-item { display: block; text-decoration: none; color: inherit; cursor: pointer; background: #fff; border: 1px solid #DAE0E4; border-radius: 12px; margin-bottom: 14px; position: relative; overflow: hidden; transition: box-shadow 0.18s, transform 0.18s; }
.rl-item:hover { box-shadow: 0 6px 28px rgba(31, 42, 51, 0.10); transform: translateY(-2px); }
.rl-item.rl-top1 { border-top: 3px solid #2E7D5B; }
.rl-item.rl-top2 { border-top: 3px solid #4F9F7B; }
.rl-item.rl-top3 { border-top: 3px solid #45515A; }
.rl-item.rank-hidden { display: none; }
.rl-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 800; padding: 5px 13px 5px 10px; letter-spacing: 0.2px; position: absolute; top: 0; left: 0; border-radius: 0 0 10px 0; background: #2E7D5B; color: #fff; z-index: 2; }
.rl-top2 .rl-badge { background: #4F9F7B; }
.rl-top3 .rl-badge { background: #45515A; }
.rl-card-body { display: grid; grid-template-columns: 260px minmax(0, 1fr) 210px; grid-template-rows: auto 1fr; align-items: start; padding: 26px 28px 26px; gap: 0; }
.rl-item-badged .rl-card-body { padding-top: 44px; }
.rl-card-image { grid-column: 1; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-right: 28px; border-right: 1px solid #EBEFF1; }
.rl-rank-num { font-size: 1.1rem; font-weight: 900; color: #BFC8CE; letter-spacing: -0.5px; line-height: 1; font-variant-numeric: tabular-nums; }

/* Product photos are never cropped: whole picture, on white */
.rl-img { width: 220px; height: 170px; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid #EBEFF1; }
.rl-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; padding: 6px; box-sizing: border-box; }
.rl-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #BFC8CE; font-size: 2.8rem; }

.rl-card-main { grid-column: 2; grid-row: 2; padding: 0 28px; min-width: 0; }
.rl-name { font-size: 1.12rem; font-weight: 700; color: var(--dark); margin: 0 0 6px; line-height: 1.4; }
/* The title is a direct child of the grid (.rl-name-top) so the mobile
   layout can lift it above the image. */
.rl-name-top { grid-column: 2; grid-row: 1; padding: 0 28px; margin: 0 0 6px; min-width: 0; overflow-wrap: anywhere; }
.rl-brand { font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.rl-facts { font-size: 0.86rem; font-weight: 700; color: var(--dark); margin-bottom: 10px; line-height: 1.5; }
.rl-facts i { color: var(--p); margin-right: 3px; }
.rl-facts span { color: #BFC8CE; }
.rl-fit { font-size: 0.82rem; font-weight: 700; color: var(--p-dd); background: var(--p-l); border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; line-height: 1.4; }
.rl-fit.is-warn { color: #8A4B00; background: #FFF4DE; }
.rl-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rl-discount-tag { display: inline-flex; align-items: center; background: #C62828; color: #fff; font-size: 0.72rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; }
.rl-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; color: var(--mid); background: #F4F6F7; border: 1px solid #DAE0E4; padding: 3px 8px; border-radius: 4px; }
.rl-tag i { color: var(--p); font-size: 0.65rem; }
.rl-bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.rl-bullets li { font-size: 0.84rem; color: var(--mid); display: flex; align-items: flex-start; gap: 8px; line-height: 1.45; }
.rl-bullets li::before { content: '\2713'; color: var(--p); font-weight: 700; font-size: 0.78rem; flex-shrink: 0; margin-top: 1px; }
.rl-why { font-size: 0.8rem; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.rl-why strong { color: var(--mid); }

.rl-card-right { grid-column: 3; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; gap: 16px; padding-left: 28px; border-left: 1px solid #EBEFF1; text-align: center; }
.rl-score-box { background: var(--p-l); border: 1px solid #D6EDE1; border-radius: 12px; padding: 16px 20px; width: 100%; }
.rl-score-num { font-size: 2.6rem; font-weight: 900; color: var(--dark); line-height: 1; letter-spacing: -1px; }
.rl-score-label { font-size: 0.75rem; font-weight: 700; color: var(--p-dd); margin: 4px 0 2px; }
.rl-score-sub { font-size: 0.68rem; color: var(--muted); }
.rl-price-block { width: 100%; }
.rl-price { font-size: 1.85rem; font-weight: 900; color: var(--dark); line-height: 1; letter-spacing: -0.5px; }
.rl-was { font-size: 1rem; color: #97A3AC; text-decoration: line-through; margin-top: 4px; }
.rl-cta { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--p); color: #fff; font-size: 0.92rem; font-weight: 700; padding: 14px 20px; border-radius: 10px; width: 100%; transition: background 0.15s; box-shadow: 0 3px 12px rgba(46, 125, 91, 0.28); }
.rl-item:hover .rl-cta { background: var(--p-d); }

.rl-more-wrap { text-align: center; margin: 6px 0 4px; }
.rl-more-wrap[hidden] { display: none; }
.rl-more-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; border-radius: 999px; border: 1.5px solid var(--p); background: #fff; color: var(--p-d); font-family: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: background 0.15s, color 0.15s; }
.rl-more-btn:hover { background: var(--p); color: #fff; }

/* ── Shed finder ─────────────────────────────────────────── */
.sf-panel { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px 14px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(31, 42, 51, 0.04); }
.sf-step { margin-bottom: 16px; min-width: 0; }
.sf-label { font-size: 0.92rem; font-weight: 800; color: var(--dark); margin-bottom: 9px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-label small { font-weight: 600; color: var(--muted); font-size: 0.74rem; }
.sf-label strong { color: var(--p-d); }
.sf-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--p); color: #fff; font-size: 0.72rem; font-weight: 800; flex-shrink: 0; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 999px; background: #F4F6F7; color: var(--mid); font-size: 0.86rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.sf-chip:hover { border-color: var(--p); color: var(--p-d); }
.sf-chip i { font-size: 0.8rem; color: var(--muted); }
.sf-chip em { font-style: normal; font-size: 0.7rem; font-weight: 800; background: #DAE0E4; color: var(--mid); border-radius: 999px; padding: 1px 7px; }
.sf-chip.is-on, .sf-chip.is-on:hover { background: var(--p); border-color: var(--p); color: #fff; }
.sf-chip.is-on i { color: #fff; }
.sf-chip.is-on em { background: rgba(255, 255, 255, 0.22); color: #fff; }
.sf-hint { margin: 10px 0 0; font-size: 0.84rem; color: var(--p-dd); background: var(--p-l); border-radius: 8px; padding: 9px 12px; line-height: 1.45; }
.sf-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 28px; }
.sf-size { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sf-size select, .sf-size input, .sf-foot select { padding: 9px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.88rem; font-family: inherit; background: #F4F6F7; color: var(--dark); outline: none; }
.sf-size select:focus, .sf-size input:focus, .sf-foot select:focus { border-color: var(--p); background: #fff; }
.sf-size input { width: 84px; }
.sf-or { font-size: 0.8rem; color: var(--muted); }
.sf-space { display: inline-flex; align-items: center; gap: 6px; }
.sf-x { color: var(--muted); font-weight: 700; }
.sf-range { width: 100%; accent-color: var(--p); height: 34px; cursor: pointer; }
.sf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid #EBEFF1; padding-top: 12px; }
.sf-foot .rl-count { margin: 0; font-size: 0.92rem; color: var(--mid); }
.sf-foot .rl-count strong { color: var(--p-d); font-size: 1.05rem; }
.sf-foot-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-foot-right label { font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.9px; }
.sf-notice { background: #FFF8E6; border: 1px solid #F2D58A; color: #7A4A00; border-radius: 10px; padding: 12px 14px; font-size: 0.88rem; margin-bottom: 14px; line-height: 1.45; }
.sf-notice[hidden], .sf-hint[hidden], .rl-fit[hidden], .rl-badge[hidden] { display: none; }
.sf-method { font-size: 0.8rem; color: var(--muted); line-height: 1.55; margin: 14px 0 0; }
.sf-method i { color: var(--p); }

/* ── Collection pages (.rl-compact): the tool sits in the first screen ── */
.rl-section.rl-compact { padding: 20px 20px 36px; }
.rl-compact .rl-inner { max-width: 1260px; }
.rl-compact .rl-header { margin-bottom: 12px; align-items: flex-end; }
.rl-compact .rl-h1 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); margin: 0 0 4px; }
.rl-compact .rl-header-meta { display: none; }
.rl-compact .sf-panel { padding: 14px 16px 10px; }
.rl-compact .sf-step { margin-bottom: 12px; }
.rl-compact .rl-item { margin-bottom: 10px; }
.rl-compact .rl-card-body { grid-template-columns: 190px minmax(0, 1fr) 200px; padding: 18px 22px 16px; }
.rl-compact .rl-item-badged .rl-card-body { padding-top: 36px; }
.rl-compact .rl-card-image { padding-right: 20px; gap: 4px; }
.rl-compact .rl-img { width: 160px; height: 124px; }
.rl-compact .rl-name-top, .rl-compact .rl-card-main { padding: 0 20px; }
.rl-compact .rl-card-right { padding-left: 20px; gap: 10px; }
.rl-compact .rl-score-box { padding: 10px 14px; }
.rl-compact .rl-score-num { font-size: 2rem; }
.rl-compact .rl-price { font-size: 1.5rem; }
.rl-compact .rl-cta { padding: 11px 16px; }
.rl-compact .sf-method { font-size: 0.76rem; }

@media (max-width: 680px) {
    .sf-panel { padding: 16px 14px 12px; }
    .sf-cols { grid-template-columns: minmax(0, 1fr); }
    .sf-chip { padding: 9px 12px; font-size: 0.84rem; }
    .sf-size select[data-sf="size"] { width: 100%; }
    .sf-space { width: 100%; }
    .sf-space input { flex: 1; width: auto; min-width: 0; }
    .rl-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .rl-card-body, .rl-compact .rl-card-body { grid-template-columns: 130px minmax(0, 1fr); grid-template-rows: auto auto auto; padding: 16px; }
    .rl-item-badged .rl-card-body, .rl-compact .rl-item-badged .rl-card-body { padding-top: 40px; }
    .rl-card-image { grid-column: 1; grid-row: 1 / 3; padding-right: 14px; }
    .rl-name-top, .rl-compact .rl-name-top { grid-column: 2; grid-row: 1; padding: 0; }
    .rl-card-main, .rl-compact .rl-card-main { grid-column: 2; grid-row: 2; padding: 0; min-width: 0; }
    .rl-card-right, .rl-compact .rl-card-right { grid-column: 1 / 3; grid-row: 3; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; border-left: none; border-top: 1px solid #EBEFF1; padding: 14px 0 0; margin-top: 14px; gap: 10px; }
    .rl-score-box { width: auto; padding: 8px 14px; }
    .rl-price-block { width: auto; text-align: left; }
    .rl-cta { width: auto; padding: 10px 20px; }
    .rl-img, .rl-compact .rl-img { width: 120px; height: 100px; }
    .rl-tag, .rl-discount-tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
}
@media (max-width: 440px) {
    /* Single column: title, full-width picture (whole, never cropped), details, buy block */
    .rl-card-body, .rl-compact .rl-card-body { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 0; }
    .rl-item-badged .rl-card-body, .rl-compact .rl-item-badged .rl-card-body { padding-top: 38px; }
    .rl-name-top, .rl-compact .rl-name-top { grid-column: 1; grid-row: 1; font-size: 1.05rem; line-height: 1.35; padding: 0; margin: 0 0 12px; }
    .rl-card-image { grid-column: 1; grid-row: 2; display: block; position: relative; padding: 0; margin: 0 0 12px; border-right: none; }
    .rl-img, .rl-compact .rl-img { width: 100%; height: 200px; border-radius: 10px; background: #fff; }
    .rl-img img { padding: 6px; object-fit: contain; background: #fff; }
    .rl-rank-num { position: absolute; top: -1px; left: -1px; z-index: 2; display: flex; align-items: center; justify-content: center; min-width: 42px; height: 34px; padding: 0 10px; font-size: 1.15rem; font-weight: 900; color: #76838D; background: rgba(255, 255, 255, 0.94); border-radius: 0 0 8px 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
    .rl-card-main, .rl-compact .rl-card-main { grid-column: 1; grid-row: 3; padding: 0; min-width: 0; }
    .rl-card-tags { gap: 5px; }
    .rl-card-right, .rl-compact .rl-card-right { grid-column: 1; grid-row: 4; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; column-gap: 12px; row-gap: 14px; border-left: none; border-top: 1px solid #EBEFF1; padding: 14px 0 0; margin-top: 14px; text-align: center; }
    .rl-score-box { width: 100%; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; }
    .rl-score-num { font-size: 1.7rem; letter-spacing: -0.5px; }
    .rl-score-label { font-size: 0.68rem; margin: 2px 0 2px; }
    .rl-price-block { width: 100%; text-align: center; }
    .rl-price { font-size: 1.5rem; }
    .rl-was { font-size: 0.85rem; margin-top: 2px; }
    .rl-cta { grid-column: 1 / -1; width: 100%; padding: 13px 16px; }
    .rl-filters { grid-template-columns: minmax(0, 1fr); }
    .rl-section { padding: 20px 16px 48px; }
    .rl-header { margin-bottom: 14px; }
}
