/* ================================================================
   alpha.css - Estilos del Cotizador Alpha Expeditions
   ================================================================ */

/* -- VARIABLES -------------------------------------------------- */
:root {
  --ink:   #0c0c0c;
  --paper: #f5f2ee;
  --mid:   #1a1a1a;
  --card:  #141414;
  --rule:  rgba(255,255,255,.1);
  --muted: rgba(255,255,255,.38);
  --dim:   rgba(255,255,255,.18);
  --white: #f0ece4;
  --off:   rgba(240,236,228,.72);
  --surface: #161616;
  --border:  rgba(255,255,255,.1);
}

/* -- RESET ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

body {
  background: var(--ink);
  color: var(--white);
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* -- TOPO CANVAS ------------------------------------------------ */
#topo-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .18;
}

/* -- WRAPPER ---------------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* -- TOOLBAR ---------------------------------------------------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(12,12,12,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  letter-spacing: .04em;
}

.toolbar button {
  background: var(--mid);
  border: 1px solid var(--rule);
  color: var(--white);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.toolbar button:hover {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.08);
}

.toolbar button.primary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
  font-weight: 700;
}

.toolbar button.primary:hover {
  background: #ddd;
  border-color: #ddd;
}

.toolbar .sep {
  width: 1px;
  height: 20px;
  background: var(--rule);
  margin: 0 4px;
}

.toolbar .spacer { flex: 1; }

.toolbar .status {
  font-size: 11px;
  color: var(--muted);
  margin-right: 8px;
  transition: color .2s;
}

.toolbar .status.err { color: #e54; }
.toolbar .status.ok  { color: var(--white); }

/* -- MASTHEAD --------------------------------------------------- */
.masthead {
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.masthead-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  gap: 24px;
}

.ae-logotype {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(72px, 14vw, 128px);
  line-height: .88;
  letter-spacing: .03em;
  color: var(--white);
  position: relative;
}

.ae-logotype .ae {
  font-size: clamp(120px, 20vw, 200px);
  line-height: .82;
  display: block;
  color: var(--white);
  opacity: .12;
  position: absolute;
  right: -8px;
  top: -10px;
  z-index: 0;
  pointer-events: none;
}

.ae-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10.5px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

.doc-badge { text-align: right; padding-top: 6px; }

.doc-badge-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: .45em;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.doc-badge-word {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  letter-spacing: .08em;
  color: var(--white);
  line-height: 1;
  display: block;
}

.doc-meta-row {
  display: flex;
  gap: 28px;
  justify-content: flex-end;
  margin-top: 6px;
}

.doc-meta-item {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--dim);
  text-transform: uppercase;
}

.doc-meta-item span {
  color: var(--off);
  font-weight: 600;
}

/* -- HAIRLINES -------------------------------------------------- */
.hl { height: 1px; background: var(--rule); margin: 0; }
.hl-bold { height: 1px; background: rgba(255,255,255,.22); margin: 0; }

/* -- CLIENT BAR ------------------------------------------------- */
.client-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--rule);
  margin: 32px 0 40px;
  background: var(--mid);
}

.client-cell {
  padding: 18px 22px;
  border-right: 1px solid var(--rule);
}
.client-cell:last-child { border-right: none; }

.cc-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9.5px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 5px;
}

.cc-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

/* -- SECTION HEAD ----------------------------------------------- */
.sec-head {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 18px;
}

.sec-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* -- SERVICE TABS ----------------------------------------------- */
.service-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-bottom: 32px;
}

.stab {
  background: var(--mid);
  border: 1px solid var(--rule);
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 14px 6px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
  user-select: none;
  line-height: 1.3;
}

.stab-icon { display: block; font-size: 18px; margin-bottom: 5px; }

.stab:hover { border-color: rgba(255,255,255,.3); color: var(--white); }

.stab.on {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
  font-weight: 700;
}

