/* ---------- รีวิวร้าน ---------- */
:root { --star: #f2b33d; --star-off: #d7e3ee; }

/* หัวข้อ + คะแนนเฉลี่ย */
.rv-trust { display: flex; align-items: center; gap: 6px; }
.rv-trust svg { flex: none; width: 16px; height: 16px; color: var(--online); }
.rv-summary {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 16px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}
.rv-summary > b { font-family: var(--font-head); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--ink-900); }
.rv-summary div { display: grid; gap: 2px; }
.rv-summary small { font-size: .78rem; color: var(--ink-500); }
.rv-stars { color: var(--star); letter-spacing: 1px; font-size: .95rem; line-height: 1; white-space: nowrap; }

/* สไลด์ */
.rv-carousel { position: relative; }
.rv-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px 4px 18px; margin: 0 -4px; scrollbar-width: none; overscroll-behavior-x: contain;
  /* ขอบจาง ๆ บอกว่ายังเลื่อนต่อได้ */
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.rv-carousel.single .rv-track { mask-image: none; }
.rv-track::-webkit-scrollbar { display: none; }
.rv-track:focus-visible { outline: 2px solid var(--frost-400); outline-offset: 4px; border-radius: var(--radius); }

.rv-card {
  flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; min-width: 0;
  display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 18px; border-radius: var(--radius);
  background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.rv-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.rv-card.featured { background: linear-gradient(160deg, #fff, #eef7ff 70%); border-color: var(--ice-200); }
.rv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rv-verified {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; color: var(--online); background: var(--online-bg);
}
.rv-verified svg { width: 11px; height: 11px; }
.rv-text {
  margin: 0; color: var(--ink-700); font-size: .94rem; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden;
}
.rv-text::before { content: "“"; font-family: var(--font-head); font-size: 1.4rem; line-height: 0; color: var(--frost-400); margin-right: 2px; vertical-align: -6px; }
.rv-card.open .rv-text { -webkit-line-clamp: unset; line-clamp: unset; }
.rv-more { align-self: flex-start; margin-top: -6px; padding: 0; border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--frost-600); cursor: pointer; }
.rv-more:hover { text-decoration: underline; }
.rv-reply {
  margin: 0; padding: 9px 12px; border-radius: 12px; font-size: .84rem; color: var(--ink-700);
  background: var(--ice-50); border-left: 3px solid var(--frost-400); white-space: pre-line; overflow-wrap: anywhere;
}
.rv-reply b { display: block; font-size: .74rem; color: var(--frost-700); margin-bottom: 2px; }
.rv-who { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--ice-200); }
.rv-av {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-family: var(--font-head); font-weight: 600; color: #fff; background: linear-gradient(135deg, #8fd0ff, var(--frost-600));
}
.rv-who b { display: block; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.rv-who small { font-size: .76rem; color: var(--ink-500); }

.rv-nav {
  position: absolute; top: calc(50% - 10px); z-index: 2; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--ice-200); background: #fff; color: var(--frost-700); cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(33, 121, 196, .55); transform: translateY(-50%); transition: background .15s, transform .15s;
}
.rv-nav svg { width: 18px; height: 18px; }
.rv-nav:hover { background: var(--ice-50); transform: translateY(-50%) scale(1.06); }
.rv-nav:focus-visible { outline: 2px solid var(--frost-400); outline-offset: 2px; }
.rv-nav.prev { left: -18px; }
.rv-nav.next { right: -18px; }

.rv-dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.rv-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--ice-300); cursor: pointer; transition: width .25s, background .25s; }
.rv-dots button[aria-selected="true"] { width: 22px; background: var(--frost-500); }
.rv-dots button:focus-visible { outline: 2px solid var(--frost-400); outline-offset: 2px; }

/* ---------- ฟอร์มรีวิวในหน้าออเดอร์ ---------- */
.review-card { padding: 20px; border-radius: var(--radius); background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.review-head h2 { font-size: 1.05rem; }
.rv-msg { margin: 0 0 12px; font-size: .88rem; color: var(--ink-500); }
.rv-badge { font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.rv-badge.wait { color: #8a5a00; background: #fff4dc; }
.rv-badge.ok { color: var(--online); background: var(--online-bg); }
.rv-badge.no { color: var(--ink-500); background: var(--ice-100); }
.rv-mine { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--ice-200); }
.rv-mine p { margin: 0; font-size: .9rem; color: var(--ink-700); white-space: pre-line; overflow-wrap: anywhere; }
.rv-mine small { color: var(--ink-500); font-size: .8rem; }
.rv-edit { margin-top: 10px; padding: 0; border: 0; background: none; font: inherit; font-size: .86rem; font-weight: 600; color: var(--frost-600); cursor: pointer; }
.rv-edit:hover { text-decoration: underline; }

.review-form { display: grid; gap: 12px; }
.star-input { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.star-input legend { padding: 0; margin-bottom: 4px; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
/* เรียง 5→1 แล้วกลับด้าน: ชี้/เลือกดาวไหน ดาวทางซ้ายติดด้วย */
.stars-row { display: inline-flex; flex-direction: row-reverse; }
.stars-row label { position: relative; cursor: pointer; padding: 0 2px; font-size: 1.9rem; line-height: 1; color: var(--star-off); transition: color .12s, transform .12s; }
.stars-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-row label:hover, .stars-row label:hover ~ label,
.stars-row:not(:hover) label:has(input:checked), .stars-row:not(:hover) label:has(input:checked) ~ label { color: var(--star); }
.stars-row label:hover { transform: scale(1.12); }
.stars-row label:has(input:focus-visible) { outline: 2px solid var(--frost-400); outline-offset: 1px; border-radius: 6px; }
.star-label { font-size: .84rem; font-weight: 600; color: var(--ink-700); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.rf { display: grid; gap: 4px; }
.rf > span { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
.rf small { font-weight: 500; color: var(--ink-300); }
.rf input, .rf textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink-900); padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--ice-200); background: #fff; outline: none; resize: vertical;
}
.rf textarea { min-height: 84px; }
.rf input:focus, .rf textarea:focus { border-color: var(--frost-400); box-shadow: 0 0 0 3px rgba(107, 182, 238, .22); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rv-note { margin: 0; font-size: .78rem; color: var(--ink-500); }
.rv-error { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: .86rem; color: #b3261e; background: #fdecea; }
.review-form .btn-frost { margin-top: 0; }

@media (max-width: 1000px) {
  .rv-card { flex-basis: calc((100% - 16px) / 2); }
}
@media (max-width: 720px) {
  .section-head:has(.rv-summary) { flex-direction: column; align-items: flex-start; }
  .rv-card { flex-basis: 86%; }
  .rv-nav { display: none; }
}
