/* ═══════════════════════════════════════════
   Tema v2 — Mis cupones
   Prefijo: v2cu-
   Los colores de los tickets (.theme-*) vienen de css/CouponTicket.css,
   los mismos que elige la tienda en el Dashboard.
═══════════════════════════════════════════ */

/* Con pocos cupones el footer queda abajo de la pantalla */
body.theme-v2.v2cu-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.v2cu-page .v2-main {
  flex: 1 0 auto;
}

/* ── Cabecera ─────────────────────────────── */

.v2cu-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.v2cu-head-sub {
  max-width: 460px;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.8;
}

.v2cu-points {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 14px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--v2-shadow);
  color: var(--v2-ink);
  text-decoration: none;
  transition: box-shadow 0.2s ease;
}

.v2cu-points:hover {
  box-shadow: var(--v2-shadow-hover);
}

.v2cu-points-text {
  display: flex;
  flex-direction: column;
}

.v2cu-points-text small {
  color: var(--v2-muted);
  font-size: 12px;
  font-weight: 600;
}

.v2cu-points-text strong {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.v2cu-points-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.v2cu-points-cta .v2-arrow {
  background: var(--v2-soft);
  box-shadow: none;
}

/* ── Ticket ───────────────────────────────── */

.v2cu-list-wrap {
  margin-top: 20px;
}

.v2cu-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.v2cu-ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--v2-line);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

/* Parte de arriba: tono de la tienda, o el degradado elegido en el Dashboard */
.v2cu-top {
  position: relative;
  flex: 1;
  padding: 18px 18px 16px;
  background: #f5eef1;
  background: color-mix(in srgb, var(--v2-accent) 12%, #ffffff);
  color: var(--v2-ink);
}

.v2cu-ticket.is-color .v2cu-top {
  background: linear-gradient(100deg, var(--t-from), var(--t-to));
  color: #fff;
}

.v2cu-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
}

/* Espacio para "Vence en N días" solo cuando esa etiqueta aparece */
.v2cu-top:has(.v2cu-soon) .v2cu-value {
  padding-right: 96px;
}

.v2cu-value strong {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* "Envío gratis" es texto, no número: un poco más chico */
.v2cu-value--text strong {
  font-size: 26px;
}

.v2cu-value span {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
}

.v2cu-soon {
  position: absolute;
  top: 18px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff4e0;
  color: #9a5a00;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.v2cu-ticket.is-color .v2cu-soon {
  background: rgba(255, 255, 255, 0.92);
}

.v2cu-title {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.v2cu-title + .v2cu-meta {
  margin-top: 4px;
}

.v2cu-meta {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.7;
}

/* Línea punteada con muescas a los lados (el ticket recorta la mitad de cada círculo) */
.v2cu-cut {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--v2-line);
}

.v2cu-ticket.is-color .v2cu-cut {
  border-top-color: transparent;
}

.v2cu-cut::before,
.v2cu-cut::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  background: #fff;
}

.v2cu-cut::before {
  left: -12px;
}

.v2cu-cut::after {
  right: -12px;
}

/* Parte de abajo: código y acciones */
.v2cu-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px 18px;
}

.v2cu-code {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--v2-ink);
  text-align: left;
  cursor: copy;
}

.v2cu-code small {
  color: var(--v2-muted);
  font-family: var(--v2-font);
  font-size: 11px;
  font-weight: 600;
}

.v2cu-code span {
  max-width: 100%;
  overflow: hidden;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2cu-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.v2cu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d6d6db;
  border-radius: 999px;
  background: #fff;
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.v2cu-btn:hover {
  border-color: var(--v2-ink);
}

.v2cu-btn--main {
  width: auto;
  padding: 0 16px;
  border-color: var(--v2-ink);
  background: var(--v2-ink);
  color: #fff;
}

.v2cu-btn--main:hover {
  background: #000;
}

.v2cu-btn--main.is-done {
  border-color: #1d7a4a;
  background: #1d7a4a;
}

/* ── Vacío / sin sesión ───────────────────── */

.v2cu-empty {
  margin-top: 16px;
  padding: 40px 20px 36px;
  border: 1px solid var(--v2-line);
  border-radius: 20px;
  text-align: center;
}

.v2cu-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--v2-soft);
  background: color-mix(in srgb, var(--v2-accent) 14%, #ffffff);
  color: var(--v2-accent);
}

.v2cu-empty h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.v2cu-empty p {
  max-width: 340px;
  margin: 0 auto 22px;
  color: var(--v2-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Usados y vencidos ────────────────────── */

.v2cu-history {
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--v2-line);
  border-radius: 20px;
  list-style: none;
}

.v2cu-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.v2cu-history-item + .v2cu-history-item {
  border-top: 1px solid var(--v2-line);
}

.v2cu-history-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.v2cu-history-text strong {
  color: var(--v2-muted);
  font-size: 14px;
  font-weight: 600;
}

.v2cu-history-text small {
  margin-top: 2px;
  overflow: hidden;
  color: #a3a3aa;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2cu-status {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--v2-soft);
  color: var(--v2-muted);
  font-size: 11px;
  font-weight: 600;
}

/* ── Breakpoints ─────────────────────────── */

@media (min-width: 700px) {
  .v2cu-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .v2cu-points {
    flex: 0 0 280px;
  }

  .v2cu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v2cu-empty {
    padding: 48px 24px 44px;
  }

  .v2cu-empty h2 {
    font-size: 20px;
  }
}

@media (min-width: 1024px) {
  .v2cu-list-wrap {
    margin-top: 28px;
  }

  .v2cu-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .v2cu-top {
    padding: 22px 22px 18px;
  }

  .v2cu-bottom {
    padding: 16px 16px 16px 22px;
  }

  .v2cu-history {
    max-width: 760px;
    padding: 0 20px;
  }
}