/* -- PANELS ----------------------------------------------------- */
.panel { display: none; }
.panel.on { display: block; animation: up .28s ease; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* -- CONCEPT CARD ----------------------------------------------- */
.concept {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--white);
  background: var(--mid);
  padding: 28px 30px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.concept-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  letter-spacing: .04em;
  line-height: 1;
  color: var(--white);
  margin-bottom: 10px;
}

.concept-desc {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.7;
}

.concept-tags {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* -- TAGS ------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 4px 11px;
  border: 1px solid rgba(255,255,255,.2);
  color: var(--off);
  background: rgba(255,255,255,.04);
}

/* -- GRID 2-COL ------------------------------------------------- */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 28px;
}

.g-card {
  background: var(--mid);
  border: 1px solid var(--rule);
  padding: 20px 22px;
}

.g-card-head {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9.5px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(255,255,255,.32);
  margin-bottom: 14px;
}

.g-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 13px;
}
.g-row:last-child { border-bottom: none; }

.g-key { color: var(--muted); font-family: 'Barlow Condensed', sans-serif; letter-spacing: .05em; }
.g-val { color: var(--white); font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 14px; }

/* -- TABLE ------------------------------------------------------ */
.t-wrap { margin-bottom: 28px; overflow-x: auto; }

table.ae-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table.ae-table thead tr {
  border-bottom: 1px solid rgba(255,255,255,.25);
}

table.ae-table thead th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9.5px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 10px 14px;
  text-align: left;
  font-weight: 400;
}

table.ae-table thead th.r { text-align: right; }

table.ae-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .12s;
}

table.ae-table tbody tr:hover { background: rgba(255,255,255,.03); }

table.ae-table tbody td {
  padding: 14px 14px;
  vertical-align: middle;
}

.td-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--white);
}

.td-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  font-family: 'Barlow Condensed', sans-serif;
}

.td-qty, .td-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  color: var(--muted);
}

.td-total {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--white);
  letter-spacing: .03em;
  text-align: right;
}

/* -- TOTALS BLOCK ----------------------------------------------- */
.totals {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 36px;
}

.totals-inner { min-width: 260px; }

.t-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.t-row .tl {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.t-row .tv {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  color: var(--white);
}

.t-row.grand { border: none; padding-top: 16px; margin-top: 4px; }

.t-row.grand .tl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--white);
  letter-spacing: .1em;
}

.t-row.grand .tv {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  color: var(--white);
  letter-spacing: .02em;
  line-height: 1;
}

/* -- PKG CARDS -------------------------------------------------- */
.pkg-row {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 2px;
  margin-bottom: 28px;
}

.pkg {
  background: var(--mid);
  border: 1px solid var(--rule);
  padding: 24px 18px;
  text-align: center;
  position: relative;
  transition: border-color .18s;
}

.pkg:hover { border-color: rgba(255,255,255,.3); }
.pkg.star  { border-color: var(--white); }

.pkg-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  color: var(--ink);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8.5px;
  letter-spacing: .32em;
  font-weight: 700;
  padding: 3px 14px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pkg-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: .1em;
  margin-bottom: 2px;
}

.pkg-price {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 44px;
  line-height: 1;
  color: var(--white);
  letter-spacing: .02em;
  margin: 12px 0 2px;
}

.pkg-currency {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10.5px;
  letter-spacing: .25em;
  color: var(--muted);
  margin-bottom: 18px;
}

.pkg-list {
  list-style: none;
  text-align: left;
}

.pkg-list li {
  font-size: 12px;
  color: var(--muted);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.4;
}
.pkg-list li:last-child { border: none; }

.pkg-list li::before {
  content: '>';
  font-size: 9px;
  color: var(--white);
  margin-top: 1px;
  flex-shrink: 0;
}

/* -- NOTES ------------------------------------------------------ */
.notes {
  background: var(--mid);
  border: 1px solid var(--rule);
  padding: 22px 26px;
  margin-bottom: 28px;
}

.n-row {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,.04);
  line-height: 1.55;
}
.n-row:last-child { border: none; }

.n-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px;
  color: rgba(255,255,255,.35);
  min-width: 20px;
  line-height: 1.2;
}

