/* rating-sheet.css — "¿Cómo estuvo tu pedido?" BOTTOM SHEET de calificación (⭐ 1–5).
   Se abre solo al entregarse un pedido (popup) y desde la tarjeta del pedido en
   "Mis pedidos". Markup inyectado por js/rating-sheet.js.
   Estética alineada con metas-sheet (ms-) y ayuda-sheet (hc-): primario #81c408,
   radios 12px, grabber, safe-area. Prefijo: rt-. */

.rt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10073; /* > metas sheet (10072); es lo último que se abre */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* Sin backdrop-filter: el blur a pantalla completa recalienta la GPU en WKWebView. */
  background: rgba(18, 24, 20, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.rt-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.rt-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: #f4f8ef;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.2, 0.85, 0.25, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.rt-overlay.open .rt-sheet {
  transform: translateY(0);
}

/* ── Hero verde de marca ── */
.rt-hero {
  position: relative;
  overflow: hidden;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  background: linear-gradient(150deg, #2f7d12 0%, #4d9c14 48%, #6cb01a 100%);
  color: #fff;
  padding: 44px 20px 18px;
  flex-shrink: 0;
}
.rt-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.6);
  z-index: 3;
}
.rt-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease-in-out;
  z-index: 3;
}
.rt-close:active { background: rgba(255, 255, 255, 0.35); }

.rt-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.rt-hero-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.15;
  margin-top: 3px;
}
.rt-hero-sub {
  font-size: 13px;
  opacity: 0.92;
  margin-top: 4px;
}

/* ── Cuerpo ── */
.rt-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 4px;
}

/* Miniaturas del pedido */
.rt-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.rt-thumb {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e6ecdd;
  flex-shrink: 0;
}
.rt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rt-thumbs-txt {
  font-size: 12.5px;
  color: #6b7a63;
  line-height: 1.3;
}

/* ── Estrellas principales ── */
.rt-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 4px 0 6px;
}
.rt-star {
  width: 52px;
  height: 52px;
  border: none;
  background: transparent;
  color: #d8e0cd;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease-in-out, color 0.18s ease-in-out;
}
.rt-star.on { color: #f5a623; }
.rt-star:active { transform: scale(0.88); }
.rt-star.pop { animation: rtPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes rtPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.rt-score {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #2f4f1d;
  min-height: 20px;
  margin-bottom: 6px;
}
.rt-hint {
  text-align: center;
  font-size: 12.5px;
  color: #7c8a74;
  margin-bottom: 8px;
}

/* ── Paso 2 (aparece al elegir estrella) ── */
.rt-more[hidden] { display: none; }
.rt-more {
  animation: rtReveal 0.34s cubic-bezier(0.2, 0.85, 0.25, 1);
}
@keyframes rtReveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rt-subs {
  background: #fff;
  border-radius: 16px;
  padding: 6px 14px;
  margin: 10px 0 12px;
}
.rt-sub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}
.rt-sub-row + .rt-sub-row { border-top: 1px solid #f0f3ea; }
.rt-sub-ic {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #f1f7e6;
  color: #5d9412;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.rt-sub-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
  color: #33452a;
}
.rt-ministars { display: flex; gap: 0; }
.rt-ministar {
  width: 30px;
  height: 34px;
  border: none;
  background: transparent;
  color: #dbe2d1;
  font-size: 17px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease-in-out, transform 0.15s ease-in-out;
}
.rt-ministar.on { color: #f5a623; }
.rt-ministar:active { transform: scale(0.85); }

/* Chips de motivo */
.rt-chips-tt {
  font-size: 13px;
  font-weight: 800;
  color: #33452a;
  margin-bottom: 8px;
}
.rt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.rt-chip {
  border: 1.5px solid #e2e8d8;
  background: #fff;
  color: #4a5c41;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.18s ease-in-out;
}
.rt-chip:active { transform: scale(0.96); }
.rt-chip.on {
  background: #eef7de;
  border-color: #81c408;
  color: #3d6b06;
}

.rt-comment {
  width: 100%;
  min-height: 76px;
  max-height: 140px;
  border: 1.5px solid #e2e8d8;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #33452a;
  resize: none;
  outline: none;
  transition: border-color 0.18s ease-in-out;
}
.rt-comment:focus { border-color: #81c408; }
.rt-comment::placeholder { color: #a3af9b; }

.rt-error {
  color: #c0392b;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: 10px;
}
.rt-error[hidden] { display: none; }

/* ── Pie ── */
.rt-foot {
  flex-shrink: 0;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: #f4f8ef;
  border-top: 1px solid #e8eee0;
}
.rt-submit {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 16px;
  background: #81c408;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease-in-out, opacity 0.18s ease-in-out;
}
.rt-submit:active { transform: scale(0.98); }
.rt-submit[disabled] { opacity: 0.55; }
.rt-submit[hidden] { display: none; }
.rt-skip {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: none;
  background: transparent;
  color: #7c8a74;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.rt-skip:active { color: #4a5c41; }

/* ── Estado de agradecimiento ── */
.rt-thanks {
  text-align: center;
  padding: 26px 10px 34px;
  animation: rtReveal 0.34s cubic-bezier(0.2, 0.85, 0.25, 1);
}
.rt-thanks-ic {
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #eef7de;
  color: #81c408;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.rt-thanks-tt {
  font-family: 'Raleway', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #2f4f1d;
}
.rt-thanks-sub {
  font-size: 13.5px;
  color: #6b7a63;
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Tiras de calificación dentro de la tarjeta del pedido (Mis pedidos) ── */
.mob-rate-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* -4px arriba: la barra "Volver a pedir" ya trae 16px de padding abajo */
  margin: -4px 16px 14px;
  padding: 10px 12px;
  background: #fffdf4;
  border: 1.5px solid #f4e6bd;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease-in-out, background 0.18s ease-in-out;
}
.mob-rate-strip:active { transform: scale(0.99); background: #fdf8e8; }
.mob-rate-txt {
  font-size: 13px;
  font-weight: 700;
  color: #6b5a17;
  line-height: 1.25;
}
.mob-rate-stars {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}
.mob-rate-stars .mrs {
  width: 32px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e0cf94;
  font-size: 16px;
  touch-action: manipulation;
}
.mob-rated {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -4px 16px 14px;
  padding: 9px 12px;
  background: #f7faf1;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #6b7a63;
}
.mob-rated .mob-rated-stars { color: #f5a623; letter-spacing: 1px; }
