/* ==========================================================================
   Marble Patagonia — Design Tokens & CSS Global
   Paleta oficial (ver brand manual): forest / chilco / glacier / paper
   ========================================================================== */

:root {
  --color-paper:       #FDFBF7; /* Blanco Mármol */
  --color-forest:      #1E3231; /* Verde Coigüe — base institucional / texto */
  --color-glacier:     #2C8C82; /* Turquesa Glaciar — acciones & botones */
  --color-chilco:      #C75B7A; /* Rosa Chilco — acento floral / calidez */
  --color-stone-light: #F5F4F0; /* Fondo de tarjetas */
  --color-whatsapp:    #25D366;
  --color-whatsapp-hover: #20ba58;
}

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body { background-color: var(--color-paper); color: var(--color-forest); }
img, video { display: block; max-width: 100%; }

/* Navegación tipo SPA: todas las "páginas" viven en el mismo index.html,
   el router de main.js decide cuál mostrar según location.pathname. */
.tab-content { display: none; }
.tab-content.active { display: block; }

.noise {
  position: fixed; inset: 0; z-index: -10; pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Acento tipográfico degradé — reservado para highlights dentro de titulares (nunca para botones) */
.accent-text {
  background: linear-gradient(135deg, #A84766 0%, #E08BA6 45%, #C75B7A 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.f-hero    { font-size: clamp(2.4rem, 6vw + 1rem, 5.5rem); line-height: 1.0; }
.f-section { font-size: clamp(1.9rem, 3.5vw + 0.5rem, 3rem); line-height: 1.1; }
.f-sub     { font-size: clamp(1.4rem, 2vw + 0.4rem, 2rem); line-height: 1.2; }
.f-stat    { font-size: clamp(3.5rem, 7vw, 5.5rem); line-height: 1; }

.card-lift { transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s cubic-bezier(0.16,1,0.3,1); }
.card-lift:hover { transform: translateY(-6px); box-shadow: 0 24px 60px -12px rgba(0,0,0,0.13); }

details summary { list-style: none; cursor: pointer; user-select: none; }
details summary::-webkit-details-marker { display: none; }
.faq-icon { transition: transform 0.22s ease; }
details[open] .faq-icon { transform: rotate(45deg); }
details[open] > summary { color: var(--color-glacier); }
details > p { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding-top 0.2s ease; }
details[open] > p { max-height: 300px; padding-top: 1rem; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }
.a1 { animation: fadeUp 1s cubic-bezier(0.16,1,0.3,1) both; }
.a2 { animation: fadeUp 1s 0.15s cubic-bezier(0.16,1,0.3,1) both; }
.a3 { animation: fadeUp 1s 0.28s cubic-bezier(0.16,1,0.3,1) both; }
.a4 { animation: fadeUp 1s 0.4s cubic-bezier(0.16,1,0.3,1) both; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

#main-nav { transition: background-color 0.3s ease, box-shadow 0.3s ease; }
#main-nav.scrolled { background-color: rgba(255,255,255,0.98) !important; box-shadow: 0 2px 20px rgba(0,0,0,0.08); }

@keyframes pulse-ring { 0%,100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.4); opacity: 0; } }
.pulse-dot::after { content: ''; position: absolute; inset: 0; border-radius: 9999px; background: var(--color-glacier); animation: pulse-ring 2.2s ease-in-out infinite; }
.pulse-dot { position: relative; display: inline-block; }

#sticky-cta { transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1); }
#sticky-cta.visible { transform: translateY(0); }

#progress-bar { position: fixed; top: 0; left: 0; height: 2px; z-index: 200; background: linear-gradient(90deg, var(--color-glacier), var(--color-chilco)); width: 0%; transition: width 0.1s linear; }

.testimonial-border { border-left: 3px solid var(--color-glacier); }

@keyframes bounce-slow { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
.bounce-slow { animation: bounce-slow 2.4s ease-in-out infinite; }

/* Versión blanca del logo sobre fondos oscuros (footer). El PNG de marca viene en
   tinta oscura sobre transparente: brightness(0) lo aplana a negro puro y invert(1)
   lo pasa a blanco, conservando el canal alfa. Evita tener que mantener un segundo
   archivo de logo solo para fondos oscuros. */
.logo-white { filter: brightness(0) invert(1); }

/* Menú mobile: los links del nav viven ocultos bajo el breakpoint md y se despliegan
   desde el botón hamburguesa. */
#mobile-menu.open { display: block; }

/* Altura mínima de toque cómoda con el pulgar (guía de accesibilidad: 44px).
   Aplica a los selects y al botón del buscador, que en mobile son el control
   principal de la página. */
.touch-target { min-height: 44px; }

/* ==========================================================================
   Retoques estéticos (18-11-2026) · sacados de docs/marca, no inventados.
   - Idea de marca: el isotipo es una línea de montaña que baja como un CAMINO y
     termina en la flor del chilco. La miscelánea del sitio es ese gesto: una ruta
     segmentada (como la de navegación en los mapas, manual 3.0) que termina en un
     punto chilco (el hito). El logo no se toca ni se usa de adorno: el isotipo es
     solo para avatar, favicon y sello (marca.md), y se evitan los «círculos
     decorativos automáticos» (manual 3.0).
   - Misceláneas editoriales que pide la marca (02-componentes): separadores,
     folios y etiquetas de dato, que suman jerarquía y no adornan.
   - Fondos: Blanco Mármol con la luz del agua (glaciar); el chilco solo señala.
   - «Cálida en el trato, precisa en los datos»: los datos van como ficha en mono.
   Solo capas en esta hoja: no cambia textos, estructura ni colores de marca.
   ========================================================================== */

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --shadow-forest: 0 18px 44px -20px rgba(30, 50, 49, 0.28);
  --ruta: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px);
}

/* 1. Fondo: la luz del lago cae desde arriba (glaciar), con un toque cálido muy
   bajo a la derecha. No es fija, para que en el celular no tironee. */
body { position: relative; }
body::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: min(1100px, 100vh + 300px);
  z-index: -5; pointer-events: none;
  background:
    radial-gradient(70% 60% at 10% 0%, rgba(44, 140, 130, 0.20), transparent 70%),
    radial-gradient(50% 45% at 95% 4%, rgba(44, 140, 130, 0.08), transparent 70%);
}
@media (max-width: 639px) {
  body::before { background: radial-gradient(110% 45% at 0% 0%, rgba(44, 140, 130, 0.24), transparent 72%); }
}

