:root {
  --brand: #b5714a;
  --brand-dark: #8b5e3c;
  --brand-deeper: #6d4c32;
  --bg: #f8f5f0;
  --card: #ffffff;
  --border: #e8e0d6;
  --text: #2d2a24;
  --text-muted: #8a7e72;
  --green: #4a8b5e;
  --green-bg: #e8f5e9;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.08), 0 4px 10px -5px rgba(0,0,0,.04);
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark) 50%, var(--brand-deeper));
  color: #fff;
  padding: 1.2rem 1.5rem 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 20px rgba(107, 74, 48, 0.2);
}
.header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.3px;
}
.header h1 span { font-style: italic; }
.header .sub {
  font-size: .85rem;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
.header .meta {
  font-size: .75rem;
  opacity: .65;
  margin-top: 6px;
}

/* Scenario Tabs */
.scenario-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem 1rem 0;
  max-width: 900px;
  margin: 0 auto;
}
.scenario-tab {
  padding: .5rem 1rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .2s;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.scenario-tab:hover { border-color: var(--brand); color: var(--brand); }
.scenario-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(181,113,74,.3);
}
.scenario-tab .badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  background: rgba(255,255,255,.2);
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}
.scenario-tab.active .badge { background: rgba(0,0,0,.15); }
.scenario-tab .badge.green { background: var(--green); color: #fff; }

/* Main layout */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}
.layout:has(.stage-nav.nav-hidden):has(.flight-nav.nav-hidden) {
  grid-template-columns: 1fr;
}
.stage-nav, .flight-nav { grid-column: 1; }
.content-area { grid-column: 2; }
.layout:has(.stage-nav.nav-hidden):has(.flight-nav.nav-hidden) .content-area {
  grid-column: 1;
}

/* Sidebar — Stage nav */
.stage-nav {
  position: sticky;
  top: 10rem;
  align-self: start;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .8rem;
  border: 1px solid var(--border);
}
.stage-nav h3 {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: .6rem;
  font-weight: 600;
}
.stage-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .45rem .6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  transition: all .15s;
  margin-bottom: 2px;
}
.stage-nav-item:hover { background: #f0ebe4; }
.stage-nav-item.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(181,113,74,.25);
}
.stage-nav-item .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all .2s;
}
.stage-nav-item.active .dot { background: #fff; }
.stage-nav-item .num {
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}
.stage-nav-item.active .num { color: rgba(255,255,255,.7); }

/* Main content area */
.content-area { min-width: 0; }

/* Stage section */
.stage-section {
  display: none;
  animation: fadeUp .35s ease;
}
.stage-section.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .8rem;
  flex-wrap: wrap;
}
.stage-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--brand-deeper);
}
.stage-header .day-badge {
  font-size: .7rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  padding: 3px 10px;
  border-radius: 100px;
}

/* Transport card (generic) */
.transport-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.transport-card h3 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--brand-deeper);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.transport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.transport-opt {
  background: var(--bg);
  border-radius: 8px;
  padding: .5rem .7rem;
  font-size: .75rem;
  border: 1px solid var(--border);
  transition: all .15s;
}
.transport-opt:hover { border-color: var(--brand); }
.transport-opt .label { font-weight: 600; color: var(--brand-dark); }
.transport-opt .detail { color: var(--text-muted); margin-top: 2px; }
.transport-opt a { color: var(--brand); text-decoration: none; font-weight: 500; }
.transport-opt a:hover { text-decoration: underline; }
.transport-opt .tag {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Accommodation cards */
.accom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.accom-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  box-shadow: var(--shadow);
  transition: all .2s;
  position: relative;
}
.accom-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.accom-card.recommended {
  border-color: var(--brand);
  background: linear-gradient(135deg, #fff, #fdf8f4);
}
.accom-card.recommended::before {
  content: "RECOMENDADO";
  position: absolute;
  top: -1px;
  right: 12px;
  font-size: .55rem;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 0 0 6px 6px;
  letter-spacing: .5px;
}
.accom-card .name {
  font-weight: 600;
  font-size: .85rem;
  color: var(--text);
  margin-bottom: 2px;
}
.accom-card .price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand-deeper);
}
.accom-card .price .unit {
  font-size: .65rem;
  font-weight: 400;
  color: var(--text-muted);
}
.accom-card .details {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.accom-card .details .rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #e6a817;
  font-weight: 600;
}
.accom-card .details .kitchen {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 600;
}
.accom-card .details .kitchen.yes { background: var(--green-bg); color: var(--green); }
.accom-card .details .kitchen.no { background: #fce4e4; color: #c62828; }
.accom-card .btn-reserve {
  display: inline-block;
  margin-top: 6px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  border: 1px solid var(--brand);
  padding: 3px 10px;
  border-radius: 6px;
  transition: all .15s;
}
.accom-card .btn-reserve:hover {
  background: var(--brand);
  color: #fff;
}

/* Flight section */
.flight-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.flight-section h3 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--brand-deeper);
  margin-bottom: .5rem;
}
.flight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.flight-card {
  background: var(--bg);
  border-radius: 8px;
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  font-size: .75rem;
}
.flight-card .route { font-weight: 600; color: var(--brand-dark); }
.flight-card .info { color: var(--text-muted); margin-top: 2px; }
.flight-card a { color: var(--brand); text-decoration: none; font-weight: 500; }
.flight-card a:hover { text-decoration: underline; }

/* Total box */
.total-box {
  background: linear-gradient(135deg, #f6f0ea, #f0e8e0);
  border-radius: var(--radius);
  padding: .8rem 1.5rem;
  margin: 1rem auto .5rem;
  max-width: 600px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border);
}
.total-box .stat {
  font-size: .8rem;
}
.total-box .stat strong { color: var(--brand-deeper); }
.total-box .stat .big {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand);
}

