/* Smart Reviews - Frontend Styles */
:root { --sr-color: #2563eb; }

.sr-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.sr-header { text-align: center; padding: 20px 0 16px; }
.sr-logo { max-height: 55px; max-width: 180px; }
.sr-site-name { font-size: 20px; font-weight: 800; color: var(--sr-color); }

.sr-intro-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  padding: 28px 32px 20px;
  margin-bottom: 16px;
}
.sr-title    { font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 6px; }
.sr-subtitle { color: #6b7280; font-size: 15px; margin: 0; }

.sr-product-block {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  padding: 24px 28px;
  margin-bottom: 16px;
}

.sr-product-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 2px solid #f3f4f6;
}
.sr-product-img { width: 56px !important; height: 56px !important; max-width: 56px !important; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.sr-product-info { display: flex; flex-direction: column; gap: 4px; }
.sr-product-label { font-size: 11px; font-weight: 700; color: var(--sr-color); text-transform: uppercase; letter-spacing: 1px; }
.sr-product-name  { font-size: 15px; font-weight: 700; color: #111827; }

.sr-criteria { margin-bottom: 20px; }
.sr-criterion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 12px;
  flex-wrap: wrap;
}
.sr-criterion label { font-size: 14px; font-weight: 600; color: #374151; flex: 1; min-width: 140px; }
.sr-stars { display: flex; gap: 3px; }
.sr-star {
  font-size: 26px;
  color: #e5e7eb;
  cursor: pointer;
  transition: color 0.12s, transform 0.1s;
  line-height: 1;
  user-select: none;
}
.sr-star:hover, .sr-star.active { color: #f59e0b; }
.sr-star:hover { transform: scale(1.18); }

.sr-comment-wrap { margin-top: 4px; }
.sr-comment-wrap label { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.sr-optional { font-weight: 400; color: #9ca3af; font-size: 13px; }
.sr-comment {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: #374151;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fafafa;
}
.sr-comment:focus { outline: none; border-color: var(--sr-color); background: #fff; }

.sr-submit-wrap { text-align: center; padding: 8px 0; }
.sr-submit-btn {
  background: var(--sr-color);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 16px 48px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.sr-submit-btn:hover   { opacity: 0.9; transform: translateY(-2px); }
.sr-submit-btn:active  { transform: translateY(0); }
.sr-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.sr-success-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  padding: 48px 32px;
  text-align: center;
  margin-top: 16px;
}
.sr-success-icon { font-size: 56px; margin-bottom: 16px; }
.sr-success-card h3 { font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 8px; }
.sr-success-card p  { color: #6b7280; font-size: 15px; margin: 0 0 16px; }

.sr-coupon-box { background: #fffbeb; border: 2px dashed #f59e0b; border-radius: 12px; padding: 20px; margin-top: 16px; }
.sr-coupon-code { font-size: 28px; font-weight: 800; letter-spacing: 5px; color: var(--sr-color); background: #fff; border-radius: 8px; padding: 12px; margin: 10px 0; cursor: pointer; user-select: all; }
.sr-coupon-hint { font-size: 12px; color: #9ca3af; margin: 0; }

.sr-error { max-width: 500px; margin: 40px auto; padding: 20px 24px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; color: #991b1b; font-size: 15px; text-align: center; }

/* Reseñas en producto */
.sr-reviews-section { margin: 40px 0; font-family: inherit; }
.sr-reviews-title   { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: #111827; }
.sr-summary { display: flex; gap: 28px; background: #f9fafb; border-radius: 14px; padding: 24px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.sr-summary-score  { text-align: center; min-width: 90px; }
.sr-big-score      { display: block; font-size: 52px; font-weight: 800; color: #111827; line-height: 1; }
.sr-summary-stars  { margin: 6px 0 4px; }
.sr-total          { font-size: 13px; color: #9ca3af; }
.sr-criteria-summary { flex: 1; min-width: 200px; }
.sr-criteria-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.sr-criteria-bar span:first-child { min-width: 130px; color: #6b7280; }
.sr-bar-track { flex: 1; height: 7px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.sr-bar-fill  { height: 100%; background: var(--sr-color); border-radius: 4px; transition: width 0.8s ease; }
.sr-bar-num   { font-weight: 700; color: #374151; min-width: 28px; text-align: right; }
.sr-list { display: flex; flex-direction: column; gap: 14px; }
.sr-review-item { background: #fff; border: 1px solid #f0f0f0; border-radius: 14px; padding: 20px 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.sr-review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sr-reviewer-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sr-color); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.sr-reviewer-name  { font-size: 15px; font-weight: 700; color: #111827; }
.sr-review-date    { margin-left: auto; font-size: 12px; color: #9ca3af; }
.sr-review-stars   { margin-top: 2px; }
.sr-review-criteria { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sr-criterion-tag  { background: #f3f4f6; border-radius: 20px; padding: 4px 11px; font-size: 12px; color: #6b7280; }
.sr-review-comment { color: #374151; font-size: 14px; line-height: 1.65; margin: 8px 0 10px; }
.sr-verified       { font-size: 12px; color: #16a34a; font-weight: 600; }
.sr-star-filled    { color: #f59e0b; font-size: 16px; }
.sr-star-empty     { color: #e5e7eb; font-size: 16px; }

@media (max-width: 560px) {
  .sr-product-block, .sr-intro-card { padding: 20px 16px; }
  .sr-criterion { flex-direction: column; align-items: flex-start; }
  .sr-star { font-size: 30px; }
  .sr-submit-btn { width: 100%; }
}

/* ── Distribución de estrellas estilo Amazon ─────────────────────────────── */
.sr-star-dist {
  min-width: 200px;
  flex: 1;
}
.sr-dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.sr-dist-label {
  min-width: 30px;
  color: var(--sr-color);
  font-weight: 700;
  text-align: right;
}
.sr-dist-track {
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}
.sr-dist-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 5px;
  transition: width 0.7s ease;
}
.sr-dist-pct {
  min-width: 32px;
  color: #6b7280;
  font-size: 12px;
  text-align: right;
}

/* ── Shortcode [smart_reviews_summary] ───────────────────────────────────── */
.sr-amazon-summary {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  margin: 32px 0;
}
.sr-amazon-grid {
  display: flex;
  gap: 32px;
  background: #f9fafb;
  border-radius: 14px;
  padding: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 20px;
}
.sr-amazon-score-col {
  text-align: center;
  min-width: 90px;
}
.sr-amazon-bars-col {
  flex: 1;
  min-width: 180px;
}

/* ── Resumen IA ───────────────────────────────────────────────────────────── */
.sr-ai-summary {
  background: #f0f9ff;
  border-left: 4px solid var(--sr-color);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin-top: 4px;
}
.sr-ai-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--sr-color);
  margin: 0 0 6px;
}
.sr-ai-text {
  font-size: 14px;
  color: #374151;
  line-height: 1.7;
  margin: 0;
}

/* ── Badge tienda física ─────────────────────────────────────────────────── */
.sr-verified-store {
  color: #b45309 !important;
  background: #fef3c7;
  border-radius: 20px;
  padding: 2px 10px;
}

/* ══════════════════════════════════════════════════════════════════════════
   [smart_reviews_stars] — Widget de estrellas + botón premium
   ══════════════════════════════════════════════════════════════════════════ */

.sr-stars-widget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.sr-sw-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sr-sw-score {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.sr-sw-count {
  font-size: 13px;
  color: #9ca3af;
}

/* Botón premium */
.sr-sw-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1.5px solid var(--sr-color, #2563eb);
  color: var(--sr-color, #2563eb);
  border-radius: 6px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  font-family: inherit;
  line-height: 1.5;
}
.sr-sw-btn:hover {
  background: var(--sr-color, #2563eb);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.13);
}
.sr-sw-btn svg { flex-shrink: 0; }

/* Botón legacy (en shortcode summary y render) */
.sr-write-review-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1.5px solid var(--sr-color, #2563eb);
  color: var(--sr-color, #2563eb);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  font-family: inherit;
}
.sr-write-review-btn:hover {
  background: var(--sr-color, #2563eb);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════
   Modal de reseña pública — Diseño premium
   ══════════════════════════════════════════════════════════════════════════ */

.sr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: srFadeIn 0.18s ease;
}
@keyframes srFadeIn { from { opacity:0; } to { opacity:1; } }

.sr-dialog {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.05);
  animation: srSlideUp 0.22s cubic-bezier(0.34,1.56,0.64,1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
@keyframes srSlideUp { from { transform:translateY(18px); opacity:0; } to { transform:translateY(0); opacity:1; } }

.sr-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 28px 0;
}
.sr-dialog-title {
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 3px;
  line-height: 1.3;
}
.sr-dialog-sub {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
  font-weight: 500;
}
.sr-dialog-close {
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
  margin-top: 2px;
}
.sr-dialog-close:hover { background: #e5e7eb; color: #111; }

.sr-dialog-form { padding: 20px 28px 28px; }

.sr-df-field { margin-bottom: 16px; }
.sr-df-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.sr-required { color: #ef4444; }
.sr-optional  { color: #9ca3af; font-weight: 400; font-size: 12px; }

.sr-df-input,
.sr-df-textarea {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  color: #111827;
  box-sizing: border-box;
  font-family: inherit;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}
.sr-df-input:focus,
.sr-df-textarea:focus {
  border-color: var(--sr-color, #2563eb);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.sr-df-textarea { resize: vertical; }

/* Criterios + estrellas */
.sr-df-criteria {
  background: #f9fafb;
  border-radius: 12px;
  padding: 4px 16px 8px;
  margin-bottom: 16px;
  border: 1px solid #f0f0f0;
}
.sr-df-crit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}
.sr-df-crit:last-child { border-bottom: none; }
.sr-df-crit-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  flex: 1;
}
.sr-df-stars { display: flex; gap: 2px; }
.sr-df-star {
  background: none;
  border: none;
  font-size: 22px;
  color: #d1d5db;
  cursor: pointer;
  padding: 0 1px;
  line-height: 1;
  transition: color 0.1s, transform 0.1s;
}
.sr-df-star.on,
.sr-df-star.sel { color: #f59e0b; }
.sr-df-star:hover { transform: scale(1.2); }

.sr-df-note {
  font-size: 12px;
  color: #9ca3af;
  margin: 0 0 16px;
  line-height: 1.5;
}

.sr-df-submit {
  width: 100%;
  padding: 13px;
  background: var(--sr-color, #2563eb);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.1s;
  font-family: inherit;
  letter-spacing: 0.2px;
}
.sr-df-submit:hover    { opacity: 0.9; transform: translateY(-1px); }
.sr-df-submit:active   { transform: translateY(0); }
.sr-df-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Pantalla de éxito */
.sr-dialog-ok {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 28px 36px;
}
.sr-ok-icon {
  width: 72px;
  height: 72px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.sr-ok-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}
.sr-ok-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.6;
}
.sr-ok-close {
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.sr-ok-close:hover { background: #e5e7eb; }

body.sr-modal-open { overflow: hidden; }

@media (max-width: 480px) {
  .sr-dialog      { border-radius: 16px 16px 0 0; max-height: 95vh; }
  .sr-overlay     { align-items: flex-end; padding: 0; }
  .sr-dialog-head { padding: 22px 20px 0; }
  .sr-dialog-form { padding: 16px 20px 24px; }
  .sr-df-crit     { flex-wrap: wrap; }
}
