/* ============================================================
   ATHLOS · RECIBO MEMBRETADO
   Reproduce el membrete oficial (docs/plantillas/athlos-membrete.pdf):
   esquina diagonal, línea roja bajo el logo, marca de agua del isotipo
   y punto rojo al pie. Pensado para verse bien impreso y en PDF.
   ============================================================ */

.recibo-acciones {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.recibo-folio {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: .02em;
  margin-top: .3rem;
}
.recibo-acciones .btn svg { width: 17px; height: 17px; }

/* ============================================================
   LA HOJA
   ============================================================ */
.hoja {
  position: relative;
  background: #FFFFFF;
  color: #1C1B20;
  border-radius: var(--r-lg);
  padding: clamp(1.6rem, 4vw, 3.2rem);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  /* Proporción carta para que al imprimir no se corte */
  max-width: 850px;
  margin-inline: auto;
}

/* Esquina diagonal gris del membrete (arriba a la derecha) */
.hoja__esquina {
  position: absolute; top: 0; right: 0;
  width: 180px; height: 120px;
  background: #F2F2F3;
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  pointer-events: none;
}

/* Marca de agua del isotipo (abajo a la derecha) */
.hoja__marca {
  position: absolute;
  right: 4%; bottom: 10%;
  width: 190px;
  opacity: .05;
  pointer-events: none;
  user-select: none;
}

/* ---------------- Encabezado ---------------- */
.hoja__head {
  position: relative; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-5); flex-wrap: wrap;
}
.hoja__logo { height: 30px; width: auto; }
.hoja__emisor {
  display: flex; flex-direction: column; gap: .12rem;
  text-align: right;
  font-size: .76rem;
  color: #6E6E78;
}
.hoja__emisor b { color: #1C1B20; font-size: .85rem; }

/* Línea roja corta + línea gris larga (firma del membrete) */
.hoja__linea {
  position: relative;
  height: 1px;
  background: #E2E2E4;
  margin-block: 1rem 1.6rem;
}
.hoja__linea::before {
  content: '';
  position: absolute; left: 0; top: -1px;
  width: 86px; height: 3px;
  background: #AC2B1F;
}
.hoja__linea--pie { margin-block: 2rem 1.2rem; }

/* ---------------- Título ---------------- */
.hoja__titulo {
  position: relative; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-5); flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.hoja__titulo h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  color: #1C1B20;
  line-height: 1;
}
.hoja__sub { font-size: .76rem; color: #8A8A94; margin-top: .3rem; }

.hoja__folio { text-align: right; }
.hoja__folio span {
  display: block;
  font-family: var(--font-condensed);
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: #8A8A94;
}
.hoja__folio b {
  font-family: var(--font-condensed);
  font-size: 1.25rem; letter-spacing: .08em;
  color: #AC2B1F;
}

/* ---------------- Datos ---------------- */
.hoja__datos {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem var(--sp-5);
  margin-bottom: 1.8rem;
}
.hoja__etq {
  display: block;
  font-family: var(--font-condensed);
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: #8A8A94;
  margin-bottom: .25rem;
}
.hoja__datos p { font-size: .85rem; line-height: 1.5; color: #35353D; }
.hoja__datos b { color: #1C1B20; }

/* ---------------- Tabla ---------------- */
.hoja__tabla {
  position: relative; z-index: 2;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2rem;
}
.hoja__tabla th {
  text-align: left;
  padding: .55rem .6rem;
  font-family: var(--font-condensed);
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: #8A8A94;
  border-bottom: 1.5px solid #1C1B20;
  white-space: nowrap;
}
.hoja__tabla td {
  padding: .75rem .6rem;
  border-bottom: 1px solid #ECECEE;
  font-size: .86rem;
  vertical-align: top;
  color: #35353D;
}
.hoja__tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.hoja__tabla td b { color: #1C1B20; display: block; }
.hoja__tabla td small { display: block; color: #8A8A94; font-size: .74rem; margin-top: .15rem; }
.hoja__rec {
  color: #AC2B1F !important;
  font-family: var(--font-condensed);
  letter-spacing: .08em; text-transform: uppercase;
}

/* ---------------- Totales ---------------- */
.hoja__totales {
  position: relative; z-index: 2;
  margin-left: auto;
  width: min(330px, 100%);
  margin-bottom: 1.4rem;
}
.hoja__tot {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .4rem 0;
  font-size: .86rem;
  color: #55555F;
}
.hoja__tot span:last-child { font-variant-numeric: tabular-nums; color: #1C1B20; }
.hoja__tot--final {
  margin-top: .4rem; padding-top: .7rem;
  border-top: 2px solid #1C1B20;
  font-family: var(--font-condensed);
  font-size: 1.15rem; letter-spacing: .05em;
  text-transform: uppercase;
  color: #1C1B20;
}
.hoja__tot--final span:last-child {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #AC2B1F;
  letter-spacing: 0;
}

/* ---------------- Cómo aparece el cargo ---------------- */
.hoja__descriptor {
  position: relative; z-index: 2;
  padding: .85rem 1.1rem;
  background: #F7F7F8;
  border-left: 3px solid #AC2B1F;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 1.4rem;
}
.hoja__descriptor b {
  font-family: var(--font-condensed);
  font-size: 1.1rem;
  letter-spacing: .12em;
  color: #1C1B20;
}

/* ---------------- Bloques (suscripción / constancia) ---------------- */
.hoja__bloque {
  position: relative; z-index: 2;
  padding: 1.1rem 1.3rem;
  border: 1px solid #E2E2E4;
  border-radius: var(--r);
  margin-bottom: 1.1rem;
}
.hoja__bloque h3 {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-condensed);
  font-size: 1rem; letter-spacing: .1em; text-transform: uppercase;
  color: #1C1B20;
  margin-bottom: .6rem;
}
.hoja__bloque h3 svg { width: 16px; height: 16px; }
.hoja__bloque p { font-size: .82rem; color: #55555F; line-height: 1.55; }

.hoja__bloque--consta { background: #F6FBF7; border-color: #C9E8D4; }
.hoja__bloque--consta h3 { color: #1E7A45; }
.hoja__bloque--consta h3 svg { color: #2ECC71; }

.hoja__bloque--rec { background: #FFFAF3; border-color: #F0DFC4; }
.hoja__bloque--rec h3 { color: #8A6316; }

/* Texto exacto que aceptó el cliente */
.hoja__cita {
  margin-block: .7rem;
  padding: .7rem .9rem;
  background: rgba(0, 0, 0, .035);
  border-left: 2px solid #C8C8CC;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .78rem !important;
  font-style: italic;
  color: #45454E !important;
  line-height: 1.55;
}

.hoja__recgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin-top: .7rem;
}
.hoja__nota { font-size: .76rem !important; color: #8A8A94 !important; margin-top: .5rem; }

/* ---------------- Pie ---------------- */
.hoja__pie { position: relative; z-index: 2; }
.hoja__pie p { font-size: .76rem; color: #6E6E78; line-height: 1.55; }
.hoja__soporte { margin-top: .6rem; color: #35353D !important; }
.hoja__soporte b { color: #1C1B20; }
.hoja__punto {
  position: absolute; right: 0; bottom: -.4rem;
  width: 7px; height: 7px; border-radius: 50%;
  background: #AC2B1F;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .hoja { padding: 1.3rem; }
  .hoja__datos, .hoja__recgrid { grid-template-columns: 1fr; }
  .hoja__emisor { text-align: left; }
  .hoja__esquina { width: 110px; height: 75px; }
  .hoja__marca { width: 120px; }
  .hoja__tabla th:nth-child(3), .hoja__tabla td:nth-child(3) { display: none; }
  .hoja__totales { width: 100%; }
}

/* ============================================================
   IMPRESIÓN / PDF
   ============================================================ */
@media print {
  @page { margin: 12mm; size: letter; }

  .no-print, #site-header, #site-footer, .recibo-acciones, .notice { display: none !important; }

  html, body { background: #fff !important; }
  .section { padding: 0 !important; }
  .wrap { padding: 0 !important; max-width: none !important; }

  .hoja {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    /* los colores del membrete deben salir impresos */
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .hoja__esquina { width: 150px; height: 100px; }
  .hoja__marca { opacity: .04; }

  /* Que no se parta un bloque a la mitad entre dos hojas */
  .hoja__bloque, .hoja__totales, .hoja__descriptor, .hoja__pie { break-inside: avoid; }
  .hoja__tabla tr { break-inside: avoid; }
}
