/* ByAnhStudio v2 — product reviews. Loaded by byanh-reviews-v2.php. */

/* ---- Stars: a star mask over a two-colour fill, so 4.6 shows 4.6 stars ---- */
.byanh-page .byr-stars {
  --byr-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 24'%3E%3Cpath transform='translate(1 0)' d='M12 2.2l2.95 6.1 6.7.95-4.85 4.7 1.15 6.65L12 17.45 6.05 20.6l1.15-6.65L2.35 9.25l6.7-.95z'/%3E%3C/svg%3E");
  --byr-w: calc(var(--byr-s, 16px) * 26 / 24);
  display: inline-block;
  flex: none;
  vertical-align: middle;
  width: calc(var(--byr-w) * 5);
  height: var(--byr-s, 16px);
  background: linear-gradient(90deg, var(--brand-primary) var(--byr-pct, 0%), var(--color-line-300) var(--byr-pct, 0%));
  -webkit-mask: var(--byr-star) 0 0 / var(--byr-w) var(--byr-s, 16px) repeat-x;
          mask: var(--byr-star) 0 0 / var(--byr-w) var(--byr-s, 16px) repeat-x;
}
.byanh-page .byr-stars--one { width: var(--byr-w); }

/* ---- Product card (design option B) ---- */
.byanh-page .byr-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: var(--text-caption-size);
  line-height: 1;
  color: var(--text-secondary);
}
.byanh-page .byr-card-rating + .product-card__price { margin-top: 0; }

/* ---- Line under the product title ---- */
.byanh-page .byr-title-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--space-3);
  padding: 4px 0;
  color: var(--text-primary);
  text-decoration: none;
}
.byanh-page .byr-title-line__avg { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.byanh-page .byr-title-line__n { color: var(--text-secondary); font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; }
.byanh-page .byr-title-line:hover .byr-title-line__n { color: var(--text-primary); }

/* ---- Section ---- */
.byanh-page .byr { scroll-margin-top: 96px; }
.byanh-page .byr > .headline { margin: 0 0 var(--space-6); }
.byanh-page .byr-muted { color: var(--text-secondary); font-size: var(--text-body-sm-size); margin: 0; }
.byanh-page .byr-mono { font-family: var(--font-mono); }
.byanh-page .byr-overline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-overline-size);
  letter-spacing: var(--text-overline-ls);
  text-transform: uppercase;
  color: var(--brand-primary-active);
}
.byanh-page .byr-pending { color: var(--text-secondary); letter-spacing: 0.04em; }

.byanh-page .byr-notice {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 700;
}
.byanh-page .byr-notice--ok { background: var(--color-success-bg); color: var(--color-success-text); }
.byanh-page .byr-notice--err { background: var(--color-error-bg); color: var(--color-error-text); }

/* The swatch plugin styles every bare button on product pages. Reset ours. */
.byanh-page .byr button:not(.btn):not(.chip) {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.byanh-page .byr button:focus-visible,
.byanh-page .byr a:focus-visible,
.byanh-page .byr-rate__stars input:focus-visible + label { outline: 3px solid var(--brand-primary); outline-offset: 3px; border-radius: 8px; }
.byanh-page .byr .btn svg { width: 18px; height: 18px; }

.byanh-page .byr-grid { display: grid; gap: var(--space-7); }
@media (min-width: 900px) {
  .byanh-page .byr-grid { grid-template-columns: 320px minmax(0, 1fr); gap: 72px; align-items: start; }
  .byanh-page .byr-summary { position: sticky; top: 110px; }
}

/* ---- Summary ---- */
.byanh-page .byr-summary { display: flex; flex-direction: column; gap: var(--space-5); }
.byanh-page .byr-score { display: flex; align-items: flex-end; gap: 14px; }
.byanh-page .byr-score__avg { font-family: var(--font-display); font-weight: 800; font-size: 4rem; line-height: 0.9; letter-spacing: -0.02em; }
.byanh-page .byr-score__side { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }

.byanh-page .byr-bars { display: flex; flex-direction: column; gap: 2px; }
.byanh-page .byr .byr-bar {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 12px;
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 7px 8px;
  border-radius: 8px;
  text-align: left;
}
.byanh-page .byr .byr-bar:hover:not(:disabled) { background: var(--color-peach-050); }
.byanh-page .byr .byr-bar[aria-pressed="true"] { background: var(--color-peach-100); }
.byanh-page .byr .byr-bar:disabled { cursor: default; opacity: 0.55; }
.byanh-page .byr-bar__n { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: var(--text-body-sm-size); }
.byanh-page .byr-bar__track { height: 8px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; display: flex; }
.byanh-page .byr-bar__track span { background: var(--brand-primary); border-radius: var(--radius-full); }
.byanh-page .byr-bar__c { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); text-align: right; }