/* Cada bloque sin fondo propio recibe un reflejo de agua, alternando de lado, que
   se apaga antes de los bordes (closest-side: sin cortes rectos). */
.tab-content > section:not([class*="bg-"]) { position: relative; isolation: isolate; }
.tab-content > section:not([class*="bg-"])::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none; inset: -40px -6vw -20px -6vw;
  background: radial-gradient(ellipse closest-side at 78% 35%, rgba(44, 140, 130, 0.13), transparent);
}
.tab-content > section:not([class*="bg-"]):nth-of-type(even)::before {
  background: radial-gradient(ellipse closest-side at 22% 35%, rgba(44, 140, 130, 0.10), transparent);
}

/* Piedra clara: de piedra a blanco mármol, con luz de agua en una esquina. */
section.bg-stone-light {
  background-image:
    radial-gradient(60% 80% at 100% 0%, rgba(44, 140, 130, 0.12), transparent 100%),
    linear-gradient(180deg, #F5F4F0 0%, #FAF8F4 100%);
  border-color: rgba(30, 50, 49, 0.08);
}

/* Verde Coigüe: profundidad de lago (más claro arriba, luz glaciar en la esquina). */
/* Sin rosa en los degradés (Camilo, 18-11): la luz es solo agua (glaciar). */
section.bg-forest, footer.bg-forest {
  position: relative; isolation: isolate;
  background-image:
    radial-gradient(70% 90% at 100% 0%, rgba(44, 140, 130, 0.30), transparent 62%),
    linear-gradient(180deg, #223938 0%, #1E3231 55%, #182928 100%);
}

/* 2. La ruta: el filete de cada eyebrow pasa de línea plana a tramo segmentado
   que termina en un punto chilco, como el camino del isotipo. */
.w-6.h-px {
  position: relative; width: 2rem; height: 1px; color: var(--color-glacier); flex-shrink: 0; margin-right: 2px;
  background: var(--ruta) !important; opacity: 1;
}
.w-6.h-px.bg-chilco\/50 { color: var(--color-chilco); }
.w-6.h-px.bg-paper\/50  { color: rgba(253, 251, 247, 0.7); }
.w-6.h-px::after {
  content: ''; position: absolute; right: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--color-chilco);
}

/* 3. Folios: cada encabezado de sección de una página lleva su número en mono
   (01, 02…), como las paradas de una ruta. El del hero no cuenta. */
.tab-content { counter-reset: folio; }
.tab-content > section:not(:first-child) .flex.items-center.gap-3:has(> .w-6.h-px),
.tab-content > section:first-child:not(:has(#hero-bg-img)) .flex.items-center.gap-3:has(> .w-6.h-px) { counter-increment: folio; }
.tab-content > section:not(:first-child) .flex.items-center.gap-3:has(> .w-6.h-px)::before,
.tab-content > section:first-child:not(:has(#hero-bg-img)) .flex.items-center.gap-3:has(> .w-6.h-px)::before {
  content: counter(folio, decimal-leading-zero);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: .08em;
  color: rgba(30, 50, 49, 0.5); margin-right: 2px;
}

/* 4. Pie: la ruta cruza el borde superior y termina en el hito chilco. */
footer.bg-forest::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; color: rgba(44, 140, 130, 0.8);
  background: var(--ruta);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

/* 5. Ficha de datos de cada tour (precisa en los datos): duración, grupo y
   exigencia como etiquetas en mono bajo un tramo de ruta, un punto más
   grandes y en Coigüe para que se lean. */
.card-lift .font-mono.border-t {
  border-top: 0 !important; padding-top: 14px; position: relative;
  font-size: 11px !important; color: rgba(30, 50, 49, 0.78) !important; gap: 6px 14px !important;
}
.card-lift .font-mono.border-t::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; color: rgba(30, 50, 49, 0.22);
  background: var(--ruta);
}

/* 6. Tarjetas: sombra teñida de Coigüe (la gris se ve sucia sobre blanco mármol).
   Hover solo con mouse; en pantallas táctiles no se levantan al tocar. */
.card-lift { box-shadow: 0 1px 2px rgba(30, 50, 49, 0.04), var(--shadow-forest); }
@media (hover: hover) and (pointer: fine) {
  .card-lift:hover { box-shadow: 0 26px 60px -22px rgba(30, 50, 49, 0.35); }
}
@media (hover: none) { .card-lift:hover { transform: none; } }

/* 7. Botones primarios: brillo suave arriba (sigue valiendo el hover a chilco) y
   que se hundan al presionar (160 ms, kit 08). */
a.bg-glacier, button.bg-glacier {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px -8px rgba(44, 140, 130, 0.55);
}
a.bg-glacier:active, button.bg-glacier:active { transform: scale(0.97); transition-duration: 0.16s; }

/* 8. Hero legible sobre cualquier foto: velo de Coigüe que baja desde arriba (más
   liviano que antes para no apagar el mármol), sombra suave en el texto y el acento
   en un rosa más claro de la misma familia, solo aquí. */
.reveal:has(> #hero-bg-img)::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(20, 38, 37, 0.50) 0%, rgba(20, 38, 37, 0.28) 42%, rgba(20, 38, 37, 0) 68%);
}
#hero-title-line1, #hero-subtitle { text-shadow: 0 1px 14px rgba(15, 30, 29, 0.45); }
#hero-title-accent {
  background-image: linear-gradient(135deg, #EDA6BD 0%, #F6C9D8 50%, #E48CAA 100%);
  filter: drop-shadow(0 1px 10px rgba(15, 30, 29, 0.5));
}
#hero-search-widget { box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.8); }

/* 9. Franja de confianza en el celular: 13 px y margen para el botón de WhatsApp. */
@media (max-width: 639px) {
  #hero-trust-bar { gap: 6px 14px; padding-right: 3.25rem; }
  #hero-trust-bar > * { font-size: 13px !important; line-height: 1.5; color: rgba(30, 50, 49, 0.85); }
}

/* 10. Accesibilidad: foco visible y movimiento reducido. */
:focus-visible { outline: 2px solid var(--color-glacier); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .a1, .a2, .a3, .a4 { transition-duration: 0.01s !important; animation-duration: 0.01s !important; transform: none !important; }
  .bounce-slow, .pulse-dot::after { animation: none; }
}

/* 11. Misceláneas de chilco y mármol (Camilo, 18-11: «que hagan referencia sutil al
   chilco y al mármol»). Un gesto por bloque, nunca como estampado:
   - Mármol: vetas finas (textura vectorial, no foto) sobre los bloques de piedra
     clara y, en Blanco Mármol, sobre los verdes. Opacidad baja: se intuyen.
   - Chilco: el grabado botánico de docs/marca (media/01 y 02, recoloreado en un solo
     tono con máscara). La flor cuelga desde arriba en los bloques verdes y en el pie,
     como la del isotipo; la rama asoma en una esquina de la piedra clara.
     Archivos livianos para 3G: chilco-flor-trazo.webp 13 KB, chilco-rama-trazo.webp 30 KB. */
section.bg-stone-light { position: relative; isolation: isolate; overflow: hidden; }
section.bg-stone-light::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800'%3E%3Cfilter id='m' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0011 0.0042' numOctaves='3' seed='11'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.118 0 0 0 0 0.196 0 0 0 0 0.192 1.6 0 0 0 -0.3'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 1 .5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Cg transform='rotate%28-28 600 400%29'%3E%3Crect x='-400' y='-400' width='2000' height='1600' filter='url%28%23m%29' opacity='1'/%3E%3C/g%3E%3C/svg%3E") center / 1200px 800px; opacity: 0.09;
}
section.bg-stone-light::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  right: -40px; bottom: -50px; width: 260px; aspect-ratio: 360 / 403;
  background: var(--color-forest); opacity: 0.07;
  -webkit-mask: url('/media/chilco-rama-trazo.webp') center / contain no-repeat;
          mask: url('/media/chilco-rama-trazo.webp') center / contain no-repeat;
  transform: rotate(-8deg);
}
section.bg-forest::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800'%3E%3Cfilter id='m' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0011 0.0042' numOctaves='3' seed='23'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.99 0 0 0 0 0.98 0 0 0 0 0.97 1.6 0 0 0 -0.3'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 1 .5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Cg transform='rotate%28-28 600 400%29'%3E%3Crect x='-400' y='-400' width='2000' height='1600' filter='url%28%23m%29' opacity='1'/%3E%3C/g%3E%3C/svg%3E") center / 1200px 800px; opacity: 0.06;
}
section.bg-forest { overflow: hidden; }
section.bg-forest::after, footer.bg-forest::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: -6px; right: 5%; width: 150px; aspect-ratio: 300 / 357;
  background: var(--color-chilco); opacity: 0.38;
  -webkit-mask: url('/media/chilco-flor-trazo.webp') center / contain no-repeat;
          mask: url('/media/chilco-flor-trazo.webp') center / contain no-repeat;
}
footer.bg-forest::after { top: 0; right: 4%; width: 110px; opacity: 0.30; }
@media (max-width: 767px) {
  section.bg-forest::after { width: 92px; right: 4%; opacity: 0.30; }
  footer.bg-forest::after, section.bg-stone-light::after { display: none; }
}
/* En escritorio la flor cuelga entre el texto y las tarjetas, donde no la tapan. */
@media (min-width: 768px) {
  section.bg-forest::after { right: auto; left: 55%; width: 90px; transform: translateX(-50%); }
}
