*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sky: #0a1628;
  --sky2: #0d2044;
  --ocean: #0e4a6e;
  --teal: #1a9b8a;
  --sand: #e8c97a;
  --coral: #e07060;
  --white: #ffffff;
  --glass-bg: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.15);
  --glass-shine: rgba(255,255,255,0.25);
  --text: rgba(255,255,255,0.92);
  --text-muted: rgba(255,255,255,0.55);
  --radius: 20px;
  --radius-sm: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--sky);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── BACKGROUND ── */
.bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(14,74,110,0.7) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(26,155,138,0.4) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 60% 20%, rgba(232,201,122,0.12) 0%, transparent 50%),
    linear-gradient(160deg, #0a1628 0%, #0d2044 40%, #0a2235 100%);
}
.bg-stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 15%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 70%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 25%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 85%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 55%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,0.5) 0%, transparent 100%);
}

/* ── LIQUID GLASS ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-shine), transparent);
  pointer-events: none;
}
.glass-sm {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.glass-sm::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
}

/* ── LAYOUT ── */
.wrap { max-width: 780px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  padding: 14px 0;
}
.nav-inner {
  background: rgba(10,22,40,0.6);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
}
.nav-brand { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--sand); letter-spacing: 0.01em; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  padding: 5px 12px; border-radius: 30px; transition: all 0.2s;
}
.nav-links a:hover { background: rgba(255,255,255,0.1); color: var(--text); }

/* ── HERO ── */
.hero { padding: 70px 0 50px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(232,201,122,0.15); border: 1px solid rgba(232,201,122,0.3);
  border-radius: 50px; padding: 6px 16px; font-size: 13px;
  color: var(--sand); margin-bottom: 28px;
  animation: fadeDown 0.8s ease both;
}
.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(38px, 7vw, 62px);
  line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 16px;
  animation: fadeUp 0.8s ease 0.1s both;
}
.hero h1 em { font-style: italic; color: var(--teal); }
.hero-sub {
  font-size: 18px; color: var(--text-muted); font-weight: 300;
  max-width: 480px; margin: 0 auto 40px; line-height: 1.6;
  animation: fadeUp 0.8s ease 0.2s both;
}
.hero-dates {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  animation: fadeUp 0.8s ease 0.3s both;
}
.date-pill {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50px; padding: 8px 18px; font-size: 14px;
}
.date-pill strong { color: var(--sand); }

/* ── SECTION TITLES ── */
.section { padding: 50px 0 10px; }
.section-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal); font-weight: 500; margin-bottom: 6px;
}
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 28px; margin-bottom: 20px; line-height: 1.2;
}

/* ── FLIGHT CARDS ── */
.flight-card {
  padding: 22px 24px; margin-bottom: 12px;
}
.flight-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.flight-tag {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 30px; font-weight: 500;
}
.tag-ida { background: rgba(26,155,138,0.2); color: var(--teal); border: 1px solid rgba(26,155,138,0.3); }
.tag-vuelta { background: rgba(232,201,122,0.15); color: var(--sand); border: 1px solid rgba(232,201,122,0.3); }
.flight-num { font-size: 13px; color: var(--text-muted); }
.flight-route {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
}
.airport-code { font-family: 'DM Serif Display', serif; font-size: 38px; line-height: 1; }
.airport-name { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.flight-time { font-size: 26px; font-weight: 500; margin-bottom: 2px; }
.flight-date-small { font-size: 12px; color: var(--text-muted); }
.flight-middle { text-align: center; }
.flight-duration {
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
}
.flight-line {
  display: flex; align-items: center; gap: 4px;
}
.flight-line-bar {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(26,155,138,0.5), rgba(255,255,255,0.3));
}
.plane-icon { font-size: 16px; }
.flight-right { text-align: right; }

