/*
 * Yalowi — capa de dinamismo
 * Mejora progresiva sobre el HTML exportado por Nicepage.
 * Sin JS o con "reducir movimiento" activado, la web se ve igual que antes.
 * Se usan las propiedades `translate` y `scale` (no `transform`) para no pisar
 * las transformaciones que ya aplica nicepage.css.
 */

:root {
  --yd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --yd-duration: 0.8s;
  --yd-distance: 28px;
  --yd-accent: #f1c50e;
  --yd-dark: #1f2a24;
}

/* ---------- Aparición al hacer scroll ---------- */
.yd-js .yd-reveal {
  opacity: 0;
  translate: 0 var(--yd-distance);
  transition:
    opacity var(--yd-duration) var(--yd-ease),
    translate var(--yd-duration) var(--yd-ease),
    box-shadow 0.35s var(--yd-ease);
  transition-delay: var(--yd-delay, 0s);
}

.yd-js .yd-reveal.yd-visible {
  opacity: 1;
  translate: none;
}

/* Una vez visible, el retardo escalonado no debe frenar el hover */
.yd-js .yd-reveal.yd-done { transition-delay: 0s; }

/* ---------- Hero: zoom lento del fondo ---------- */
.yd-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.yd-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: inherit;
  /* Capa propia en GPU: escala el bitmap ya pintado en vez de repintarlo
     en cada fotograma (repintar con redondeo de píxel es lo que "tiembla") */
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0) scale(1);
  animation: yd-kenburns 20s cubic-bezier(0.25, 0.1, 0.25, 1) both;
  pointer-events: none;
}

/* Empieza en escala 1: si el JS llega tarde, no hay salto visual */
@keyframes yd-kenburns {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, 0, 0) scale(1.06); }
}

/* ---------- Tarjetas con imagen ---------- */
.yd-card {
  transition:
    translate 0.35s var(--yd-ease),
    box-shadow 0.35s var(--yd-ease),
    opacity var(--yd-duration) var(--yd-ease);
}

.yd-js .yd-card.yd-done {
  transition:
    translate 0.35s var(--yd-ease),
    box-shadow 0.35s var(--yd-ease);
}

.yd-card img.u-image {
  transition: scale 0.6s var(--yd-ease), filter 0.6s var(--yd-ease);
}

@media (hover: hover) {
  .yd-card.yd-done:hover,
  .yd-card:not(.yd-reveal):hover {
    translate: 0 -6px;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.35);
  }

  .yd-card:hover img.u-image {
    scale: 1.03;
    filter: saturate(1.1);
  }

  /* Botones de perfil hechos con imagen enlazada */
  img[data-href] {
    transition: scale 0.3s var(--yd-ease), filter 0.3s var(--yd-ease);
    cursor: pointer;
  }

  img[data-href]:hover {
    scale: 1.05;
    filter: brightness(1.06);
  }
}

/* ---------- Botones ---------- */
.u-btn.u-button-style:not(.u-button-link) {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    translate 0.25s var(--yd-ease),
    box-shadow 0.25s var(--yd-ease);
}

@media (hover: hover) {
  .u-btn.u-button-style:not(.u-button-link):hover {
    translate: 0 -2px;
    box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.45);
  }
}

/* Foco visible y consistente para navegación con teclado */
a:focus-visible,
button:focus-visible,
.u-btn:focus-visible {
  outline: 2px solid var(--yd-accent);
  outline-offset: 3px;
}

/* ---------- Cabecera: sombra al hacer scroll ---------- */
.u-header { transition: box-shadow 0.3s ease; }

.yd-scrolled .u-header.u-sticky {
  box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.35);
}

/* ---------- CTA del hero (portada) ---------- */
.yd-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: -30px 0 60px; /* el párrafo anterior ya deja 60px de margen inferior */
}

.yd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    translate 0.25s var(--yd-ease),
    box-shadow 0.25s var(--yd-ease);
}

.yd-btn-primary {
  background: var(--yd-accent);
  color: #111;
}

.yd-btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
}

