/* Ticket de cupón: se usa igual en el listado (Coupons.php) y en la vista previa
   de los formularios (CuponForm.php / EditCoupon.php). */

.coupon-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.coupon-ticket {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  background: white;
  border-radius: 16px;
  padding: 0;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}

a.coupon-ticket:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Las muescas laterales son círculos del color del fondo de la página. Por eso el
   ticket no lleva overflow:hidden y el talón redondea sus propias esquinas. */
.coupon-ticket::before,
.coupon-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-fondo, #f9f9f9);
  transform: translateY(-50%);
}

.coupon-ticket::before {
  left: -13px;
}

.coupon-ticket::after {
  right: -13px;
}

.ticket-stub {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 22px;
  border-right: 2px dashed #e6e6e6;
  border-radius: 16px 0 0 16px;
  min-height: 112px;
}

.ticket-stub-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c2c2c2;
  margin-bottom: 6px;
}

.ticket-code {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--color-primario, #ff91b7);
  word-break: break-word;
  line-height: 1.2;
}

.ticket-body {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 22px;
}

.ticket-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #5a5a5a;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  color: #3b3f4a;
  margin-bottom: 12px;
}

.ticket-value strong {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.ticket-value .unit {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #6b6b6b;
}

.ticket-meta {
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #b7b7b7;
}

.ticket-meta .inactive {
  color: #c98a8a;
  font-weight: 600;
}

.ticket-edit {
  flex: 0 0 auto;
  align-self: center;
  padding-right: 26px;
  font-size: 12px;
  font-weight: 600;
  color: #a9a9a9;
  transition: color 0.2s;
}

a.coupon-ticket:hover .ticket-edit {
  color: var(--color-primario, #ff91b7);
}

/* ---- Tickets de color ---- */
.coupon-ticket.is-color {
  background: linear-gradient(100deg, var(--t-from), var(--t-to));
}

.coupon-ticket.is-color .ticket-stub {
  background: var(--t-stub);
  border-right-color: rgba(255, 255, 255, 0.55);
}

.coupon-ticket.is-color .ticket-stub-label {
  color: rgba(255, 255, 255, 0.75);
}

.coupon-ticket.is-color .ticket-code {
  color: #fff;
}

.coupon-ticket.is-color .ticket-title {
  color: rgba(255, 255, 255, 0.92);
}

.coupon-ticket.is-color .ticket-value {
  color: #fff;
}

.coupon-ticket.is-color .ticket-value .unit {
  color: rgba(255, 255, 255, 0.88);
}

.coupon-ticket.is-color .ticket-meta {
  color: rgba(255, 255, 255, 0.8);
}

.coupon-ticket.is-color .ticket-meta .inactive {
  color: #fff;
}

.coupon-ticket.is-color .ticket-edit {
  color: rgba(255, 255, 255, 0.85);
}

a.coupon-ticket.is-color:hover .ticket-edit {
  color: #fff;
}

.theme-rosa {
  --t-stub: #e9628c;
  --t-from: #f4799f;
  --t-to: #ff9d7e;
}

.theme-lavanda {
  --t-stub: #7c65de;
  --t-from: #8f7ae6;
  --t-to: #5eaae8;
}

.theme-durazno {
  --t-stub: #ea8b2e;
  --t-from: #f59e42;
  --t-to: #ef6b7d;
}

.theme-oceano {
  --t-stub: #2e7cbd;
  --t-from: #3f8fd0;
  --t-to: #2fc6b0;
}

.theme-menta {
  --t-stub: #1d9a78;
  --t-from: #27ae8a;
  --t-to: #6cc9a0;
}

.theme-uva {
  --t-stub: #7146c9;
  --t-from: #8257d9;
  --t-to: #b95fc0;
}

.theme-cielo {
  --t-stub: #3a8cd0;
  --t-from: #4a9fe0;
  --t-to: #82c8ec;
}

.theme-grafito {
  --t-stub: #2f3746;
  --t-from: #3b4453;
  --t-to: #717c8c;
}

/* ---- Vista previa dentro del formulario ---- */
.coupon-preview {
  margin-bottom: 28px;
}

.preview-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #b0b0b0;
  margin-bottom: 12px;
}

/* ---- Selector de color ---- */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.color-swatch {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
  line-height: 0;
}

.color-swatch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.swatch-dot {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--t-from), var(--t-to));
  box-shadow: 0 0 0 2px #fff;
  transition: box-shadow 0.15s ease;
}

.color-swatch.theme-neutro .swatch-dot {
  background: #fff;
  border: 1px solid var(--color-borde, #e0e0e0);
}

.color-swatch input:checked + .swatch-dot {
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px #8d939c;
}

.color-swatch input:focus-visible + .swatch-dot {
  outline: 2px solid #333;
  outline-offset: 5px;
}

@media (max-width: 560px) {
  .coupon-ticket {
    padding: 0;
  }

  .ticket-stub {
    flex-basis: 130px;
    padding: 26px 16px;
    min-height: 96px;
  }

  .ticket-code {
    font-size: 15px;
  }

  .ticket-body {
    padding: 26px 18px;
  }

  .ticket-value strong {
    font-size: 30px;
  }

  .ticket-title {
    white-space: normal;
  }

  .ticket-edit {
    flex-basis: 100%;
    align-self: auto;
    padding: 12px 20px 16px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
  }

  .coupon-ticket.is-color .ticket-edit {
    border-top-color: rgba(255, 255, 255, 0.3);
  }
}

/* ---- Acciones del ticket (tienda) ---- */
.ticket-value-text {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.ticket-actions {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 24px 0 4px;
}

.ticket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--color-borde, #e0e0e0);
  border-radius: 999px;
  background: #fff;
  color: #555;
  padding: 9px 16px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.ticket-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ticket-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.ticket-btn.primary {
  background: var(--color-primario, #ff91b7);
  border-color: var(--color-primario, #ff91b7);
  color: #fff;
}

.ticket-btn.primary:hover {
  background: var(--color-primario, #ff91b7);
  opacity: 0.9;
}

.coupon-ticket.is-color .ticket-btn {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.coupon-ticket.is-color .ticket-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.coupon-ticket.is-color .ticket-btn.primary {
  background: #fff;
  border-color: #fff;
  color: #3b3f4a;
}

.coupon-ticket.is-color .ticket-btn.primary:hover {
  background: #fff;
  opacity: 0.92;
}

/* En la tienda la lista pasa a una sola columna para que el ticket tenga ancho.
   Va sin media query para ganarle al grid de css/Cupones.desktop.css. */
.coupons-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 560px) {
  .ticket-actions {
    flex-basis: 100%;
    align-self: auto;
    flex-direction: row;
    justify-content: flex-end;
    padding: 12px 18px 18px;
    border-top: 1px solid #f0f0f0;
  }

  .coupon-ticket.is-color .ticket-actions {
    border-top-color: rgba(255, 255, 255, 0.3);
  }
}
