/* =========================================================================
 * TuBoleto / Llaqta Machupicchu clone — booking/checkout components
 * Complements the captured official CSS (style-*.css, Tailwind + Angular
 * Material bundle): everything below styles only our own .mp-* elements.
 * Colors match the official theme (bg-tuboleto #1975F4, dark #0952B8,
 * light #E8F1FF); font stack matches the official pages (avenir).
 * ========================================================================= */

:root {
  --mp-blue: #1975f4;
  --mp-blue-dark: #0952b8;
  --mp-blue-light: #e8f1ff;
  --mp-ink: #1f2937;
  --mp-muted: #6b7280;
  --mp-border: #d1d5db;
  --mp-error: #b3261e;
  --mp-warn-bg: #fff8e1;
  --mp-warn-border: #f0c36d;
}

/* ------------------------------------------------------------------ */
/* booking panel (ticket.php) — looks like the official mat form       */
/* ------------------------------------------------------------------ */

.mp-panel-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--mp-ink);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .75rem;
}
.mp-panel-title::before {
  content: "";
  display: inline-block;
  width: 24px; height: 24px;
  background: var(--mp-blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 010 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125.504 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125H3.375z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 010 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125.504 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125H3.375z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* form fields — mat-form-field-fill look */
.mp-field { display: block; margin: 0 0 14px; }
.mp-field-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--mp-ink);
  margin: 0 0 4px;
}
.mp-field input,
.mp-select-wrap select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--mp-ink);
  font: 500 .95rem/1.2 avenir, "Avenir", sans-serif;
  padding: 12px 36px 12px 12px;
  min-height: 48px;
}
.mp-select-wrap { position: relative; display: block; }
.mp-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px; top: 50%;
  width: 10px; height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--mp-muted);
  border-bottom: 2px solid var(--mp-muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.mp-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.mp-field input:focus,
.mp-select-wrap select:focus {
  outline: 2px solid var(--mp-blue);
  outline-offset: -1px;
  background: #fff;
}
.mp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* calendar — mat-calendar look */
.mp-cal {
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.mp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
}
.mp-cal-month { font-weight: 700; color: var(--mp-ink); font-size: .95rem; }
.mp-cal-nav {
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--mp-blue);
  font-size: 20px; line-height: 1;
  cursor: pointer;
}
.mp-cal-nav:hover { background: var(--mp-blue-light); }
.mp-cal-nav--off { visibility: hidden; }
.mp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.mp-cal-wd {
  font-size: .72rem;
  font-weight: 700;
  color: var(--mp-muted);
  padding: 6px 0;
}
.mp-cal-space { min-height: 38px; }
.mp-cal-day {
  min-height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font: 500 .85rem/1 avenir, sans-serif;
  color: var(--mp-ink);
  cursor: pointer;
  aspect-ratio: 1;
  justify-self: center;
  width: 100%;
  max-width: 42px;
}
.mp-cal-day--open:hover { background: var(--mp-blue-light); }
.mp-cal-day--open.is-selected {
  background: var(--mp-blue);
  color: #fff;
  font-weight: 700;
}
.mp-cal-day--past {
  color: #c9cdd4;
  cursor: default;
}

/* tariff rows */
.mp-qty-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--mp-ink);
  margin: 18px 0 8px;
}
.mp-tariff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.mp-tariff-label { font-size: .92rem; font-weight: 600; color: var(--mp-ink); margin: 0; }
.mp-tariff-price { font-size: .95rem; font-weight: 800; color: var(--mp-blue-dark); margin: 2px 0 0; }
.mp-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--mp-border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.mp-stepper-btn {
  width: 38px; height: 38px;
  border: 0;
  background: var(--mp-blue-light);
  color: var(--mp-blue-dark);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.mp-stepper-btn:hover { background: #d3e4ff; }
.mp-stepper-val {
  min-width: 36px;
  text-align: center;
  font-size: .95rem;
  font-weight: 700;
  color: var(--mp-ink);
}

/* notes / alerts */
.mp-note {
  font-size: .8rem;
  line-height: 1.5;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
}
.mp-note--info {
  background: var(--mp-blue-light);
  color: var(--mp-blue-dark);
  border: 1px solid #c4dbff;
}
.mp-note--warn {
  background: var(--mp-warn-bg);
  border: 1px solid var(--mp-warn-border);
  color: #7c5a08;
  list-style: none;
}
.mp-note--warn li { margin: 2px 0; padding-left: 14px; position: relative; }
.mp-note--warn li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mp-warn-border);
}
ul.mp-note { padding-left: 12px; }

