/* Tailovo — customer reviews: home section + /reviews/ page.
   The rating box (.tv-rsum) and the review card (.tv-rcard) mirror the
   product page reviews tab (product.css), so stars, bars and cards look
   the same everywhere. Loaded only on the home page and /reviews/. */

/* ===== Rating box ===== */
.tv-rsum {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px 16px;
  background: #fbfcfc;
  min-width: 0;
}
.tv-rsum__score { display: grid; gap: 6px; padding-bottom: 4px; }
.tv-rsum__top { display: flex; align-items: baseline; gap: 4px; }
.tv-rsum__big { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: #191919; }
.tv-rsum__outof { font-size: 15px; font-weight: 700; color: #6b7280; }
.tv-rsum__stars { display: inline-flex; align-items: center; gap: 2px; }
.tv-rsum__stars .kib-product-rating__svg,
.tv-rsum__stars .tv-star-frac { width: 18px; height: 18px; }
.tv-rsum__count { margin: 0; font-size: 12.5px; color: #4b5563; }
.tv-rsum__note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  font-size: 11.5px;
  font-weight: 600;
}
.tv-rsum__bars { display: grid; gap: 4px; }
.tv-rsum__bar {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #1f2937;
  text-decoration: none;
  transition: background-color 0.16s ease;
}
a.tv-rsum__bar:hover { background: #f2f5f3; }
.tv-rsum__label { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; white-space: nowrap; }
.tv-rsum__label b { min-width: 9px; font-weight: 700; }
.tv-rsum__label .kib-product-rating__svg { width: 13px; height: 13px; flex-shrink: 0; display: block; }
.tv-rsum__label span { font-size: 12px; color: #6b7280; }
.tv-rsum__track { display: block; height: 8px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.tv-rsum__track > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff9800 0%, #ffb300 100%);
  border-radius: 999px;
}
.tv-rsum__value { text-align: right; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tv-rsum__value b { font-weight: 700; color: #111827; }
.tv-rsum__value em { font-style: normal; font-size: 11.5px; color: #6b7280; }

/* ===== Review card (product page style) ===== */
.tv-rcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  background: #faf8f5;
  border-radius: var(--radius);
}
.tv-rcard[hidden] { display: none; }
.tv-rcard__head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tv-rcard__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.tv-rcard__who { display: grid; min-width: 0; line-height: 1.25; }
.tv-rcard__who b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tv-rcard__who small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11.5px; font-weight: 600; color: var(--success); }
.tv-rcard__rate { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tv-rcard__when { flex: none; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.tv-rcard__stars { display: inline-flex; gap: 2px; }
.tv-rgrid .tv-rcard__place { display: none; }
.tv-rcard__stars .kib-product-rating__svg { width: 15px; height: 15px; display: block; }
.tv-rcard__variant { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: 12px; color: var(--text-muted); }
.tv-rcard__variant b { color: var(--text-secondary); font-weight: 600; }
.tv-rcard__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.tv-rgrid .tv-rcard__text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Photos: one row, up to 3, "+N" over the third. */
.tv-rcard__photos { display: flex; gap: 8px; margin-top: 2px; }
.tv-rcard__photo {
  position: relative;
  flex: 0 1 72px;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: var(--bg-muted);
  cursor: zoom-in;
}
.tv-rcard__photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.tv-rcard__photo:hover img { transform: scale(1.06); }
.tv-rcard__photo:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.tv-rcard__more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(24, 34, 31, 0.55);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.tv-rcard__product {
  margin-top: auto;
  padding-top: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-primary);
}
.tv-rcard__product:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ===== Home: review rows + sticky rating box on the right ===== */
.tv-home .tv-panel.tv-rhome-panel { overflow: visible; } /* sticky needs a visible overflow */
.tv-rhome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  padding: 4px 22px 0;
}
.tv-rhome__side { position: sticky; top: calc(var(--header-h) + 20px); }
.tv-rgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start; /* each card keeps its own height */
}
.tv-rgrid__foot { display: flex; justify-content: center; padding: 22px 0 24px; }
.tv-rgrid__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.tv-rgrid__more:hover { background: var(--brand-accent-soft); color: var(--brand-accent); }

@media (max-width: 1199px) {
  .tv-rhome { grid-template-columns: minmax(0, 1fr) 270px; }
  .tv-rgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .tv-rhome { grid-template-columns: minmax(0, 1fr); }
  .tv-rhome__side { position: static; order: -1; }
  .tv-rhome__side .tv-rsum { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; }
}
@media (max-width: 767px) {
  .tv-rhome { padding: 0; gap: 12px; }
  .tv-rsum { padding: 18px 5px; }
  .tv-rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tv-rgrid__foot { padding: 18px 0 20px; }
  .tv-rgrid__more { width: 100%; }
}
@media (max-width: 559px) {
  .tv-rhome__side .tv-rsum { grid-template-columns: minmax(0, 1fr); }
  .tv-rgrid .tv-rcard { padding: 12px; gap: 6px; }
  .tv-rgrid .tv-rcard__avatar { width: 28px; height: 28px; font-size: 12px; }
  .tv-rgrid .tv-rcard__head { gap: 8px; }
  .tv-rgrid .tv-rcard__who b { font-size: 13px; }
  .tv-rgrid .tv-rcard__who small { font-size: 10.5px; }
  .tv-rgrid .tv-rcard__rate { flex-wrap: wrap; justify-content: flex-start; gap: 2px 8px; }
  .tv-rgrid .tv-rcard__when { font-size: 11px; }
  .tv-rgrid .tv-rcard__stars .kib-product-rating__svg { width: 13px; height: 13px; }
  .tv-rgrid .tv-rcard__text { font-size: 13px; -webkit-line-clamp: 4; }
  .tv-rgrid .tv-rcard__photos { gap: 5px; }
  .tv-rgrid .tv-rcard__product { font-size: 11.5px; }
}

/* ===== /reviews/ page ===== */
.tv-rpage { padding-bottom: 56px; }
.tv-rpage__head { margin: 4px 0 24px; }
.tv-rpage__head h1 { margin: 0; font-size: 32px; line-height: 1.15; color: var(--text-primary); }
.tv-rpage__layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.tv-rpage__side { position: sticky; top: calc(var(--header-h) + 16px); }
.tv-rpage__side .tv-rsum { background: #fff; }

.tv-rfilters {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fff;
}
.tv-rfilters__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tv-rchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.tv-rchip:hover { background: var(--bg-subtle); }
.tv-rchip .kib-product-rating__svg { width: 13px; height: 13px; display: block; }
.tv-rchip em { font-style: normal; font-weight: 500; color: var(--text-muted); }
.tv-rchip.is-on { background: var(--brand-accent-soft); color: var(--brand-accent); }
.tv-rfilters__row { display: flex; flex-wrap: wrap; gap: 8px; }
.tv-rfilters__search { position: relative; flex: 1 1 240px; display: block; }
.tv-rfilters__search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.tv-rfilters__search input,
.tv-rfilters__select select {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}
.tv-rfilters__search input { padding: 0 12px 0 36px; }
.tv-rfilters__select { flex: 0 1 190px; }
.tv-rfilters__select select { padding: 0 10px; cursor: pointer; }
.tv-rfilters__search input:focus,
.tv-rfilters__select select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--brand-primary); }
.tv-rfilters__go { min-height: 40px; padding: 0 18px; font-size: 13px; border-radius: var(--radius-sm); }

.tv-rpage__count { margin: 16px 2px 12px; font-size: 13px; color: var(--text-muted); }
.tv-rpage__count a { color: var(--brand-accent); font-weight: 600; }
.tv-rlist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tv-rlist .tv-rcard { background: #fff; }
.tv-rlist .tv-rcard__product { margin-top: 4px; }
.tv-rpage__empty { display: grid; justify-items: center; gap: 12px; padding: 56px 20px; text-align: center; background: #fff; color: var(--text-secondary); }

.tv-rpager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 28px; }
.tv-rpager__num,
.tv-rpager__step {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
}
.tv-rpager a:hover { background: var(--bg-subtle); }
.tv-rpager__num.is-on { background: var(--brand-primary); color: #fff; }
.tv-rpager__gap { padding: 0 4px; color: var(--text-muted); }

@media (max-width: 1199px) {
  .tv-rlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .tv-rpage__layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tv-rpage__side { position: static; }
  .tv-rpage__side .tv-rsum { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; }
  .tv-rpage__side .tv-rsum__score { padding: 0 16px 0 0; }
}
@media (max-width: 767px) {
  .tv-rpage__head h1 { font-size: 25px; }
  .tv-rfilters { padding: 12px; }
  .tv-rfilters__chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
  .tv-rfilters__chips::-webkit-scrollbar { display: none; }
  .tv-rfilters__search { flex-basis: 100%; }
  .tv-rfilters__select { flex: 1 1 0; }
  .tv-rlist { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 559px) {
  .tv-rpage__side .tv-rsum { grid-template-columns: minmax(0, 1fr); }
  .tv-rpage__side .tv-rsum__score { padding: 0 0 4px; }
}

/* ===== Photo viewer ===== */
.tv-rview {
  width: min(880px, 100vw - 24px);
  max-height: 92vh;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  overflow: visible;
}
.tv-rview::backdrop { background: rgba(15, 22, 20, 0.82); }
.tv-rview img { display: block; width: 100%; max-height: calc(92vh - 24px); object-fit: contain; border-radius: 6px; }
.tv-rview__close,
.tv-rview__nav {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 34, 31, 0.88);
  color: #fff;
  cursor: pointer;
}
.tv-rview__close { top: 8px; right: 8px; width: 36px; height: 36px; font-size: 22px; z-index: 2; }
.tv-rview__nav { top: 50%; transform: translateY(-50%); width: 40px; height: 40px; font-size: 24px; line-height: 1; }
.tv-rview__nav--prev { left: 8px; }
.tv-rview__nav--next { right: 8px; }
.tv-rview__nav[hidden] { display: none; }
.tv-rview__count {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(24, 34, 31, 0.7);
  color: #fff;
  font-size: 12px;
}
.tv-rview__count:empty { display: none; }