/* Comparison table */
.comparison {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}
.comparison h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--brand-deeper);
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
}
.comparison table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}
.comparison th, .comparison td {
  padding: .5rem .7rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.comparison th {
  background: var(--bg);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  font-weight: 600;
}
.comparison tr:last-child td { border-bottom: none; }
.comparison tr:hover td { background: #fdfaf7; }
.comparison .highlight { font-weight: 700; color: var(--brand); }
.comparison .winner {
  background: #f0faf3 !important;
}
.comparison .winner td:first-child {
  border-left: 3px solid var(--green);
}

/* note */
.note {
  font-size: .7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* Sub-tabs (Transfer | Vuelos | Alojamiento) */
.sub-tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  padding: .5rem 1rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}
.sub-tab {
  padding: .5rem 1.2rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .2s;
  box-shadow: var(--shadow);
}
.sub-tab:hover { border-color: var(--brand); color: var(--brand); }
.sub-tab.active {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(181,113,74,.3);
}

/* Flight nav sidebar (Ida / Vuelta) */
.flight-nav {
  position: sticky;
  top: 10rem;
  align-self: start;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .8rem;
  border: 1px solid var(--border);
}
.flight-nav h3 {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: .6rem;
  font-weight: 600;
}
.flight-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .45rem .6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text);
  transition: all .15s;
  margin-bottom: 2px;
}
.flight-nav-item:hover { background: #f0ebe4; }
.flight-nav-item.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(181,113,74,.25);
}
.flight-nav-item .icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: .85rem;
}
.flight-nav-item .count {
  margin-left: auto;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0 6px;
  border-radius: 8px;
}
.flight-nav-item.active .count { color: rgba(255,255,255,.7); background: rgba(255,255,255,.15); }

/* Hide nav sidebars when not needed */
.nav-hidden { display: none !important; }

/* ========== RESPONSIVE: Tablet (768px) ========== */
@media (max-width: 768px) {
  .header {
    padding: .8rem .75rem .6rem;
  }
  .header h1 {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
  }
  .header .sub {
    font-size: .7rem;
    letter-spacing: .5px;
  }

  .scenario-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: .75rem .75rem 0;
    gap: 6px;
  }
  .scenario-tabs::-webkit-scrollbar { display: none; }
  .scenario-tab {
    flex-shrink: 0;
    font-size: .72rem;
    padding: .4rem .8rem;
  }
  .scenario-tab br + span { font-size: .6rem; }

  .sub-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: .5rem .75rem .75rem;
    gap: 4px;
  }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab {
    flex-shrink: 0;
    font-size: .72rem;
    padding: .4rem .9rem;
  }

  .total-box {
    margin: .5rem .75rem;
    padding: .5rem .75rem;
    gap: 8px;
    border-radius: 10px;
  }
  .total-box .stat { font-size: .68rem; }
  .total-box .stat .big { font-size: .8rem; }

  .layout {
    grid-template-columns: 1fr;
    padding: 0 .75rem;
    margin: .5rem auto;
    gap: .75rem;
  }

  .stage-nav {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .6rem;
  }
  .stage-nav h3 {
    font-size: .6rem;
    margin-bottom: .3rem;
  }
  .stage-nav-item {
    padding: .5rem .6rem;
    font-size: .78rem;
    gap: 6px;
  }

  .flight-nav {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .6rem;
  }
  .flight-nav h3 {
    font-size: .6rem;
    margin-bottom: .3rem;
  }
  .flight-nav-item {
    padding: .5rem .6rem;
    font-size: .78rem;
  }

  .stage-header { gap: .5rem; }
  .stage-header h2 { font-size: 1.2rem; }

  .accom-grid { grid-template-columns: 1fr; }
  .accom-card { padding: .65rem .8rem; }
  .accom-card .price { font-size: .95rem; }
  .accom-card.recommended::before {
    right: 8px;
  }

  .flight-grid {
    grid-template-columns: 1fr !important;
  }
  .flight-card { padding: .5rem .65rem; }

  .transport-grid { grid-template-columns: 1fr; }
  .transport-opt { font-size: .72rem; }

  .flight-section { padding: .6rem .8rem; }

  .comparison table { font-size: .68rem; }
  .comparison th, .comparison td { padding: .35rem .45rem; }
}

/* ========== RESPONSIVE: Small phones (400px) ========== */
@media (max-width: 400px) {
  .header h1 { font-size: 1.05rem; }
  .header .sub { font-size: .6rem; letter-spacing: .3px; }

  .scenario-tab { font-size: .65rem; padding: .35rem .65rem; }
  .scenario-tab br + span { font-size: .55rem; }
  .sub-tab { font-size: .65rem; padding: .35rem .7rem; }

  .stage-nav-item { font-size: .72rem; padding: .4rem .5rem; }
  .flight-nav-item { font-size: .72rem; padding: .4rem .5rem; }

  .total-box { padding: .4rem .6rem; gap: 6px; }
  .total-box .stat { font-size: .62rem; }
  .total-box .stat .big { font-size: .72rem; }

  .stage-header h2 { font-size: 1.05rem; }
  .accom-card .name { font-size: .78rem; }
  .accom-card .price { font-size: .85rem; }
  .accom-card .price .unit { font-size: .6rem; }
  .accom-card .details { font-size: .62rem; gap: 4px; }
  .accom-card .btn-reserve { font-size: .62rem; padding: 2px 8px; }

  .flight-card { font-size: .65rem; padding: .4rem .5rem; }
  .transport-opt { font-size: .65rem; }
}

/* ========== Desktop: hide mobile-only elements ========== */
.mobile-nav-overlay,
.mobile-nav-drawer,
.nav-toggle { display: none !important; }
