/* BusMapa Perú — estilos globales */
:root {
  --navy: #0c1f3d;
  --navy-mid: #142d52;
  --navy-soft: #1e3a66;
  --white: #ffffff;
  --bg: #f4f6fa;
  --text: #1a2433;
  --muted: #5c6b7f;
  --border: #e2e8f0;
  --purple: #5b4dc7;
  --green: #0d9f6e;
  --green-hover: #0b875c;
  --accent: #3d5afe;
  --shadow: 0 12px 40px rgba(12, 31, 61, 0.12);
  --shadow-sm: 0 4px 16px rgba(12, 31, 61, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--navy-soft);
  text-decoration: none;
}

a:hover {
  color: var(--purple);
}

h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--navy-mid), var(--navy));
  display: grid;
  place-items: center;
  color: var(--white);
}

.logo-mark svg {
  width: 22px;
  height: 22px;
}

.logo span em {
  font-style: normal;
  color: #c62828;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-main a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.nav-main a:hover,
.nav-main a.is-active {
  color: var(--navy);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-mid);
  color: var(--white);
}

.btn-green {
  background: var(--green);
  color: var(--white);
}

.btn-green:hover {
  background: var(--green-hover);
  color: var(--white);
}

.btn-outline {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--navy-soft);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  padding: 4.5rem 0 8rem;
  color: var(--white);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 31, 61, 0.55) 0%, rgba(12, 31, 61, 0.75) 100%),
    url("/assets/images/hero-machu-picchu.jpg") center / cover;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 18ch;
  margin-bottom: 0.75rem;
}

.hero-lead {
  font-size: 1.05rem;
  max-width: 52ch;
  opacity: 0.95;
  margin-bottom: 2rem;
}

/* Search card */
.search-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
}

.search-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-field select,
.search-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: var(--white);
}

.swap-btn {
  align-self: center;
  margin-top: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.features-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: -3.5rem auto 3rem;
  position: relative;
  z-index: 2;
}

.feature-pill {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.feature-pill .icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.feature-pill h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.feature-pill p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-head p {
  color: var(--muted);
  margin: 0;
  max-width: 48ch;
}

.map-companies {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: start;
}


.busmapa-map {
  height: 380px;
  min-height: 280px;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  background: #e8edf3;
  z-index: 1;
}

.busmapa-map--compact {
  height: 200px;
  min-height: 180px;
}

.busmapa-map .leaflet-container {
  height: 100%;
  width: 100%;
  font: inherit;
}

.leaflet-control-attribution {
  font-size: 10px !important;
}

.company-grid {
  display: grid;
  gap: 1rem;
}

.company-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.company-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--navy);
  text-align: center;
  line-height: 1.1;
}

.company-card h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.company-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.routes-scroll {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.route-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}

.route-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.route-card img {
  height: 160px;
  width: 100%;
  object-fit: cover;
  background: var(--bg);
}

.route-card img.is-error {
  object-fit: contain;
  padding: 1.5rem;
  opacity: 0.55;
}

.route-card-body {
  padding: 1rem;
}

.route-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.step-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--purple);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.faq-list details {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
}

.travel-tips {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
}

/* Results page */
.results-hero {
  padding: 2rem 0 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.results-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem 0 4rem;
}

.filters {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.filter-group {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.filter-group h4 {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
}

.price-range {
  width: 100%;
  accent-color: var(--accent);
}

.result-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1.25rem;
}

.result-card .bus-photo {
  height: 128px;
  background: #e8edf5;
  border-radius: var(--radius-sm);
  margin: 0.75rem 0;
  overflow: hidden;
}

.result-card .bus-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

.result-price .from {
  font-size: 0.8rem;
  color: var(--muted);
}

.result-price strong {
  font-size: 1.5rem;
  color: var(--navy);
}

/* Horarios + mapa de asientos (demo) */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.schedule-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--white);
  overflow: hidden;
}

.schedule-row.is-open {
  border-color: #b8c9e6;
  box-shadow: 0 4px 20px rgba(12, 35, 71, 0.08);
}

.schedule-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto minmax(88px, auto);
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  cursor: default;
}

