/*! ISHOD — конструктор сайтів ishod.studio. Код і шаблони — лише для сайтів на платформі ISHOD; копіювання й використання поза нею заборонено: https://ishod.studio/umovy/#p6 */
/* Блок «Відгуки» з зірками, джерелом, фото гостя й формою (templates/store/sections/reviews.html, клас .rv).
   Старий вигляд (лише ім'я й текст) — .reviews/.review у store.css, тут не чіпаємо.
   Кольори — лише змінні теми сайту (--bg, --surface, --text, --muted, --line, --accent): світлі й темні теми однаково. */
.rv {
  --rv-gap: calc(16px * var(--k, 1));
  --rv-pad: calc(22px * var(--k, 1));
  --rv-card: var(--surface);
  --rv-star: var(--accent);
  --rv-star-off: color-mix(in srgb, currentColor 20%, transparent);
  --rv-ava: color-mix(in srgb, var(--accent) 16%, var(--rv-card));
  --rv-ava-ink: var(--accent-ink, var(--accent));
  --rv-soft: color-mix(in srgb, currentColor 6%, transparent);
  display: grid; gap: calc(20px * var(--k, 1));
}
.sx--scheme-soft .rv { --rv-card: var(--bg); }
.sx--scheme-dark .rv { --rv-card: #1e1e24; --rv-ava: #2b2b33; --rv-ava-ink: #f4f4f5; }
.sx--scheme-accent .rv { --rv-card: rgba(255, 255, 255, .14); --rv-star: #fff; --rv-ava: rgba(255, 255, 255, .22); --rv-ava-ink: #fff; }

/* зірки: SVG, заповнені — акцент, порожні — напівпрозорий колір тексту */
.rv-stars { display: inline-flex; gap: 2px; line-height: 0; }
.rv-star { width: 17px; height: 17px; fill: var(--rv-star-off); }
.rv-star.is-on { fill: var(--rv-star); }

/* --- картка відгуку ----------------------------------------------------------------------------- */
.rv-list { display: grid; gap: var(--rv-gap); grid-template-columns: repeat(auto-fit, minmax(calc(260px * var(--k, 1)), 1fr)); }
.rvc {
  margin: 0; min-width: 0; background: var(--rv-card); border-radius: var(--radius); padding: var(--rv-pad);
  display: flex; flex-direction: column; gap: 12px; font-size: calc(1rem * (0.85 + var(--k, 1) * 0.15));
}
.rvc__text { margin: 0; font-size: 1.02em; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; flex: 1 0 auto; }
.rvc__dish { margin: 0; display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .9em; line-height: 1.4; }
.sx--scheme-accent .rvc__dish, .sx--scheme-dark .rvc__dish { color: inherit; opacity: .78; }
.rvc__dish svg { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.rvc__who { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.rvc__ava { flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.rvc__ava--ph { display: grid; place-items: center; background: var(--rv-ava); color: var(--rv-ava-ink);
  font: 700 1.05rem/1 var(--font-head); }
.rvc__meta { display: grid; min-width: 0; line-height: 1.3; }
.rvc__name { font-weight: 650; overflow-wrap: anywhere; }
.rvc__date { color: var(--muted); font-size: .86em; }
.sx--scheme-accent .rvc__date, .sx--scheme-dark .rvc__date { color: inherit; opacity: .72; }
.rvc__src { margin-left: auto; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--rv-soft); opacity: .8; }
.rvc__src svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rvc__src svg .dot { fill: currentColor; }
/* відповідь закладу під відгуком гостя */
.rvc__reply { margin: 2px 0 0; padding: 10px 0 2px 14px; border-left: 2px solid var(--rv-star); font-size: .92em; }
.rvc__reply b { display: block; font-size: .86em; margin-bottom: 2px; }
.rvc__reply p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--muted); }
.sx--scheme-accent .rvc__reply p, .sx--scheme-dark .rvc__reply p { color: inherit; opacity: .8; }
.rv-empty { margin: 0; color: var(--muted); }

/* --- «Велика цитата» з новими полями: одна колонка по центру ------------------------------------- */
.rv-list--quote { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; gap: calc(36px * var(--k, 1)); }
.rv--quote .rvc { background: transparent; padding: 0; align-items: center; text-align: center; }
.rv--quote .rvc__text { font-family: var(--font-head); font-size: clamp(1.2rem, 2.6vw, 1.65rem); line-height: 1.38; text-wrap: pretty; }
.rv--quote .rvc__who { justify-content: center; text-align: left; }
.rv--quote .rvc__src { margin-left: 4px; }
.rv--quote .rvc__dish { justify-content: center; }
.rv--quote .rvc__reply { text-align: left; max-width: 560px; }
.rv--quote .rv-foot { text-align: center; }

/* --- «Стрічка вбік»: гортається пальцем і колесом, картки чіпляються до краю -------------------------- */
.rv-list--rail {
  grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: min(calc(340px * var(--k, 1)), 84%);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 2px;
  padding: 2px 2px 14px; margin: -2px -2px 0;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, currentColor 25%, transparent) transparent;
}
.rv-list--rail > * { scroll-snap-align: start; }
.rv-list--rail:focus-visible { outline-offset: 4px; }
.rv-list--rail::-webkit-scrollbar { height: 6px; }
.rv-list--rail::-webkit-scrollbar-thumb { border-radius: 3px; background: color-mix(in srgb, currentColor 25%, transparent); }

/* --- «Оцінка й картки»: велика оцінка ліворуч — головний акцент блоку ------------------------------- */
.rv--summary { grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); align-items: start; gap: calc(36px * var(--k, 1)); }
.rv-sum { display: grid; gap: 12px; justify-items: start; position: sticky; top: 96px; }
.rv-sum__score { margin: 0; display: grid; gap: 10px; }
.rv-sum__num { font: 700 clamp(3.4rem, 7vw, 5.2rem)/.86 var(--font-head); letter-spacing: -.03em; font-variant-numeric: lining-nums; }
.rv-stars--big .rv-star { width: 24px; height: 24px; }
.rv-sum__count { margin: 0; font-weight: 600; }
.rv-sum__count a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.rv-sum__count a:hover { text-decoration-thickness: 2px; }
.rv-sum .rv-form { margin-top: 8px; justify-self: stretch; }
.rv-sum .rv-form > summary { width: auto; }
.rv-list--summary { grid-template-columns: repeat(auto-fill, minmax(calc(250px * var(--k, 1)), 1fr)); }
.sx--align-center .rv-sum { justify-items: center; text-align: center; }