.byanh-page .byr-cta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-peach-050); }
.byanh-page .byr-cta__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

/* ---- Toolbar ---- */
.byanh-page .byr-main { min-width: 0; }
.byanh-page .byr-toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; padding-bottom: var(--space-5); border-bottom: 1px solid var(--border-subtle); }
.byanh-page .byr-chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.byanh-page .byr-chips .chip svg { width: 15px; height: 15px; }
.byanh-page .byr-chips .chip { cursor: pointer; }
.byanh-page .byr-chips .chip[aria-pressed="true"] .chip__n { color: inherit; opacity: 0.85; }
.byanh-page .byr-sort { display: flex; align-items: center; gap: 10px; font-size: var(--text-body-sm-size); color: var(--text-secondary); }
.byanh-page .byr-sort select {
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 9px 16px;
  font-size: var(--text-body-sm-size);
  font-weight: 700;
  color: var(--text-primary);
  background-color: var(--surface-card);
  cursor: pointer;
}

/* ---- Review ---- */
.byanh-page .byr-review { display: flex; flex-direction: column; gap: 14px; padding: 28px 0; border-bottom: 1px solid var(--border-subtle); }
.byanh-page .byr-review[hidden] { display: none; }
.byanh-page .byr-review--mine { padding: 24px 28px; margin-bottom: var(--space-5); border: 0; border-radius: var(--radius-lg); background: var(--color-peach-050); }
.byanh-page .byr-review__mine-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.byanh-page .byr-review__actions { display: flex; gap: var(--space-2); }
.byanh-page .byr .byr-link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--radius-full); font-weight: 700; font-size: var(--text-body-sm-size); color: var(--text-primary); }
.byanh-page .byr .byr-link-btn:hover { background: #fff; }
.byanh-page .byr .byr-link-btn--danger { color: var(--color-error-text); }
.byanh-page .byr-link-btn svg { width: 16px; height: 16px; }
.byanh-page .byr-delete { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: #fff; font-weight: 700; font-size: var(--text-body-sm-size); }
.byanh-page .byr-delete[hidden] { display: none; }
.byanh-page .byr .byr-btn-sm { padding: 8px 18px; font-size: 0.85rem; }

.byanh-page .byr-review__top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.byanh-page .byr-review__top time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }
.byanh-page .byr-review__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.byanh-page .byr-review__body { max-width: 720px; overflow-wrap: anywhere; }
.byanh-page .byr-review__body p { margin: 0 0 0.6em; }
.byanh-page .byr-review__body p:last-child { margin-bottom: 0; }
.byanh-page .byr-review__photos { display: flex; gap: 10px; flex-wrap: wrap; }
.byanh-page .byr .byr-photo { width: 88px; height: 88px; border-radius: var(--radius-md); overflow: hidden; background: var(--color-peach-050); }
.byanh-page .byr-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.byanh-page .byr-review__who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.byanh-page .byr-avatar { width: 34px; height: 34px; flex: none; border-radius: var(--radius-full); background: var(--color-peach-100); color: var(--brand-primary-active); font-family: var(--font-display); font-weight: 700; font-size: 0.875rem; display: inline-flex; align-items: center; justify-content: center; }
.byanh-page .byr-review__name { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.byanh-page .byr-verified { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-full); background: var(--color-success-bg); color: var(--color-success-text); font-weight: 700; font-size: var(--text-caption-size); }
.byanh-page .byr-verified svg { width: 13px; height: 13px; stroke-width: 3; }
.byanh-page .byr-review__variant { color: var(--text-secondary); font-size: var(--text-body-sm-size); }
.byanh-page .byr-reply { margin: 4px 0 0 46px; padding: 16px 20px; border-radius: var(--radius-md); background: var(--color-peach-050); max-width: 640px; }
.byanh-page .byr-review--mine .byr-reply { background: #fff; }
.byanh-page .byr-reply__who { font-family: var(--font-display); font-weight: 700; font-size: 0.875rem; }
.byanh-page .byr-reply__who span { font-family: var(--font-body); font-weight: 600; color: var(--text-secondary); }
.byanh-page .byr-reply__body { margin-top: 6px; font-size: 0.95rem; }
.byanh-page .byr-reply__body p { margin: 0 0 0.5em; }
.byanh-page .byr-reply__body p:last-child { margin-bottom: 0; }

.byanh-page .byr-none { margin: var(--space-5) 0 0; color: var(--text-secondary); }
.byanh-page .byr-more { display: flex; align-items: center; gap: var(--space-4); padding-top: var(--space-6); flex-wrap: wrap; }
.byanh-page .byr-more .btn[hidden] { display: none; }

/* ---- Empty ---- */
.byanh-page .byr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: 44px var(--space-6); border: 1.5px dashed var(--border-default); border-radius: var(--radius-lg); }
.byanh-page .byr-empty h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.byanh-page .byr-empty p { margin: 0 0 var(--space-2); color: var(--text-secondary); max-width: 420px; }

/* ---- Dialogs ---- */
.byanh-page .byr-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
}
.byanh-page .byr-dialog::backdrop { background: rgba(34, 48, 58, 0.45); }
.byanh-page .byr-dialog[open] { display: flex; flex-direction: column; }
.byanh-page .byr-dialog__inner { display: flex; flex-direction: column; min-height: 0; max-height: inherit; position: relative; }
.byanh-page .byr .byr-dialog__close { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-full); color: var(--text-primary); }
.byanh-page .byr .byr-dialog__close:hover { background: var(--surface-sunken); }
.byanh-page .byr-dialog__close svg { width: 22px; height: 22px; }

