/* ==========================================================================
   PERÚ IDEAL EXPEDITIONS — Mobile-First Responsive System
   Carga al final del stack CSS. Complementa style.css y luxury-upgrade.css.
   Breakpoints: 320 · 360 · 375 · 390 · 414 · 480 · 768 · 820 · 1024 · 1280+
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (mobile-first)
   -------------------------------------------------------------------------- */
:root {
  --gutter-inline: clamp(16px, 4.5vw, 48px);
  --container: min(1240px, calc(100% - (var(--gutter-inline) * 2)));
  --section-pad: clamp(48px, 10vw, 140px);
  --header-height: clamp(64px, 14vw, 88px);
  --touch-min: 44px;
  --font-body-fluid: clamp(0.9375rem, 0.88rem + 0.25vw, 1rem);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* --------------------------------------------------------------------------
   2. Global layout & overflow
   -------------------------------------------------------------------------- */
html {
  overflow-x: clip;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
  overflow-x: clip;
  min-width: 0;
  font-size: var(--font-body-fluid);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

main,
section,
article,
header,
footer,
nav,
aside {
  min-width: 0;
}

.container {
  width: var(--container);
  max-width: 100%;
  margin-inline: auto;
  padding-inline: 0;
}

img,
video,
picture,
svg {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
  border: 0;
}

/* Full-bleed sections without horizontal scroll */
.section,
.hero-cinema,
.catalog-hero,
.tour-hero,
.destino-page-header {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   3. Typography (fluid)
   -------------------------------------------------------------------------- */
.section-title {
  font-size: clamp(1.75rem, 5.5vw + 0.5rem, 3.7rem);
  overflow-wrap: break-word;
  hyphens: auto;
}

.section-desc,
.body-text {
  max-width: min(520px, 100%);
}

.hero-cinema__title {
  font-size: clamp(1.85rem, 7.5vw + 0.4rem, 5rem);
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero-cinema__subtitle {
  font-size: clamp(0.95rem, 2.5vw + 0.5rem, 1.3rem);
  max-width: min(600px, 100%);
  padding-inline: clamp(0px, 2vw, 16px);
}

.catalog-hero__title {
  font-size: clamp(1.65rem, 5.5vw + 0.5rem, 3.5rem);
}

.tour-hero__title {
  font-size: clamp(1.65rem, 5vw + 0.5rem, 3.25rem);
}

.tour-hero__price-value {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.eyebrow {
  font-size: clamp(10px, 2.5vw, 11px);
  letter-spacing: clamp(0.18em, 0.5vw, 0.32em);
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */
.lux-header {
  min-height: var(--header-height);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.lux-header__inner {
  min-height: var(--header-height);
  gap: clamp(8px, 2.5vw, 24px);
  padding-inline: var(--gutter-inline);
}

.lux-logo__img--header {
  width: auto;
  max-width: min(148px, 42vw);
  height: auto;
  max-height: clamp(36px, 10vw, 56px);
  object-fit: contain;
}

.lux-header__actions {
  gap: clamp(6px, 1.5vw, 12px);
  flex-shrink: 0;
}

.lux-menu-btn {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex-shrink: 0;
}

.theme-toggle-btn,
.lang-switcher__trigger {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
}

.lux-mobile-nav {
  width: min(360px, 100%);
  max-width: 100%;
  height: 100dvh;
  height: 100vh;
  padding:
    max(24px, calc(var(--safe-top) + 16px))
    max(20px, var(--safe-right))
    max(24px, calc(var(--safe-bottom) + 16px))
    max(20px, var(--safe-left));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.lux-mobile-nav__close {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: grid;
  place-items: center;
}

.lux-mobile-nav__list a:not(.btn) {
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.mega-acc__head {
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  min-height: var(--touch-min);
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

/* --------------------------------------------------------------------------
   5. Buttons & CTAs
   -------------------------------------------------------------------------- */
.btn {
  white-space: normal;
  text-align: center;
  min-height: var(--touch-min);
  padding: clamp(14px, 3vw, 17px) clamp(20px, 5vw, 40px);
  font-size: clamp(10px, 2.5vw, 11.5px);
  max-width: 100%;
}

.btn-sm {
  min-height: var(--touch-min);
  padding: clamp(10px, 2.5vw, 12px) clamp(16px, 4vw, 24px);
}

.hero-cinema__cta,
.final-cta__actions,
.activities__cta-actions,
.planner-form__nav {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: min(420px, 100%);
  margin-inline: auto;
}

.hero-cinema__cta .btn,
.final-cta__actions .btn,
.activities__cta-actions .btn {
  width: 100%;
}

.link-gold {
  min-height: var(--touch-min);
  align-items: center;
}

/* --------------------------------------------------------------------------
   6. Hero & search
   -------------------------------------------------------------------------- */
.hero-cinema {
  min-height: 100svh;
  min-height: 100dvh;
}

.hero-cinema__content {
  padding-top: calc(var(--header-height) + clamp(20px, 5vw, 48px));
  padding-bottom: clamp(32px, 6vw, 48px);
  padding-inline: var(--gutter-inline);
  width: 100%;
  max-width: min(900px, 100%);
}

.hero-cinema__video {
  object-fit: cover;
  object-position: center;
}

.hero-search {
  width: calc(100% - (var(--gutter-inline) * 2));
  max-width: min(920px, 100%);
  margin-inline: auto;
  padding: clamp(14px, 4vw, 22px);
}

.hero-search__grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.hero-search__btn {
  white-space: normal;
  width: 100%;
  min-height: var(--touch-min);
}

.hero-search__btn--icon {
  width: var(--touch-min);
  height: var(--touch-min);
  margin-inline: auto;
}

.hero-search__input,
.planner-input,
.visit-form__input,
.tours-toolbar__control input,
.tours-toolbar__control select {
  font-size: 16px; /* evita zoom en iOS */
  min-height: var(--touch-min);
}

.catalog-hero {
  min-height: clamp(240px, 45vw, 340px);
  padding-bottom: clamp(36px, 6vw, 60px);
}

.catalog-hero__content {
  padding-top: calc(var(--header-height) + 16px);
  padding-inline: var(--gutter-inline);
}

.tour-hero {
  min-height: clamp(320px, 60vh, 70vh);
  padding: calc(var(--header-height) + 24px) 0 clamp(40px, 6vw, 60px);
}

.tour-hero__meta {
  gap: 16px 24px;
}

.tour-hero__cta {
  flex-direction: column;
  align-items: stretch;
}

.tour-hero__cta .btn {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   7. Grids & cards
   -------------------------------------------------------------------------- */
.story__grid,
.planner__grid,
.destinations__explorer,
.destinations__detail,
.story-card,
.comunidades__grid,
.cultura__grid,
.visit-hub__grid {
  grid-template-columns: 1fr;
}

.planner-options--grid {
  grid-template-columns: 1fr;
}

.act-grid {
  grid-template-columns: 1fr;
}

.collection-card {
  flex: 0 0 min(340px, calc(100vw - (var(--gutter-inline) * 2)));
}

.collections__track {
  padding-inline: var(--gutter-inline);
  scroll-padding-inline: var(--gutter-inline);
}

.why__grid--4,
.avales__grid,
.contacts__grid,
.gallery__grid {
  grid-template-columns: 1fr;
}

.tours-catalog__grid,
.tours-catalog__toolbar {
  grid-template-columns: 1fr;
}

.dc-card__body {
  padding: clamp(14px, 3vw, 18px);
}

.journal__grid {
  grid-template-columns: 1fr;
}

.journal-card--featured {
  grid-row: auto;
}

.journal-card--featured img {
  aspect-ratio: 16 / 10;
  height: auto;
  min-height: 0;
}

.footer-contact-bar__inner {
  grid-template-columns: 1fr;
  gap: 24px;
}

.pie-footer__grid {
  grid-template-columns: 1fr;
}

/* Certificaciones marquee — sin overflow 100vw */
.certs__marquee-wrap {
  width: 100%;
  position: relative;
  left: auto;
  right: auto;
  margin-left: 0;
  margin-right: 0;
}

.cert-item {
  width: min(220px, 70vw);
  height: auto;
  min-height: 96px;
  aspect-ratio: 220 / 128;
}

/* --------------------------------------------------------------------------
   8. Tabs, sliders & galleries
   -------------------------------------------------------------------------- */
.tour-tabs {
  top: var(--header-height);
}

.tour-tabs__list {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  flex-wrap: nowrap;
  gap: 0;
  padding-inline: var(--gutter-inline);
  scrollbar-width: none;
}

.tour-tabs__list::-webkit-scrollbar {
  display: none;
}

.tour-tabs__link {
  flex-shrink: 0;
  scroll-snap-align: start;
  min-height: var(--touch-min);
  padding-inline: clamp(14px, 3vw, 20px);
  white-space: nowrap;
}

.tour-gallery {
  grid-template-columns: 1fr;
  gap: 12px;
}

.tour-gallery img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.itinerary-step__photos {
  grid-template-columns: 1fr;
}

.itinerary-step__photos img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   9. Forms, cart & checkout
   -------------------------------------------------------------------------- */
.planner-form__nav {
  flex-direction: column-reverse;
  align-items: stretch;
}

.planner-form__nav .btn {
  width: 100%;
}

.visit-form__row {
  grid-template-columns: 1fr;
}

.destino-page-header {
  padding-top: calc(var(--header-height) + clamp(16px, 4vw, 32px));
  padding-bottom: clamp(24px, 4vw, 32px);
}

.cart-page {
  padding-top: calc(var(--header-height) + clamp(24px, 5vw, 48px));
}

.cart-item {
  grid-template-columns: 1fr;
  gap: 12px;
}

.cart-item__img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  max-width: 100%;
}

.pay-checkout__wrap,
.pay-progress {
  max-width: 100%;
}

.pay-progress {
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pay-progress__label {
  font-size: clamp(10px, 2.5vw, 12px);
}

/* --------------------------------------------------------------------------
   10. Modals & documents
   -------------------------------------------------------------------------- */
.lr-modal__dialog {
  width: 100%;
  max-width: 100%;
  max-height: 100dvh;
  border-radius: 0;
}

.lr-modal__header {
  padding: clamp(14px, 3vw, 20px) var(--gutter-inline);
  flex-wrap: wrap;
}

.lr-modal__body {
  padding: clamp(16px, 4vw, 24px) var(--gutter-inline);
}

.tc-table-wrap {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.tc-table {
  min-width: 280px;
  font-size: clamp(12px, 3vw, 13px);
}

.wum-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --------------------------------------------------------------------------
   11. Floating widgets & safe areas
   -------------------------------------------------------------------------- */
.go-top,
.whatsapp-float,
.wsp-widget,
.toast-container {
  right: max(16px, var(--safe-right));
}

.whatsapp-float {
  bottom: max(16px, calc(var(--safe-bottom) + 8px));
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
}

.go-top {
  bottom: max(80px, calc(var(--safe-bottom) + 72px));
}

.wsp-widget {
  bottom: max(80px, calc(var(--safe-bottom) + 72px));
  width: min(320px, calc(100vw - 32px - var(--safe-left) - var(--safe-right)));
}

.tour-mobile-bar {
  padding:
    12px
    max(16px, var(--safe-right))
    max(12px, var(--safe-bottom))
    max(16px, var(--safe-left));
}

.tour-page {
  padding-bottom: calc(72px + var(--safe-bottom));
}

.tour-page .whatsapp-float {
  bottom: max(72px, calc(var(--safe-bottom) + 64px));
}

.tour-page .go-top {
  bottom: max(136px, calc(var(--safe-bottom) + 128px));
}

.tour-page .wsp-widget {
  bottom: max(148px, calc(var(--safe-bottom) + 140px));
}

.scroll-indicator {
  display: none;
}

.trust-bar {
  gap: 12px 20px;
  padding: 20px var(--gutter-inline) clamp(32px, 5vw, 48px);
  width: 100%;
}

/* --------------------------------------------------------------------------
   12. Utility: responsive tables wrapper (generic)
   -------------------------------------------------------------------------- */
.table-responsive,
[data-table-wrap] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   13. Breakpoint refinements (mobile-first escalation)
   -------------------------------------------------------------------------- */

/* ≥ 360px — small phones */
@media (min-width: 360px) {
  .hero-cinema__cta,
  .final-cta__actions,
  .activities__cta-actions {
    max-width: min(440px, 100%);
  }
}

/* ≥ 414px — large phones */
@media (min-width: 414px) {
  .planner-options--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contacts__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ≥ 480px — phablets */
@media (min-width: 480px) {
  .cart-item {
    grid-template-columns: 96px 1fr;
  }

  .cart-item__img {
    width: 96px;
    height: 72px;
    aspect-ratio: auto;
  }

  .hero-cinema__cta,
  .final-cta__actions,
  .activities__cta-actions,
  .tour-hero__cta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: none;
    width: auto;
  }

  .hero-cinema__cta .btn,
  .final-cta__actions .btn,
  .activities__cta-actions .btn,
  .tour-hero__cta .btn {
    width: auto;
    flex: 0 1 auto;
  }

  .act-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .why__grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tours-catalog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-contact-bar__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-form__nav {
    flex-direction: row;
    justify-content: flex-end;
  }

  .planner-form__nav .btn {
    width: auto;
  }
}

/* ≥ 768px — tablets */
@media (min-width: 768px) {
  :root {
    --section-pad: clamp(64px, 10vw, 140px);
  }

  .hero-search__grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-search__btn:not(.hero-search__btn--icon) {
    grid-column: 1 / -1;
  }

  .pie-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scroll-indicator {
    display: flex;
  }

  .lr-modal__dialog {
    width: min(920px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    border-radius: var(--radius-l, 26px);
  }

  .wum-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ≥ 820px — large tablets */
@media (min-width: 820px) {
  .hero-search__grid {
    grid-template-columns: 1.2fr 1fr 0.7fr 1fr auto;
  }

  .hero-search__btn:not(.hero-search__btn--icon) {
    grid-column: auto;
    width: auto;
  }

  .hero-search__btn {
    white-space: nowrap;
  }

  .tours-catalog__toolbar {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .tours-catalog__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ≥ 1024px — small desktop */
@media (min-width: 1024px) {
  .footer-contact-bar__inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tours-catalog__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contacts__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .why__grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ≥ 1280px — desktop */
@media (min-width: 1280px) {
  :root {
    --gutter-inline: clamp(24px, 3vw, 48px);
  }

  .tours-catalog__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .btn {
    white-space: nowrap;
  }
}

/* Landscape phones — reduce vertical hero padding */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-cinema {
    min-height: auto;
    padding-block: calc(var(--header-height) + 16px) 24px;
  }

  .hero-cinema__content {
    padding-top: calc(var(--header-height) + 8px);
    padding-bottom: 16px;
  }

  .hero-orb,
  .scroll-indicator {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cinema__video {
    animation: none !important;
    transform: scale(1.06) !important;
  }
}