/* total + actions */
.mp-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--mp-ink);
}
.mp-total { font-size: 1.6rem; font-weight: 800; color: var(--mp-ink); }
.mp-error {
  color: var(--mp-error);
  font-size: .85rem;
  font-weight: 700;
  margin: 10px 0 0;
}
.mp-actions { display: flex; gap: 12px; margin: 18px 0 4px; flex-wrap: wrap; }
.mp-actions--split { justify-content: space-between; }
.mp-btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 14px 22px;
  font: 700 .95rem/1 avenir, sans-serif;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.mp-btn--primary { background: var(--mp-blue); color: #fff; flex: 1; }
.mp-btn--primary:hover { background: var(--mp-blue-dark); }
.mp-btn--primary[disabled] { background: #9db9e8; cursor: not-allowed; }
.mp-btn--ghost {
  background: #fff;
  color: var(--mp-blue);
  border: 1px solid var(--mp-blue);
}
.mp-btn--ghost:hover { background: var(--mp-blue-light); }
.mp-notice {
  background: #f7f7f7;
  border: 1px solid var(--mp-border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  margin: 24px 0;
}

/* ------------------------------------------------------------------ */
/* checkout.php                                                        */
/* ------------------------------------------------------------------ */

.mp-progress {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--mp-blue-light);
  margin: 10px 0 26px;
}
.mp-progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--mp-blue);
  transition: width .25s;
}
.mp-progress-label {
  position: absolute;
  right: 0; top: -22px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--mp-muted);
}
.mp-step-title h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--mp-ink);
  margin: 0 0 18px;
}
.mp-form { margin-top: 6px; }
.mp-summary-card {
  background: var(--mp-blue-light);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 18px;
}
.mp-summary-title { font-weight: 800; color: var(--mp-blue-dark); margin: 0 0 4px; font-size: 1.05rem; }
.mp-summary-line { margin: 2px 0; font-size: .88rem; color: var(--mp-ink); }
.mp-lines {
  border-top: 1px solid var(--mp-border);
  margin: 0 0 18px;
}
.mp-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid #eee;
  font-size: .92rem;
  color: var(--mp-ink);
}
.mp-line--total { font-weight: 800; font-size: 1.05rem; border-bottom: 0; }
.mp-visitor-box {
  border: 1px solid var(--mp-border);
  background: #f9fafb;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: .9rem;
  line-height: 1.7;
  margin: 0 0 18px;
}
.mp-visitor-box p { margin: 0 0 6px; }
.mp-testnote {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px dashed var(--mp-error);
  border-radius: 8px;
  color: var(--mp-error);
  font-size: .83rem;
  font-weight: 700;
}
.mp-pay-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.mp-pay-summary-title { font-size: 1rem; font-weight: 800; color: var(--mp-ink); margin: 0 0 10px; }
.mp-pay-summary { background: #f9fafb; border: 1px solid var(--mp-border); border-radius: 10px; padding: 16px; }
.mp-confirm { text-align: center; }
.mp-confirm-lead { color: var(--mp-muted); font-size: .85rem; margin: 8px 0 4px; }
.mp-ref {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--mp-blue-dark);
  margin: 0 0 18px;
}
.mp-qr { display: flex; justify-content: center; margin: 8px 0 22px; }
.mp-qr svg { width: 180px; height: 180px; }
.mp-confirm .mp-summary-card,
.mp-confirm .mp-lines,
.mp-confirm .mp-visitor-box { text-align: left; }
.mp-confirm .mp-actions { justify-content: center; }

/* legal / support pages */
.mp-legal { padding: 8px 0 40px; font-size: .95rem; line-height: 1.8; color: var(--mp-ink); }
.mp-legal h2 { font-size: 1.1rem; margin: 26px 0 6px; color: var(--mp-blue-dark); }
.mp-legal p { margin: 0 0 12px; }
.mp-legal a { color: var(--mp-blue); text-decoration: underline; }
.mp-page-narrow { max-width: 860px; margin: 0 auto; padding: 40px 16px 60px; }

/* lang switcher (header) */
.mp-lang { position: relative; }
.mp-lang-menu {
  position: absolute;
  right: 0; top: 100%;
  min-width: 130px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  padding: 6px;
  display: none;
  z-index: 300;
}
.mp-lang-menu.is-open { display: block; }
.mp-lang-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--mp-ink);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
}
.mp-lang-menu a:hover { background: var(--mp-blue-light); }
.mp-lang-menu a.is-current { color: var(--mp-blue); }

/* homepage search (replaces the mat-select box) */
.mp-search-select { flex: 1; min-width: 0; }

/* =========================================================================
 * Responsive layer
 * ========================================================================= */

/* the official bundle locks body scroll until its Angular splash-screen JS
   adds .fuse-splash-screen-hidden — that JS is stripped in the clone, so the
   lock would stay forever. Unhook it. */
body:not(.fuse-splash-screen-hidden),
body.fuse-splash-screen-hidden {
  overflow: auto !important;
}

@media (max-width: 767px) {
  /* the official booking panel is a hidden drawer on mobile — the clone
     shows it inline, right under the hero text */
  .mp-panel-outer {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-height: none !important;
  }
  .mp-panel-card {
    position: static !important;
    width: auto !important;
    max-height: none !important;
    margin: 0 12px 16px !important;
    border-radius: 12px !important;
  }
  .mp-panel-scroll { max-height: none !important; overflow: visible !important; padding: 20px !important; }
  /* hero lets the panel wrap under the text */
  .mp-hero { flex-wrap: wrap; min-height: 230px !important; }
  .mp-hero-text { position: static !important; padding: 120px 16px 18px; }
  /* checkout grid stacks */
  .mp-pay-grid { grid-template-columns: 1fr; }
  .mp-field-row { grid-template-columns: 1fr; }
  .mp-actions .mp-btn { width: 100%; flex: none; }
  .mp-ref { font-size: 1.5rem; }
  h1 { font-size: 1.4rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .mp-pay-grid { grid-template-columns: 1fr; }
}

/* homepage search box label (official floating mat label) */
.mp-search-wrap { flex: 1; min-width: 0; }
.mp-search-label {
  display: block;
  font-size: .8rem;
  font-weight: 800;
  color: #4b5563;
  margin: 0 0 2px;
}
.mp-card-cta { text-decoration: none; color: inherit; display: block; }

/* keep step content clear of the sticky disclaimer banner on scrollIntoView */
#mp-checkout-root, #mp-booking-root { scroll-margin-top: 64px; }

/* homepage hero on phones: the captured desktop DOM keeps min-h-[42rem]
   (672px) below the sm breakpoint — the official mobile layout is compact */
@media (max-width: 639px) {
  .mp-home-hero { min-height: 12rem !important; }
  #banner-logo { width: 62% !important; max-width: 260px; }
}