@media (hover: hover) {
  .yd-btn:hover { translate: 0 -2px; }
  .yd-btn-primary:hover { background: #ffd633; color: #111; box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.6); }
  .yd-btn-ghost:hover { background: #fff; color: #111; }
}

/* En móvil, ancho natural: así el botón flotante de WhatsApp (abajo a la derecha) no los tapa */
@media (max-width: 575px) {
  .yd-hero-cta { margin-top: -20px; gap: 12px; }
  .yd-btn { min-height: 46px; padding: 0 22px; }
}

/* ---------- Pie de página ---------- */
/* Nicepage reservaba altura para los teléfonos de relleno ya eliminados */
body .u-footer,
body .u-footer .u-layout-cell,
body .u-footer .u-container-layout { min-height: 0; }

body .u-footer { padding-bottom: 32px; }

/* Enlaces legales en una sola línea: las tres columnas quedan a la misma altura */
body .u-footer :is(.u-text-11, .u-text-12, .u-text-13) { display: inline-block; font-size: 0.9375rem; margin: 22px 22px 0 0; }
body .u-footer .u-text-13 { margin-right: 0; }
@media (max-width: 575px) {
  body .u-footer :is(.u-text-11, .u-text-12, .u-text-13) { display: block; margin: 12px 0 0; }
}

/* Copyright: discreto y centrado bajo la línea */
body .u-footer .u-text-14 { font-size: 0.8125rem; margin: 24px auto 0; opacity: 0.75; }

/* ---------- Botón flotante de WhatsApp ---------- */
/* El "volver arriba" de Nicepage ocupa de 20px a 84px desde abajo: dejamos 16px de aire */
body .whatsapp-btn { bottom: 100px; }

/* Icono de WhatsApp (SVG en línea, sustituye a Bootstrap Icons) */
.whatsapp-btn .yd-wa-icon { display: inline-flex; line-height: 0; }
.whatsapp-btn .yd-wa-icon svg { width: 24px; height: 24px; fill: #fff; }

/* ---------- «Costa Rica» destacado en el texto ---------- */
/* Tipografía de contraste (Playfair Display, OFL), autoalojada: solo cursiva 700 y caracteres latinos */
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/playfair-display-700-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

body strong.yd-cr {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  color: inherit;
  letter-spacing: 0.005em;
}

/* En las cabeceras con foto oscurecida (el Hero), además en el amarillo de la marca */
body .u-shading strong.yd-cr,
body .yh-section--green strong.yd-cr {
  color: var(--yd-accent);
}

/* ---------- Scroll suave para anclas ---------- */
html { scroll-behavior: smooth; }

/* ---------- Accesibilidad e impresión ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .yd-js .yd-reveal,
  .yd-hero-bg,
  .yd-card,
  .yd-card img.u-image,
  img[data-href],
  .u-btn {
    opacity: 1 !important;
    translate: none !important;
    scale: none !important;
    animation: none !important;
    transition: none !important;
  }

  .yd-hero-bg {
    transform: none !important;
    will-change: auto;
  }
}

@media print {
  .yd-js .yd-reveal { opacity: 1 !important; translate: none !important; }
}

@media (max-width: 767px) {
  :root { --yd-distance: 18px; }
}

/* ---------- CTA: halo verde (hover, teclado y pulsación táctil) ----------
 * Solo botones de reserva, contacto, envío, información y acceso a secciones.
 * :is() iguala la especificidad para ganar a los :hover propios de cada botón
 * sin tocar su tamaño, tipografía ni geometría.
 */
:root {
  --cta-glow: 145, 198, 76; /* #91C64C, verde hierba */
}

body :is(
  .u-btn.u-button-style:not(.u-none):not(.u-button-link):not(.u-upload-button),
  .yd-btn, .yh-btn, .yb-btn, .whatsapp-btn, a.btn, a.pill
) {
  --cta-ring: 0 0 #0000;
  transition-property: box-shadow, background-color, color, border-color, translate, transform;
  transition-duration: 0.3s;
  transition-timing-function: ease;
  -webkit-tap-highlight-color: transparent;
}

/* Botones de contorno: su borde es una sombra interior y debe mantenerse en foco y pulsación */
body :is(.yh-btn--outline, a.btn.btn-ghost) {
  --cta-ring: inset 0 0 0 2px currentColor;
}

@media (hover: hover) {
  body :is(
    .u-btn.u-button-style:not(.u-none):not(.u-button-link):not(.u-upload-button),
    .yd-btn, .yh-btn, .yb-btn, .whatsapp-btn, a.btn, a.pill
  ):hover:not(:disabled) {
    box-shadow: 0 0 30px rgba(var(--cta-glow), 0.85);
  }
}

body :is(
  .u-btn.u-button-style:not(.u-none):not(.u-button-link):not(.u-upload-button),
  .yd-btn, .yh-btn, .yb-btn, .whatsapp-btn, a.btn, a.pill
):focus-visible {
  outline: 2px solid rgb(var(--cta-glow));
  outline-offset: 4px;
  box-shadow: var(--cta-ring), 0 0 30px rgba(var(--cta-glow), 0.85);
}

/* Al pulsar (también en móvil) el halo aparece al instante y se desvanece en 300 ms al soltar */
body :is(
  .u-btn.u-button-style:not(.u-none):not(.u-button-link):not(.u-upload-button),
  .yd-btn, .yh-btn, .yb-btn, .whatsapp-btn, a.btn, a.pill
):active:not(:disabled) {
  box-shadow: var(--cta-ring), 0 0 15px rgba(var(--cta-glow), 0.7);
  transition-duration: 0s;
}

@media (prefers-reduced-motion: reduce) {
  body :is(
    .u-btn.u-button-style:not(.u-none):not(.u-button-link):not(.u-upload-button),
    .yd-btn, .yh-btn, .yb-btn, .whatsapp-btn, a.btn, a.pill
  ) {
    transition: none;
  }
}
