/* Customer Reviews — public section + dashboard bits.
   Palette follows the approved reference: white ground, dark-green headings,
   gold stars/bars, green action button. Scoped to .reviews-section / .rv-*
   so nothing else on the site is affected. */

.reviews-section, .rv-modal, .rv-viewer, .rv-toast {
  --rv-green-dark: #0b5a2b;
  --rv-green: #0e6b35;
  --rv-green-hover: #0a5a2c;
  --rv-gold: #f5b81c;
  --rv-track: #e6e8e6;
  --rv-ink: #1f2421;
  --rv-muted: #59605b;
  --rv-line: #e1e7e2;
  --rv-link: #1565c0;
  --rv-danger: #b3261e;
}

body.rv-lock { overflow: hidden; }

/* style.css still has older #feedback rules (cream ground + gradient) that beat a
   class selector; match their specificity here instead of editing that file. */
section#feedback.reviews-section { background: #fff; background-image: none; padding: 28px 0 56px; color: var(--rv-ink); }
.reviews-wrap { max-width: 720px; margin: 0 auto; padding-inline: 16px; }
.reviews-section h2, .reviews-section h3, .reviews-section h4 { font-family: var(--font-head); letter-spacing: -0.01em; }

.rv-title { font-size: clamp(1.9rem, 6vw, 2.4rem); font-weight: 800; color: var(--rv-green-dark); margin: 0 0 18px; text-align: left; }
.rv-muted { color: var(--rv-muted); }
.rv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- rating overview ---- */
.rv-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 22px; align-items: center; margin-bottom: 28px; }
.rv-summary > .rv-muted, .rv-summary > .rv-empty { grid-column: 1 / -1; }
.rv-empty { border: 1px dashed var(--rv-line); border-radius: 16px; padding: 24px 18px; text-align: center; }
.rv-empty-title { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; color: var(--rv-green-dark); margin: 0 0 4px; }
.rv-avg { font-family: var(--font-head); font-size: clamp(3rem, 12vw, 3.8rem); font-weight: 800; line-height: 1; color: var(--rv-green-dark); }
.rv-score .rv-stars { font-size: clamp(1.4rem, 6vw, 1.9rem); margin-top: 6px; }
.rv-based { margin: 8px 0 0; font-size: 0.92rem; color: var(--rv-muted); }
.rv-stars {
  display: inline-block; width: max-content; max-width: 100%; justify-self: start; letter-spacing: 2px; line-height: 1; font-size: 1.05rem; white-space: nowrap;
  background: linear-gradient(90deg, var(--rv-gold) var(--rv-fill, 0%), #d6d9d6 var(--rv-fill, 0%));
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.rv-dist { display: grid; gap: 8px; }
.rv-bar-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 0.86rem; color: var(--rv-muted); }
.rv-bar { height: 10px; border-radius: 999px; background: var(--rv-track); overflow: hidden; }
.rv-bar > span { display: block; height: 100%; min-width: 0; border-radius: 999px; background: var(--rv-gold); }
.rv-pct { text-align: right; color: var(--rv-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .rv-summary { grid-template-columns: 1fr; } }

/* ---- photos & videos row ---- */
.rv-block { margin-bottom: 30px; }
.rv-block-head, .rv-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rv-block-head h3, .rv-list-head h3 { margin: 0; font-size: clamp(1.35rem, 5vw, 1.6rem); font-weight: 800; color: var(--rv-green-dark); }
.rv-see-all { background: none; border: 0; color: var(--rv-green); font: 700 1rem var(--font-head); cursor: pointer; padding: 8px 4px; min-height: 44px; }
.rv-media-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
@media (pointer: coarse) { .rv-media-row { scrollbar-width: none; } .rv-media-row::-webkit-scrollbar { display: none; } }
.rv-media-item { position: relative; flex: 0 0 auto; width: 140px; height: 140px; border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: #e9eee9; cursor: pointer; scroll-snap-align: start; }
.rv-media-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(20, 24, 22, 0.62); color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.rv-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(20, 24, 22, 0.72); color: #fff; font: 700 0.72rem var(--font-head); padding: 2px 7px; border-radius: 999px; }
.rv-dur:empty { display: none; }
@media (min-width: 720px) { .rv-media-item { width: 168px; height: 168px; } }

/* ---- sort + cards ---- */
.rv-list-head { margin-top: 4px; }
.rv-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; color: var(--rv-muted); }
.rv-sort select { font: 600 0.95rem var(--font-body); color: var(--rv-ink); border: 1px solid var(--rv-line); border-radius: 999px; padding: 8px 12px; background: #fff; min-height: 44px; }
.rv-card { border: 1px solid var(--rv-line); border-radius: 18px; padding: 16px; margin-bottom: 16px; background: #fff; scroll-margin-top: 90px; }
.rv-card.rv-pinned { border-color: var(--rv-green); }
.rv-card.rv-flash { animation: rv-flash 2.4s ease; }
@keyframes rv-flash { 0%, 60% { box-shadow: 0 0 0 4px rgba(14, 107, 53, 0.35); } 100% { box-shadow: 0 0 0 0 rgba(14, 107, 53, 0); } }
.rv-card-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; }
.rv-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 1.15rem var(--font-head); background: hsl(var(--h, 140) 42% 88%); color: hsl(var(--h, 140) 45% 24%); }
.rv-who { display: grid; gap: 4px; min-width: 0; }
.rv-who strong { font-family: var(--font-head); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-who .rv-stars { font-size: 1.15rem; }
.rv-date { font-size: 0.88rem; color: var(--rv-muted); white-space: nowrap; }
.rv-menu-wrap { position: relative; }
.rv-kebab { width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--rv-ink); }
.rv-kebab:hover { background: #f0f3f0; }
.rv-menu { position: absolute; right: 0; top: 46px; z-index: 5; min-width: 160px; background: #fff; border: 1px solid var(--rv-line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14); padding: 6px; }
.rv-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font: 600 0.95rem var(--font-body); cursor: pointer; color: var(--rv-ink); min-height: 44px; }
.rv-menu button:hover:not(:disabled) { background: #f0f3f0; }
.rv-menu button:disabled { color: var(--rv-muted); cursor: default; }
.rv-card-title { margin: 12px 0 10px; font-size: 1.12rem; font-weight: 800; }
.rv-card-body { margin-top: 12px; }
.rv-card-title + .rv-card-body { margin-top: 0; }
.rv-card-body.has-media { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: 14px; align-items: start; }
.rv-thumb { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: #e9eee9; cursor: pointer; }
.rv-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-text { margin: 0; font-size: 1rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.rv-text.expanded { -webkit-line-clamp: unset; line-clamp: unset; display: block; overflow: visible; }
.rv-readmore { margin-top: 6px; padding: 8px 0; min-height: 44px; border: 0; background: none; color: var(--rv-green); font: 700 1rem var(--font-body); cursor: pointer; }
.rv-strip { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rv-mini { position: relative; width: 60px; height: 60px; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: #e9eee9; cursor: pointer; }
.rv-mini-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-mini .rv-play { width: 26px; height: 26px; } .rv-mini .rv-play svg { width: 14px; height: 14px; } .rv-mini .rv-dur { display: none; }
.rv-mini-more { font: 800 1rem var(--font-head); color: var(--rv-green-dark); background: #e4f1e8; }
.rv-thumb .rv-play { width: 40px; height: 40px; }
.rv-card-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.rv-act { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 4px; min-height: 44px; font: 500 1rem var(--font-body); color: var(--rv-ink); cursor: pointer; border-radius: 10px; }
.rv-act:hover { color: var(--rv-green); }
.rv-helpful[aria-pressed="true"] { color: var(--rv-green); font-weight: 700; }
.rv-helpful[aria-pressed="true"] svg path { fill: currentColor; fill-opacity: 0.15; }
.rv-sep { width: 1px; height: 24px; background: #cfd6d1; }

/* ---- actions ---- */
.rv-cta { margin-top: 22px; }
.rv-write { width: 100%; min-height: 56px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; background: var(--rv-green); color: #fff; font: 800 1.15rem var(--font-head); cursor: pointer; box-shadow: 0 6px 16px rgba(14, 107, 53, 0.25); }
.rv-write:hover { background: var(--rv-green-hover); }
.rv-signin-hint { text-align: center; margin: 12px 0 0; color: var(--rv-muted); font-size: 0.95rem; }
.rv-link { border: 0; background: none; padding: 4px; color: var(--rv-link); font: inherit; text-decoration: underline; cursor: pointer; min-height: 32px; }
.rv-or { display: flex; align-items: center; gap: 14px; margin: 18px 0; color: var(--rv-muted); font-size: 0.9rem; }
.rv-or::before, .rv-or::after { content: ""; flex: 1; height: 1px; background: #cfd6d1; }
.rv-more { width: 100%; min-height: 54px; border: 2px solid var(--rv-green); border-radius: 14px; background: #fff; color: var(--rv-green-dark); font: 800 1.1rem var(--font-head); cursor: pointer; }
.rv-more:hover:not(:disabled) { background: #eef7f1; }
.rv-more:disabled { opacity: 0.6; cursor: wait; }

/* ---- shared focus ---- */
.reviews-section button:focus-visible, .rv-modal button:focus-visible, .rv-modal input:focus-visible, .rv-modal textarea:focus-visible, .rv-modal select:focus-visible,
.reviews-section select:focus-visible, .rv-viewer button:focus-visible { outline: 3px solid var(--rv-green); outline-offset: 2px; }

/* ---- dialogs (bottom sheet on phones, centred card on larger screens) ---- */
.rv-modal { position: fixed; inset: 0; z-index: 300; background: rgba(15, 22, 18, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.rv-modal[hidden], .rv-viewer[hidden], .rv-toast[hidden] { display: none; }
.rv-sheet { width: 100%; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); color: var(--rv-ink); }
@media (min-width: 620px) { .rv-modal { align-items: center; padding: 20px; } .rv-sheet { max-width: 560px; border-radius: 22px; } .rv-sheet-sm { max-width: 460px; } .rv-sheet-lg { max-width: 760px; } }
.rv-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rv-sheet-head h3 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--rv-green-dark); }
.rv-x { width: 44px; height: 44px; border: 0; background: #f0f3f0; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.rv-field, .rv-stars-field { display: block; margin: 14px 0 0; border: 0; padding: 0; font-weight: 700; font-size: 0.98rem; }
.rv-stars-field legend { padding: 0; font-weight: 700; margin-bottom: 4px; }
.rv-req { color: var(--rv-danger); }
.rv-opt { color: var(--rv-muted); font-weight: 500; }
.rv-label { display: block; margin-bottom: 6px; }
.rv-field input[type=text], .rv-field textarea, .rv-reasons + .rv-field textarea { width: 100%; margin-top: 6px; border: 1.5px solid #c6d0c9; border-radius: 12px; padding: 12px; font: 400 1rem var(--font-body); background: #fff; color: var(--rv-ink); }
.rv-field textarea { resize: vertical; min-height: 110px; }
.rv-count { display: block; text-align: right; margin-top: 4px; font-size: 0.8rem; color: var(--rv-muted); font-weight: 500; }
.rv-star-input { display: flex; gap: 2px; }
.rv-star-btn { width: 48px; height: 48px; border: 0; background: none; font-size: 2.3rem; line-height: 1; color: #cfd3cf; cursor: pointer; border-radius: 10px; }
.rv-star-btn.on { color: var(--rv-gold); }
.rv-hint { margin: 8px 0 0; font-size: 0.86rem; color: var(--rv-muted); font-weight: 500; }
.rv-add-media { width: 100%; min-height: 48px; border: 1.5px dashed #9db3a4; border-radius: 12px; background: #f4faf6; color: var(--rv-green-dark); font: 700 0.98rem var(--font-body); cursor: pointer; }
.rv-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rv-prev { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: #222; }
.rv-prev img, .rv-prev video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-badge { position: absolute; left: 3px; bottom: 3px; background: rgba(0, 0, 0, 0.65); color: #fff; font: 700 9px var(--font-head); padding: 1px 5px; border-radius: 4px; }
.rv-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(0, 0, 0, 0.55); color: #fff; }
.rv-ov-err { background: rgba(140, 26, 26, 0.82); font-size: 0.9rem; }
.rv-retry { border: 0; border-radius: 6px; background: #fff; color: var(--rv-danger); font: 700 0.72rem var(--font-body); padding: 3px 7px; cursor: pointer; }
.rv-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: rv-spin 0.7s linear infinite; }
@keyframes rv-spin { to { transform: rotate(360deg); } }
.rv-pctl { font: 700 0.7rem var(--font-head); }
.rv-prev-x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.rv-error { margin: 12px 0 0; color: var(--rv-danger); font-weight: 600; font-size: 0.95rem; }
.rv-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.rv-btn-primary, .rv-btn-ghost { flex: 1; min-height: 50px; border-radius: 12px; font: 800 1rem var(--font-head); cursor: pointer; }
.rv-btn-primary { border: 0; background: var(--rv-green); color: #fff; }
.rv-btn-primary:hover:not(:disabled) { background: var(--rv-green-hover); }
.rv-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.rv-btn-ghost { border: 2px solid #c6d0c9; background: #fff; color: var(--rv-ink); }
.rv-reasons { border: 0; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.rv-reasons label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.rv-reasons input { width: 20px; height: 20px; accent-color: var(--rv-green); }
.rv-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 8px; }
.rv-grid-item { width: 100%; height: auto; aspect-ratio: 1; }
.rv-gallery-grid + .rv-more { margin-top: 14px; }

/* ---- full-screen viewer ---- */
.rv-viewer { position: fixed; inset: 0; z-index: 320; background: rgba(8, 12, 10, 0.95); display: flex; align-items: center; justify-content: center; }
.rv-viewer-stage { max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 52px; box-sizing: border-box; width: 100%; height: 100%; }
.rv-viewer-stage img, .rv-viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.rv-viewer-close, .rv-viewer-nav { position: absolute; z-index: 2; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer; width: 48px; height: 48px; font-size: 2rem; line-height: 1; }
.rv-viewer-close { top: 12px; right: 12px; }
.rv-viewer-nav { top: 50%; transform: translateY(-50%); }
.rv-vprev { left: 8px; } .rv-vnext { right: 8px; }
.rv-viewer-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font: 600 0.9rem var(--font-body); }
@media (max-width: 520px) { .rv-viewer-stage { padding: 56px 8px; } .rv-viewer-nav { top: auto; bottom: 10px; transform: none; } .rv-viewer-count { bottom: 26px; } }

.rv-toast { position: fixed; z-index: 330; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: min(92vw, 420px); background: #1f2421; color: #fff; padding: 12px 18px; border-radius: 999px; font: 600 0.95rem var(--font-body); text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }

@media (prefers-reduced-motion: reduce) { .rv-card.rv-flash, .rv-spin { animation: none; } .rv-media-row { scroll-behavior: auto; } }

/* ---- owner dashboard: Reviews panel ---- */
.admin-review-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; margin-right: 4px; vertical-align: middle; }
.admin-review-media { display: inline-block; font-size: 1.5rem; margin-right: 6px; text-decoration: none; }
.admin-review-hidden td { opacity: 0.6; }
.admin-review-report { font-size: 0.8rem; margin-bottom: 4px; }
.admin-review-report.is-resolved, .admin-review-report.is-dismissed { color: var(--muted); text-decoration: line-through; }
