/* APERA Paket 2E — Verified Photo Reviews, Product Q&A & YASA-26 Form Modals (CLS=0, 0px Overflow, WCAG AA >= 4.5:1) */
.apera-rev-section, .apera-qa-section, .apera-form-dialog,
.apera-rev-section *, .apera-qa-section *, .apera-form-dialog * { box-sizing: border-box; }
.apera-rev-section, .apera-qa-section { width: 100%; max-width: 100%; min-width: 0; }

.apera-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.apera-hp-field { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; }

/* 1. Review Summary Hero (.apera-rev-hero) */
.apera-rev-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--apera-surface);
  border: 1px solid var(--apera-border);
  border-radius: var(--apera-radius-lg);
  min-width: 0;
}
@media (min-width: 768px) {
  .apera-rev-hero { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); align-items: center; padding: 18px 20px; }
  .apera-rev-hero-cta { grid-column: 1 / -1; }
}
@media (min-width: 992px) {
  .apera-rev-hero { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) auto; gap: 22px; }
  .apera-rev-hero-cta { grid-column: auto; }
}

.apera-rev-hero-score { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.apera-rev-overall-lbl { font-size: 12px; font-weight: 700; color: var(--apera-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.apera-rev-avg-row { display: flex; align-items: baseline; gap: 5px; line-height: 1.1; }
.apera-rev-avg-num { font-size: 34px; font-weight: 800; color: var(--apera-dark); letter-spacing: -0.02em; }
.apera-rev-avg-den { font-size: 15px; font-weight: 700; color: var(--apera-muted); }
.apera-rev-stars-lg { display: inline-flex; align-items: center; gap: 3px; margin: 2px 0; }
.apera-rev-count-txt { font-size: 13px; font-weight: 600; color: var(--apera-text); }
.apera-rev-sibling-note { display: inline-flex; align-items: flex-start; gap: 6px; margin-top: 6px; padding: 6px 9px; border-radius: 8px; background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A8A; font-size: 11.5px; font-weight: 600; line-height: 1.38; }
.apera-rev-sibling-note svg { flex-shrink: 0; margin-top: 1px; }

/* Fixed-Height Star Progress Bars (CLS = 0) */
.apera-rev-hero-bars { display: flex; flex-direction: column; gap: 6px; min-width: 0; width: 100%; }
.apera-rev-bar-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 32px; align-items: center; gap: 8px; height: 20px; }
.apera-rev-bar-lbl { font-size: 12.5px; font-weight: 700; color: var(--apera-dark); white-space: nowrap; }
.apera-rev-bar-track { height: 9px; width: 100%; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.apera-rev-bar-fill { height: 100%; border-radius: 999px; background: #D97706; transition: width 0.2s ease; }
.apera-rev-bar-cnt { font-size: 12px; font-weight: 700; color: var(--apera-muted); text-align: right; font-variant-numeric: tabular-nums; }

.apera-rev-hero-cta { display: flex; flex-direction: column; align-items: stretch; justify-content: center; min-width: 0; }
.apera-rev-write-btn { min-height: 46px; min-width: 44px; width: 100%; white-space: normal; text-align: center; cursor: pointer; }
@media (min-width: 992px) { .apera-rev-write-btn { width: auto; white-space: nowrap; } }
.apera-rev-login-note { font-size: 13px; color: var(--apera-muted); padding: 8px 10px; border-radius: 8px; background: #ffffff; border: 1px solid var(--apera-border); }

/* 2. Filter & Sort Toolbar (.apera-rev-toolbar) */
.apera-rev-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; min-width: 0; }
.apera-rev-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.apera-rev-pill {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--apera-border-input);
  background: #ffffff;
  color: var(--apera-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.apera-rev-pill:hover { border-color: var(--apera-dark); background: var(--apera-surface); }
.apera-rev-pill.is-active { background: var(--apera-dark); border-color: var(--apera-dark); color: #ffffff; }
.apera-rev-sort-wrap { width: 100%; max-width: 100%; }
@media (min-width: 768px) { .apera-rev-sort-wrap { width: auto; min-width: 220px; } }
.apera-rev-sort { min-height: 44px; border-color: var(--apera-border-input); color: var(--apera-dark); font-size: 13.5px; font-weight: 600; }

#review, #apera-qa-list { transition: opacity 0.16s ease; min-width: 0; }
#review.is-loading, #apera-qa-list.is-loading { opacity: 0.52; pointer-events: none; }

/* 3. Modern D2C Review Cards (.apera-rev-card) */
.apera-rev-list, .apera-qa-cards { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.apera-rev-card, .apera-qa-card { padding: 14px 16px; background: #ffffff; border: 1px solid #E2E8F0; border-radius: var(--apera-radius-lg); min-width: 0; }
.apera-rev-card-hd { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.apera-rev-user { display: flex; align-items: flex-start; gap: 10px; min-width: 0; flex: 1 1 220px; }
.apera-rev-avatar { width: 40px; height: 40px; min-width: 40px; border-radius: 999px; background: var(--apera-dark); color: #ffffff; font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.apera-rev-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.apera-rev-author-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.apera-rev-author, .apera-qa-author { font-size: 14px; font-weight: 700; color: var(--apera-dark); overflow-wrap: anywhere; }
.apera-rev-verified { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: #DCFCE7; border: 1px solid #BBF7D0; color: var(--apera-success-ink); font-size: 11.5px; font-weight: 700; line-height: 1.3; }
.apera-rev-variant { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; background: #F1F5F9; color: #334155; font-size: 11.5px; font-weight: 700; line-height: 1.3; }
.apera-rev-date, .apera-qa-date, .apera-rev-reply-date { font-size: 12px; color: var(--apera-muted); font-weight: 500; }
.apera-rev-rating { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.apera-rev-body, .apera-qa-q-txt { font-size: 14px; line-height: 1.55; color: var(--apera-text); overflow-wrap: anywhere; word-break: break-word; }

.apera-rev-photos { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.apera-rev-photo-btn {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--apera-border);
  background: var(--apera-surface);
  cursor: zoom-in;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.apera-rev-photo-btn:hover { border-color: var(--apera-red); }
.apera-rev-photo-btn img { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; display: block; }

.apera-rev-reply, .apera-qa-a { margin-top: 12px; padding: 11px 13px; border-radius: var(--apera-radius); background: var(--apera-surface); border-left: 3px solid var(--apera-red); }
.apera-qa-a { border-left-color: var(--apera-success); }
.apera-rev-reply-hd, .apera-qa-a-hd { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.apera-rev-reply-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: #FEF2F2; color: #991B1B; font-size: 11.5px; font-weight: 800; }
.apera-rev-reply-txt, .apera-qa-a-txt { font-size: 13.5px; line-height: 1.5; color: var(--apera-text); overflow-wrap: anywhere; word-break: break-word; }
.apera-rev-empty { padding: 24px 16px; text-align: center; background: var(--apera-surface); border: 1px dashed var(--apera-border); border-radius: var(--apera-radius-lg); color: var(--apera-text); font-size: 14px; }

/* 4. Product Q&A Section (.apera-qa-hero & Cards) */
.apera-qa-hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 16px; margin-bottom: 14px; background: var(--apera-surface); border: 1px solid var(--apera-border); border-radius: var(--apera-radius-lg); }
.apera-qa-hero-copy { flex: 1 1 280px; min-width: 0; }
.apera-qa-title { font-size: 18px; font-weight: 800; color: var(--apera-dark); margin: 0 0 4px; }
.apera-qa-sub { font-size: 13.5px; color: var(--apera-muted); margin: 0; line-height: 1.48; }
.apera-qa-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; width: 100%; }
@media (min-width: 768px) { .apera-qa-actions { width: auto; } }
.apera-qa-actions > .apera-btn-primary, .apera-qa-wa-btn { flex: 1 1 220px; white-space: normal; text-align: center; cursor: pointer; }
@media (min-width: 768px) { .apera-qa-actions > .apera-btn-primary, .apera-qa-wa-btn { flex: 0 0 auto; white-space: nowrap; } }
.apera-qa-wa-btn {
  min-height: 46px;
  min-width: 44px;
  padding: 10px 16px;
  border-radius: var(--apera-radius);
  background: #15803D;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.15s ease;
}
.apera-qa-wa-btn:hover { background: #166534; color: #ffffff !important; }
.apera-qa-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.apera-qa-badge-q { padding: 2px 8px; border-radius: 6px; background: #EFF6FF; color: #1E40AF; font-size: 11.5px; font-weight: 800; }
.apera-qa-badge-a { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: #DCFCE7; color: var(--apera-success-ink); font-size: 11.5px; font-weight: 800; }

/* 5. YASA-26 Protected <dialog> Form Modals & Photo Lightbox */
.apera-form-dialog {
  width: min(94vw, 560px);
  max-width: calc(100vw - 16px);
  max-height: min(92dvh, 860px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--apera-radius-lg);
  background: #ffffff;
  color: var(--apera-text);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.34);
  overflow: hidden;
}
.apera-form-dialog[open] { display: flex; flex-direction: column; }
.apera-form-dialog::backdrop, .apera-rev-lightbox::backdrop { background: rgba(15, 23, 42, 0.72); }
.apera-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 12px 18px; background: var(--apera-dark); color: #ffffff; flex-shrink: 0; }
.apera-dialog-title { font-size: 16px; font-weight: 800; color: #ffffff; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.apera-dialog-close { min-height: 44px; min-width: 44px; padding: 6px 12px; border-radius: 8px; border: 1px solid #475569; background: #1E293B; color: #ffffff; font-size: 13.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0; cursor: pointer; }
.apera-dialog-close:hover, .apera-dialog-close.is-pulse { background: var(--apera-red); border-color: var(--apera-red); }
.apera-dialog-body { padding: 16px 18px 18px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-width: 0; }
.apera-dialog-sub { font-size: 13px; color: var(--apera-muted); margin: 0 0 12px; line-height: 1.45; }

.apera-invite-badge { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 12px; border-radius: 8px; background: #DCFCE7; border: 1px solid #86EFAC; color: #14532D; font-size: 13px; font-weight: 700; }
.apera-form-feedback { padding: 10px 12px; margin-bottom: 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.apera-form-feedback.is-error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.apera-form-feedback.is-success { background: #F0FDF4; border: 1px solid #86EFAC; color: #14532D; }

.apera-form-group { margin-bottom: 12px; min-width: 0; }
.apera-form-row-2 { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 576px) { .apera-form-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.apera-form-label { display: block; font-size: 13px; font-weight: 700; color: var(--apera-dark); margin-bottom: 5px; }
.apera-field-hint { font-size: 11.5px; color: var(--apera-muted); margin-top: 4px; line-height: 1.4; }

.apera-star-picker { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.apera-star-btn { width: 46px; height: 46px; min-width: 46px; min-height: 46px; padding: 0; border-radius: 10px; border: 1px solid var(--apera-border); background: var(--apera-surface); color: #94A3B8; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.apera-star-btn.is-lit, .apera-star-btn.is-hover { border-color: #F59E0B; background: #FFFBEB; color: #D97706; }
.apera-star-btn.is-lit svg, .apera-star-btn.is-hover svg { fill: #F59E0B; stroke: #D97706; }
.apera-rating-hint { font-size: 12.5px; font-weight: 700; color: var(--apera-dark); margin-top: 5px; min-height: 19px; }

.apera-photo-dropzone { min-height: 48px; padding: 10px 14px; border: 1.5px dashed var(--apera-border-input); border-radius: var(--apera-radius); background: var(--apera-surface); color: var(--apera-dark); font-size: 13.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; }
.apera-photo-dropzone:hover, .apera-photo-dropzone.is-dragover { border-color: var(--apera-red); background: #FEF2F2; color: var(--apera-red); }
.apera-photo-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.apera-photo-prev-item { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--apera-border); border-radius: 8px; background: #ffffff; }
.apera-photo-prev-item img { width: 56px; height: 56px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; display: block; }
.apera-photo-rm-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid #FECACA; background: #FEF2F2; color: #991B1B; font-size: 18px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

.apera-rev-support-box { padding: 10px 12px; margin-bottom: 12px; border-radius: var(--apera-radius); background: #F0FDF4; border: 1px solid #BBF7D0; }
.apera-rev-support-txt { font-size: 12px; color: #14532D; margin: 0 0 6px; line-height: 1.45; font-weight: 500; }
.apera-rev-support-link { min-height: 44px; padding: 6px 12px; border-radius: 8px; background: #15803D; color: #ffffff !important; font-size: 12.5px; font-weight: 700; text-decoration: none !important; display: inline-flex; align-items: center; gap: 6px; }
.apera-modal-lock-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--apera-muted); margin: 8px 0 12px; line-height: 1.4; }
.apera-modal-lock-note svg { flex-shrink: 0; }

#apera-review-photo-lightbox.apera-rev-lightbox { border: 0; border-radius: 12px; padding: 0; width: min(94vw, 760px); max-height: 90dvh; background: #ffffff; box-shadow: 0 24px 48px rgba(15, 23, 42, 0.35); }
#apera-rev-lb-img { max-width: 100%; max-height: 76dvh; width: auto; height: auto; object-fit: contain; display: block; }