.schedule-summary__time {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.schedule-summary__meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.schedule-summary__service {
  font-size: 0.88rem;
  color: var(--text);
}

.schedule-summary__price {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  text-align: right;
}

.schedule-summary__price span {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.btn-seats-toggle {
  white-space: nowrap;
  min-width: 7.5rem;
}

.schedule-seats-panel {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.15rem 1.5rem;
  background: #f6f8fc;
}

.schedule-seats-panel[hidden] {
  display: none !important;
}

.bus-deck-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.floor-tabs {
  display: inline-flex;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  margin-bottom: 1rem;
  gap: 0.15rem;
}

.floor-tabs button {
  border: none;
  background: transparent;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.floor-tabs button.is-active {
  background: var(--navy);
  color: var(--white);
}

.seat-picker-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.25rem;
  align-items: start;
}

.seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.seat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.seat-legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block;
}

.seat-legend .lg-free i {
  background: #fff;
}

.seat-legend .lg-pick i {
  background: var(--navy);
}

.seat-legend .lg-busy i {
  background: #d5dce8;
}

.seat-grid-wrap {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  max-width: 280px;
  margin: 0 auto;
}

.seat-grid--wide {
  max-width: 360px;
  grid-template-columns: repeat(5, 1fr);
}

.seat-grid__aisle {
  grid-column: 1 / -1;
  height: 0.5rem;
}

.seat-btn {
  border: 1px solid #cfd8e8;
  background: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 2rem;
}

.seat-btn.seat--premium {
  background: #e8f0d4;
  border-color: #c5d6a1;
}

.seat-btn.seat--occupied {
  background: #dfe4ed;
  color: #8a94a6;
  cursor: not-allowed;
  position: relative;
}

.seat-btn.seat--occupied::after {
  content: '⊘';
  font-size: 0.65rem;
  display: block;
}

.seat-btn.seat--selected {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.seat-price-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.seat-price-box h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.seat-price-box .total {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  min-height: 1.5rem;
}

.seat-demo-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .schedule-summary {
    grid-template-columns: 1fr 1fr;
  }

  .seat-picker-layout {
    grid-template-columns: 1fr;
  }
}

.disclaimer-bar {
  background: var(--navy);
  color: var(--white);
  padding: 1rem 0;
  font-size: 0.9rem;
}

.disclaimer-bar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.disclaimer-bar a {
  color: #a8c4ff;
}

/* Legal & content pages */
.page-hero {
  padding: 2.5rem 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.route-cover {
  margin: 0;
  max-height: 280px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.route-cover img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center;
}

.legal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin: 2rem auto 4rem;
  border: 1px solid var(--border);
  max-width: 820px;
}

.legal-content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
}

.legal-content ul {
  padding-left: 1.25rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-entity-dl {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.legal-entity-dl dt {
  font-weight: 600;
  color: var(--navy);
  margin: 0;
}

.legal-entity-dl dd {
  margin: 0;
  color: var(--text);
}

@media (max-width: 600px) {
  .legal-entity-dl {
    grid-template-columns: 1fr;
  }
}

.placeholder {
  background: #fff8e6;
  border: 1px dashed #e6c200;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

/* Contact form */
.contact-form {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 560px;
}

.contact-form label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  margin-bottom: 1rem;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h4 {
  color: var(--white);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.25rem;
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  padding: 1.25rem;
  display: none;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-inner {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(12, 31, 61, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal.is-open {
  display: flex;
}

.cookie-modal-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
}

.badge-estimate {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.external-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

@media (max-width: 1024px) {
  .search-card {
    grid-template-columns: 1fr 1fr;
  }
  .swap-btn {
    display: none;
  }
  .features-row,
  .routes-scroll,
  .map-companies,
  .steps-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .results-layout {
    grid-template-columns: 1fr;
  }
  .filters {
    position: static;
    max-height: none;
  }
}

.contact-layout {
  margin: 2rem auto 4rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  width: min(100% - 2rem, var(--max));
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .nav-main {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }
  .nav-main.is-open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .search-card {
    grid-template-columns: 1fr;
  }
  .features-row,
  .routes-scroll,
  .map-companies,
  .steps-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .result-card {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-bottom: 6rem;
  }
}