/* -- TERMS ------------------------------------------------------ */
.terms .n-row { font-size: 12.5px; }

/* -- VALIDITY BAR ----------------------------------------------- */
.validity {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 22px;
  margin: 36px 0 40px;
}

.v-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}

.v-date {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--white);
  letter-spacing: .08em;
}

/* -- SIGNATURE -------------------------------------------------- */
.sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 48px;
}

.sig-area { height: 52px; }

.sig-line {
  border-top: 1px solid rgba(255,255,255,.28);
  padding-top: 10px;
}

.sig-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.sig-role {
  font-size: 11px;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: .05em;
  margin-top: 2px;
}

/* -- FOOTER ----------------------------------------------------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding: 24px 0 0;
  margin-top: 52px;
}

.f-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: .28em;
  color: var(--white);
}

.f-ae {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  color: rgba(255,255,255,.06);
  letter-spacing: .04em;
  line-height: 1;
}

.f-contact {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  text-align: right;
  line-height: 1.9;
}

/* -- SPONSOR-ONLY: META STRIP ----------------------------------- */
.meta-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 28px 0 24px;
}

.meta-cell {
  background: var(--surface);
  padding: 10px 14px;
}

.meta-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.meta-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

/* -- SPONSOR-ONLY: SALUDO --------------------------------------- */
.saludo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: .04em;
  margin-bottom: 20px;
}

/* -- SPONSOR-ONLY: BODY TEXT ------------------------------------ */
.body-text {
  font-size: 12px;
  color: rgba(240,236,228,.8);
  line-height: 1.8;
}

.body-text p { margin-bottom: 16px; }
.body-text p:last-child { margin-bottom: 0; }
.body-text strong { font-weight: 500; color: var(--white); }

/* -- SPONSOR-ONLY: STATS ROW ----------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 20px 0;
}

.stat-cell {
  background: var(--surface);
  padding: 10px 12px;
  text-align: center;
}

.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--white);
  letter-spacing: .03em;
  line-height: 1;
}

.stat-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 8px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
}

/* -- SPONSOR-ONLY: HIGHLIGHT BOX -------------------------------- */
.highlight {
  border: 1px solid var(--border);
  border-left: 2px solid var(--white);
  background: var(--surface);
  padding: 10px 14px;
  margin: 20px 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.65;
}

.highlight strong {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 6px;
  font-weight: 400;
}

/* -- SPONSOR-ONLY: FIRMA BLOCK ---------------------------------- */
.firma-block { margin-top: 24px; }

.firma-despedida {
  font-size: 12px;
  color: rgba(240,236,228,.8);
  margin-bottom: 32px;
  line-height: 1.7;
}

.firma-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.firma-slot {
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 8px;
}

.firma-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
}

.firma-role {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--muted);
  margin-top: 2px;
}

/* -- ADD / DEL BUTTONS ------------------------------------------ */
.add-btn-wrap {
  text-align: center;
  margin: -12px 0 28px;
}