/* --- форма «Залишити відгук» -------------------------------------------------------------------- */
.rv-foot { margin-top: 4px; }
.rv-form { max-width: 560px; }
.sx--align-center .rv-form, .rv--quote .rv-form { margin-inline: auto; }
.rv-form > summary { list-style: none; cursor: pointer; }
.rv-form > summary::-webkit-details-marker { display: none; }
.rv-form[open] > summary { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px var(--line); }
.sx--scheme-accent .rv-form > summary { background: #fff; color: var(--accent); }
.sx--scheme-accent .rv-form[open] > summary { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.rv-form__body {
  margin-top: 12px; display: grid; gap: 14px; padding: var(--rv-pad); border-radius: var(--radius);
  background: var(--rv-card); text-align: left;
}
.rv-sum:has(.rv-form[open]) { position: static; }  /* відкрита форма вища за екран — не «липне» */
.rv-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rv-fld { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.rv-fld small { font-weight: 400; color: var(--muted); }
.rv-fld input, .rv-fld textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; font: 400 16px/1.45 var(--font-body); color: var(--text);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: min(var(--radius), 12px);
}
.rv-fld textarea { resize: vertical; min-height: 110px; }
.rv-fld input:focus-visible, .rv-fld textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.sx--scheme-dark .rv-fld input, .sx--scheme-dark .rv-fld textarea { background: #121216; color: #f4f4f5; border-color: #3a3a44; }
.sx--scheme-accent .rv-fld input, .sx--scheme-accent .rv-fld textarea { background: #fff; color: #1c1917; border-color: transparent; }
.sx--scheme-accent .rv-fld small { color: inherit; opacity: .75; }
.rv-form__send { justify-self: start; }
.rv-form__note { margin: 0; font-size: .84rem; color: var(--muted); }
.sx--scheme-accent .rv-form__note, .sx--scheme-dark .rv-form__note { color: inherit; opacity: .75; }
.rv-form__err { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #dc2626 12%, transparent);
  font-size: .9rem; font-weight: 600; }

/* оцінка зірками в формі: радіокнопки, заповнюються до вибраної (і до тієї, на яку навели) */
.rv-rate { border: 0; margin: 0; padding: 0; min-width: 0; }
.rv-rate legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: .92rem; }
.rv-rate__row { display: flex; gap: 2px; margin-left: -5px; }
.rv-rate__s { position: relative; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border-radius: 10px; }
.rv-rate__s input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rv-rate__s svg { width: 32px; height: 32px; fill: var(--rv-star-off); transition: fill .12s ease, transform .12s ease; }
.rv-rate__s:has(input:checked) svg, .rv-rate__s:has(~ .rv-rate__s input:checked) svg { fill: var(--rv-star); }
.rv-rate__row:hover .rv-rate__s svg { fill: var(--rv-star-off); }
.rv-rate__row:hover .rv-rate__s:hover svg, .rv-rate__row:hover .rv-rate__s:has(~ .rv-rate__s:hover) svg { fill: var(--rv-star); }
.rv-rate__s:hover svg { transform: scale(1.08); }
.rv-rate__s:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.rv-rate__s:has(input:disabled) { cursor: default; }

.rv-thanks { margin: 0; display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--rv-card); font-weight: 600; }
.rv-thanks svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--rv-star); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* --- телефон: картки й «оцінка» — стрічкою вбік (як інші відгуки), без горизонтальної прокрутки сторінки -- */
@media (max-width: 760px) {
  .rv { --rv-pad: calc(18px * var(--k, 1)); }
  .rv--summary { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .rv-sum { position: static; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 16px; }
  .sx--align-center .rv-sum { grid-template-columns: minmax(0, 1fr); }
  .rv-sum__count { align-self: center; }
  .rv-sum .rv-form { grid-column: 1 / -1; margin-top: 0; }
  .rv-sum__num { font-size: clamp(3rem, 15vw, 3.8rem); }
  .rv-stars--big .rv-star { width: 20px; height: 20px; }
  .rv-list--cards, .rv-list--summary, .rv-list--rail {
    grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 84%; gap: 12px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    padding: 2px 2px 4px; margin: -2px -2px 0;
  }
  .rv-list--cards > *, .rv-list--summary > * { scroll-snap-align: start; }
  .rv-list--cards::-webkit-scrollbar, .rv-list--summary::-webkit-scrollbar, .rv-list--rail::-webkit-scrollbar { display: none; }
  .rv-form, .rv-form__send { width: 100%; }
  .rv-form > summary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .rv-rate__s svg { transition: none; }
  .rv-rate__s:hover svg { transform: none; }
  .rv-list { scroll-behavior: auto; }
}