/* ── INFO CARDS (hotel, coche) ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:540px){ .info-grid { grid-template-columns: 1fr; } }
.info-card { padding: 20px 22px; }
.info-icon { font-size: 28px; margin-bottom: 12px; }
.info-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.info-card .info-name { font-size: 15px; color: var(--sand); font-weight: 500; margin-bottom: 8px; }
.info-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.info-row:last-child { border-bottom: none; }
.info-row span:last-child { color: var(--text); text-align: right; }
.info-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; font-style: italic; }

/* ── PLANNING ── */
.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-item { overflow: hidden; }
.day-trigger {
  width: 100%; background: none; border: none; color: var(--text);
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  cursor: pointer; text-align: left; transition: background 0.2s;
}
.day-trigger:hover { background: rgba(255,255,255,0.04); }
.day-num {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; line-height: 1.2;
}
.day-num-day { font-size: 18px; font-weight: 500; line-height: 1; }
.day-info { flex: 1; }
.day-name { font-size: 15px; font-weight: 500; }
.day-theme { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.day-arrow { font-size: 18px; color: var(--text-muted); transition: transform 0.3s; }
.day-arrow.open { transform: rotate(180deg); }
.day-body {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
  padding: 0 22px;
}
.day-body.open { max-height: 1000px; padding-bottom: 18px; }
.act { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.act:last-child { border-bottom: none; }
.act-t { font-size: 12px; color: var(--text-muted); min-width: 58px; padding-top: 2px; }
.act-dot-wrap { display: flex; flex-direction: column; align-items: center; gap: 0; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.act-body { flex: 1; }
.act-title { font-size: 14px; font-weight: 500; color: var(--text); }
.act-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.act-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chip {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: rgba(255,255,255,0.07); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── TIPS ── */
.tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:500px){ .tips-grid { grid-template-columns: 1fr; } }
.tip-card { padding: 18px 20px; }
.tip-icon { font-size: 22px; margin-bottom: 8px; }
.tip-card h4 { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.tip-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── FOOTER ── */
.maps-link-wrap { margin-top: 10px; }
.maps-link {
  font-size: 12px; color: var(--teal); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.maps-link:hover { text-decoration: underline; }

footer {
  text-align: center; padding: 50px 0 40px;
  font-size: 13px; color: var(--text-muted);
}
footer .footer-heart { color: var(--coral); }
footer .footer-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px; color: var(--text); margin-bottom: 8px;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ── WAVE DIVIDER ── */
.wave { text-align: center; font-size: 22px; opacity: 0.25; padding: 10px 0; letter-spacing: 4px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── COSTES / LOCK ── */
.lock-wrap { padding: 40px 0; }
.lock-box {
  max-width: 340px; margin: 0 auto; text-align: center;
  padding: 36px 32px;
}
.lock-icon { font-size: 40px; margin-bottom: 16px; }
.lock-title { font-family: 'DM Serif Display', serif; font-size: 22px; margin-bottom: 8px; }
.lock-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.lock-input-wrap { display: flex; gap: 8px; justify-content: center; align-items: center; }
.lock-input {
  width: 160px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; padding: 12px 16px; font-size: 20px; letter-spacing: 0.3em;
  color: var(--text); font-family: 'DM Sans', sans-serif; text-align: center;
  outline: none; transition: border 0.2s;
}
.lock-input:focus { border-color: var(--teal); }
.lock-btn {
  background: var(--teal); border: none; border-radius: 10px;
  padding: 12px 18px; color: #fff; font-size: 18px; cursor: pointer;
  transition: opacity 0.2s; flex-shrink: 0;
}
.lock-btn:hover { opacity: 0.85; }
.lock-hide-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50px; padding: 8px 18px; font-size: 13px; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s; margin-bottom: 20px;
  font-family: 'DM Sans', sans-serif;
}
.lock-hide-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.lock-error { font-size: 13px; color: var(--coral); margin-top: 10px; min-height: 18px; }

.costes-content { display: none; }
.costes-content.unlocked { display: block; }

.cost-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.cost-table th {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500; padding: 8px 12px; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.cost-table th:last-child { text-align: right; }
.cost-table td {
  font-size: 14px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
}
.cost-table td:last-child { text-align: right; font-weight: 500; color: var(--sand); white-space: nowrap; }
.cost-table .affects { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.cost-table tr:last-child td { border-bottom: none; }

.person-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.person-card { padding: 16px 18px; text-align: center; }
.person-avatar { font-size: 28px; margin-bottom: 8px; }
.person-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.person-total { font-size: 22px; font-weight: 500; color: var(--sand); font-family: 'DM Serif Display', serif; }
.person-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }

.cost-total-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; margin-bottom: 20px;
  background: rgba(26,155,138,0.12); border: 1px solid rgba(26,155,138,0.25);
  border-radius: var(--radius-sm);
}
.cost-total-label { font-size: 14px; color: var(--text-muted); }
.cost-total-amount { font-size: 24px; font-family: 'DM Serif Display', serif; color: var(--teal); }

/* ── NAV HAMBURGUESA ── */
.nav-burger {
  display: none; background: none; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; color: var(--text); font-size: 18px; padding: 5px 10px;
  cursor: pointer; line-height: 1; transition: background 0.2s;
}
.nav-burger:hover { background: rgba(255,255,255,0.1); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  .wrap { padding: 0 16px; }

  /* Nav: hamburguesa */
  .nav-burger { display: block; }
  .nav-links {
    display: none; position: absolute; top: calc(100% + 6px); left: 16px; right: 16px;
    flex-direction: column; gap: 4px;
    background: rgba(10,22,40,0.92); backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 16px;
    padding: 12px; z-index: 200;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
  nav { position: sticky; top: 0; }
  .nav-inner { position: relative; }
  .nav-brand { font-size: 15px; }

  /* Hero */
  .hero { padding: 48px 0 36px; }
  .hero-sub { font-size: 16px; }
  .date-pill { font-size: 13px; padding: 7px 14px; }

  /* Secciones */
  .section { padding: 38px 0 8px; }
  .section-title { font-size: 24px; }

  /* Vuelos: reducir fuentes */
  .airport-code { font-size: 30px; }
  .flight-time { font-size: 22px; }
  .flight-card { padding: 18px 16px; }

  /* Info grid ya tiene media query a 540px, aquí ajustamos padding */
  .info-card { padding: 16px 16px; }
  .info-row { font-size: 12px; }

  /* Tips */
  .tips-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tip-card { padding: 14px 16px; }

  /* Planning */
  .day-trigger { padding: 14px 16px; gap: 12px; }
  .day-body { padding: 0 16px; }
  .day-body.open { padding-bottom: 14px; }
  .act-t { min-width: 48px; }

  /* Costes */
  .cost-table th, .cost-table td { padding: 8px 10px; font-size: 13px; }
  .person-grid { grid-template-columns: repeat(3, 1fr); }
  .lock-box { padding: 28px 20px; }
}

/* ── Móvil grande (≤ 480px) ── */
@media (max-width: 480px) {
  /* Hero */
  .hero { padding: 36px 0 28px; }
  .hero-badge { font-size: 12px; padding: 5px 13px; margin-bottom: 20px; }
  .hero-sub { font-size: 15px; margin-bottom: 28px; }
  .hero-dates { gap: 8px; }
  .date-pill { font-size: 12px; padding: 6px 12px; }

  /* Vuelos: layout vertical en pantallas pequeñas */
  .flight-route {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    text-align: center;
  }
  .flight-right { text-align: center; }
  .flight-middle { order: 2; }
  .flight-line { justify-content: center; max-width: 120px; margin: 0 auto; }

  /* Tabla de costes: ocultar columna "Afecta a" en móvil */
  .cost-table .col-afecta { display: none; }
  .cost-table th:nth-child(2), .cost-table td:nth-child(2) { display: none; }

  /* Personas: 2 columnas en móvil */
  .person-grid { grid-template-columns: repeat(2, 1fr); }
  .person-total { font-size: 18px; }

  /* Tips: 1 columna */
  .tips-grid { grid-template-columns: 1fr; }

  /* Lock */
  .lock-input { width: 130px; font-size: 18px; }
  .lock-box { padding: 24px 16px; }
  .lock-sub { font-size: 13px; }

  /* Planning */
  .day-trigger { padding: 12px 14px; gap: 10px; }
  .day-num { width: 38px; height: 38px; }
  .day-name { font-size: 14px; }
  .day-theme { font-size: 12px; }
  .act { gap: 10px; }
  .act-t { min-width: 42px; font-size: 11px; }
  .act-title { font-size: 13px; }
  .act-desc { font-size: 12px; }

  /* Info rows: apilar label y valor */
  .info-row { flex-direction: column; gap: 2px; }
  .info-row span:last-child { text-align: left; }

  /* Costes total bar */
  .cost-total-bar { flex-direction: column; gap: 4px; text-align: center; }
  .cost-total-amount { font-size: 20px; }
}

/* ── Móvil pequeño (≤ 360px) ── */
@media (max-width: 360px) {
  .wrap { padding: 0 12px; }
  .airport-code { font-size: 26px; }
  .flight-time { font-size: 20px; }
  .person-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .person-total { font-size: 16px; }
  .section-title { font-size: 22px; }
}

/* ── BOTÓN IMPRIMIR ── */
.nav-icon-btn {
  background: none; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; color: var(--text); font-size: 16px; padding: 6px 8px;
  cursor: pointer; line-height: 1; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.nav-icon-btn:hover { background: rgba(255,255,255,0.1); }

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar elementos de fondo muy pesados para que el PDF vuele */
  nav, .bg-layer, .bg-stars, .lock-wrap, .lock-hide-btn {
    display: none !important;
  }

  /* Desactivar los desenfoques pesados (backdrop-filter) para acelerar el renderizado */
  .glass, .glass-sm, .nav-inner {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .day-body {
    max-height: none !important;
    padding-bottom: 20px !important;
  }
  .day-arrow { 
    display: none !important; 
  }

  .wrap { max-width: 100% !important; padding: 0 20px !important; }
  
  .flight-card, .info-card, .tip-card, .day-item {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

/* ── CORRECCIÓN DE ANCLAJES (Scroll offset para nav fija) ── */
.section {
  scroll-margin-top: 40px;
}