.byanh-page .byr-signin { padding: 40px; gap: var(--space-3); align-items: flex-start; }
.byanh-page .byr-signin .byr-dialog__close { position: absolute; top: 12px; right: 12px; }
.byanh-page .byr-signin__icon { width: 56px; height: 56px; border-radius: var(--radius-full); background: var(--color-peach-050); color: var(--brand-primary-active); display: flex; align-items: center; justify-content: center; }
.byanh-page .byr-signin__icon svg { width: 26px; height: 26px; }
.byanh-page .byr-signin h2 { margin: var(--space-2) 0 0; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.byanh-page .byr-signin p { margin: 0; max-width: 520px; }
.byanh-page .byr-signin .btn-row { margin-top: var(--space-2); }

.byanh-page .byr-form__head { display: flex; align-items: center; gap: var(--space-4); padding: 20px 20px 20px 28px; border-bottom: 1px solid var(--border-subtle); }
.byanh-page .byr-form__head img { width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: cover; flex: none; }
.byanh-page .byr-form__head > div { flex: 1; min-width: 0; }
.byanh-page .byr-form__head h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.2; }
.byanh-page .byr-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.byanh-page .byr-form__body { padding: 24px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-5); }
.byanh-page .byr-form__body .field { margin-top: 0; }
.byanh-page .byr-form__body .field input[type="text"],
.byanh-page .byr-form__body .field textarea { width: 100%; }
.byanh-page .byr-form__foot { display: flex; align-items: center; gap: var(--space-3); padding: 16px 28px 20px; border-top: 1px solid var(--border-subtle); background: var(--surface-card); }
.byanh-page .byr-label { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
.byanh-page .byr-opt { font-family: var(--font-body); font-weight: 600; color: var(--text-secondary); }
.byanh-page .byr-hint-row { display: flex; justify-content: space-between; gap: var(--space-4); }

.byanh-page .byr-rate { border: 0; margin: 0; padding: 0; min-width: 0; }
.byanh-page .byr-rate legend { padding: 0; margin-bottom: var(--space-2); font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
.byanh-page .byr-rate__row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.byanh-page .byr-rate__stars { display: flex; }
.byanh-page .byr-rate__stars label { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.byanh-page .byr-rate__stars svg { width: 38px; height: 38px; fill: #fff; stroke: var(--color-ink-400); stroke-width: 1.3; stroke-linejoin: round; transition: fill var(--transition-fast), stroke var(--transition-fast); }
.byanh-page .byr-rate__stars label.is-on svg { fill: var(--brand-primary); stroke: var(--brand-primary); }
.byanh-page .byr-rate.is-invalid .byr-rate__stars svg { stroke: var(--color-error-text); }
.byanh-page .byr-rate__label { font-family: var(--font-display); font-weight: 600; }

.byanh-page .byr-bought { display: flex; align-items: flex-start; gap: var(--space-3); margin: 0; padding: 14px 18px; border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 0.95rem; }
.byanh-page .byr-bought svg { width: 20px; height: 20px; flex: none; margin-top: 2px; stroke: var(--color-success-text); stroke-width: 2.4; }
.byanh-page .byr-bought strong:last-child { color: var(--color-success-text); }
.byanh-page .byr-bought--plain { color: var(--text-secondary); }

.byanh-page .byr-photos { display: flex; gap: var(--space-3); flex-wrap: wrap; padding-top: 6px; }
.byanh-page .byr-photos__item { position: relative; width: 88px; height: 88px; }
.byanh-page .byr-photos__item img { width: 88px; height: 88px; border-radius: var(--radius-md); object-fit: cover; display: block; }
.byanh-page .byr-photos__item.is-removed img { opacity: 0.3; }
.byanh-page .byr-photos__remove,
.byanh-page .byr .byr-photos__drop { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: var(--radius-full); border: 2px solid #fff; background: var(--color-ink-900); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.byanh-page .byr-photos__remove svg,
.byanh-page .byr-photos__drop svg { width: 13px; height: 13px; stroke-width: 3; }
.byanh-page .byr-photos__add { width: 88px; height: 88px; border-radius: var(--radius-md); border: 1.5px dashed var(--color-ink-400); background: var(--color-peach-050); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
.byanh-page .byr-photos__add svg { width: 22px; height: 22px; }
.byanh-page .byr-photos__add[hidden] { display: none; }
.byanh-page .byr-photos__add:focus-within { outline: 3px solid var(--brand-primary); outline-offset: 3px; }

.byanh-page .byr-shown { display: flex; flex-direction: column; gap: var(--space-2); }
.byanh-page .byr-shown__row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.byanh-page .byr-shown__row a { color: var(--text-link); font-size: var(--text-body-sm-size); text-decoration: underline; text-underline-offset: 2px; }
.byanh-page .byr-check { margin-top: 0; }

.byanh-page .byr-lightbox { width: auto; max-width: calc(100vw - 32px); background: #000; }
.byanh-page .byr-lightbox img { display: block; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); object-fit: contain; }
.byanh-page .byr .byr-lightbox .byr-dialog__close { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.92); }

/* ---- Phone ---- */
@media (max-width: 600px) {
  .byanh-page .byr-score__avg { font-size: 3rem; }
  .byanh-page .byr-reply { margin-left: 0; }
  .byanh-page .byr-review--mine { padding: 20px; }
  .byanh-page .byr .byr-photo, .byanh-page .byr-photos__item, .byanh-page .byr-photos__item img, .byanh-page .byr-photos__add { width: 72px; height: 72px; }
  .byanh-page .byr-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .byanh-page .byr-form__head { padding: 12px 8px 12px 16px; }
  .byanh-page .byr-form__head img { display: none; }
  .byanh-page .byr-form__body { padding: 20px 16px; }
  .byanh-page .byr-form__foot { padding: 12px 16px 20px; }
  .byanh-page .byr-form__foot .btn--primary { flex: 1; }
  .byanh-page .byr-rate__stars label { width: 46px; }
  .byanh-page .byr-signin { padding: 32px 20px 28px; }
  .byanh-page .byr-lightbox { margin: auto; border-radius: var(--radius-lg); }
}

/* ---- Older products: the Advanced Product Fields note ----
   About 20 older products take their "Custom size" note from Advanced Product
   Fields, not from Relist. Draw it like Relist's "Custom order" box so every
   product page matches. Rides on the reviews preview until it goes live. */
/* It sits first inside the add-to-cart flex row, which already has space
   above, so it takes the full row and leaves the gap below instead. */
.byanh-page .wapf { flex: 0 0 100%; margin: 0 0 var(--space-3); }
.byanh-page .wapf .wapf-field-group,
.byanh-page .wapf .wapf-field-row { margin: 0; padding: 0; }
.byanh-page .wapf .wapf-field-container { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; margin: 0; padding: 0; }
.byanh-page .wapf .wapf-field-label { margin: 0; }
.byanh-page .wapf .wapf-field-label label { display: block; margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.byanh-page .wapf .wapf-field-description { margin: 0; font-size: var(--text-caption-size); line-height: 1.5; color: var(--text-secondary); }
.byanh-page .wapf .wapf-field-input textarea.wapf-input {
  width: 100%;
  min-height: 96px;
  margin: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: var(--text-body-size);
  line-height: 1.4;
  resize: vertical;
  box-shadow: none;
}
.byanh-page .wapf .wapf-field-input textarea.wapf-input:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 4px var(--focus-ring); }