.add-btn {
  background: none;
  border: 1px dashed var(--rule);
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 8px 22px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.add-btn:hover { border-color: var(--white); color: var(--white); }

.del-btn {
  color: rgba(255,255,255,.2);
  cursor: pointer;
  font-size: 14px;
  transition: color .15s;
}

.del-btn:hover { color: #e54; }

/* -- MODALS ----------------------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: #1e1e1e;
  border: 1px solid var(--rule);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-box.modal-wide { max-width: 700px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
}

.modal-header h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: .1em;
  color: var(--white);
  font-weight: 400;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: var(--white); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-body textarea {
  width: 100%;
  height: 220px;
  background: var(--ink);
  border: 1px solid var(--rule);
  color: var(--white);
  font-family: 'Barlow', monospace;
  font-size: 12px;
  padding: 12px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
}

.modal-footer button {
  background: var(--mid);
  border: 1px solid var(--rule);
  color: var(--white);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 7px 18px;
  cursor: pointer;
}

.modal-footer button:hover { border-color: rgba(255,255,255,.3); }

.modal-footer button.primary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
  font-weight: 700;
}

/* -- LISTADO TABLE ---------------------------------------------- */
.listado-table {
  width: 100%;
  border-collapse: collapse;
}

.listado-table th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

.listado-table td {
  padding: 10px 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.listado-table tr { cursor: pointer; transition: background .12s; }
.listado-table tbody tr:hover { background: rgba(255,255,255,.04); }

.listado-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  letter-spacing: .1em;
}

/* -- EDITABLE FIELDS -------------------------------------------- */
[contenteditable] {
  outline: none;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s;
}

[contenteditable]:hover { border-bottom-color: rgba(255,255,255,.15); }
[contenteditable]:focus { border-bottom-color: rgba(255,255,255,.4); }

/* -- RESPONSIVE ------------------------------------------------- */
@media (max-width: 580px) {
  .masthead-inner { grid-template-columns: 1fr; }
  .doc-meta-row { justify-content: flex-start; }
  .client-bar { grid-template-columns: 1fr; }
  .client-cell { border-right: none; border-bottom: 1px solid var(--rule); }
  .client-cell:last-child { border-bottom: none; }
  .grid2 { grid-template-columns: 1fr; }
  .pkg-row { grid-template-columns: 1fr; }
  .sig-grid { grid-template-columns: 1fr; gap: 24px; }
  .service-tabs { grid-template-columns: repeat(2, 1fr); }
  .footer { flex-direction: column; gap: 14px; text-align: center; }
  .f-contact { text-align: center; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .firma-grid { grid-template-columns: 1fr; gap: 20px; }
  .toolbar { flex-wrap: wrap; }
}

/* -- PDF MODE --------------------------------------------------- */
.pdf-mode {
  background: #0c0c0c;
  color: #f0ece4;
  padding-top: 40px;
  /* Boost text brightness for PDF render */
  --muted: rgba(255,255,255,.58);
  --dim:   rgba(255,255,255,.35);
  --off:   rgba(240,236,228,.88);
  --rule:  rgba(255,255,255,.14);
}

.pdf-mode .toolbar { display: none; }
.pdf-mode #topo-canvas { display: none; }
.pdf-mode .del-btn { display: none; }
.pdf-mode .add-btn-wrap { display: none; }
.pdf-mode .service-tabs { display: none; }
.pdf-mode [contenteditable] { border-bottom-color: transparent !important; }

/* Boost hardcoded color overrides for PDF readability */
.pdf-mode .concept-desc { color: rgba(255,255,255,.6); }
.pdf-mode .body-text { color: rgba(240,236,228,.88); }
.pdf-mode .firma-despedida { color: rgba(240,236,228,.88); }
.pdf-mode .n-row { color: rgba(255,255,255,.6); }
.pdf-mode .cc-label { color: rgba(255,255,255,.45); }
.pdf-mode .g-card-head { color: rgba(255,255,255,.42); }
.pdf-mode .n-num { color: rgba(255,255,255,.45); }
.pdf-mode .td-note { color: rgba(255,255,255,.55); }
.pdf-mode .pkg-list li { color: rgba(255,255,255,.6); }
.pdf-mode .td-qty, .pdf-mode .td-price { color: rgba(255,255,255,.55); }

/* Hide the "Tipo de servicio" sec-head in PDF (it's navigation, not content) */
.pdf-mode .sec-head.shared-cotizacion { display: none; }

/* Spacers inserted by the page-break heuristic */
.pdf-spacer { margin: 0; padding: 0; border: none; line-height: 0; font-size: 0; }

/* -- PRINT (Ctrl+P) --------------------------------------------- */
@media print {
  #topo-canvas { display: none; }
  .toolbar { display: none; }
  .service-tabs { display: none; }
  .del-btn { display: none; }
  .add-btn-wrap { display: none; }
  .masthead { padding-top: 20px; }
  [contenteditable] { border-bottom-color: transparent !important; }
}
