@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* --- CUSTOM TOKENS & RESET --- */
:root {
  --color-sand: #D9D3C7;
  --color-sand-light: #EFECE6;
  --color-sand-dark: #B8B0A2;
  --color-black: #000000;
  --color-white: #FFFFFF;
  --font-montserrat: 'Montserrat', sans-serif;

  /* Luxury Physics & Easing Tokens (ONA Lake Inspired) */
  --ease-ona: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-luxury: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-smooth-bounce: cubic-bezier(0.34, 1.25, 0.64, 1);
}

/* --- LENIS SMOOTH SCROLL INTEGRATION --- */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}


html {
  scroll-behavior: smooth;
  font-family: var(--font-montserrat);
  background-color: var(--color-black);
  color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h2 {
  line-height: 1.55;
  text-wrap: balance;
  -webkit-text-wrap: balance;
}

@media (max-width: 639px) {
  h2 {
    max-width: 88%;
    padding-right: 0.5rem;
    line-height: 1.42;
  }
}

/* Smooth anchor scrolling offset matching header height exactly so background is seamless */
section[id] {
  scroll-margin-top: 3.5rem;
}

@media (min-width: 640px) {
  section[id] {
    scroll-margin-top: 3.75rem;
  }
}

@media (min-width: 1024px) {
  section[id] {
    scroll-margin-top: 4rem;
  }
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #000000;
}
::-webkit-scrollbar-thumb {
  background: var(--color-sand);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-sand-dark);
}

/* --- ANIMATIONS & INTERSECTION OBSERVER REVEALS (MICRO-PHYSICS & CASINO/LUXURY EASING) --- */
/* Ultra-smooth general reveal with hardware acceleration & subtle micro-elevation */
.reveal {
  opacity: 0;
  transform: translate3d(0, 36px, 0) scale(0.985);
  transition: opacity 1.45s var(--ease-luxury), transform 1.45s var(--ease-luxury);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.reveal.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Image specific reveal with organic scale expansion */
.reveal-image {
  opacity: 0;
  transform: translate3d(0, 40px, 0) scale(0.96);
  transition: opacity 1.6s var(--ease-luxury), transform 1.6s var(--ease-luxury);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.reveal-image.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Directional reveals with subtle scale physics */
.reveal-left {
  opacity: 0;
  transform: translate3d(-40px, 0, 0) scale(0.98);
  transition: opacity 1.45s var(--ease-luxury), transform 1.45s var(--ease-luxury);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.reveal-left.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.reveal-right {
  opacity: 0;
  transform: translate3d(40px, 0, 0) scale(0.98);
  transition: opacity 1.45s var(--ease-luxury), transform 1.45s var(--ease-luxury);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.reveal-right.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Staggered Delay Utilities - Sequential Cascade Harmonic Timings (Pace ligeramente más pausado) */
.reveal-delay-1  { transition-delay: 0.12s; }
.reveal-delay-2  { transition-delay: 0.24s; }
.reveal-delay-3  { transition-delay: 0.36s; }
.reveal-delay-4  { transition-delay: 0.48s; }
.reveal-delay-5  { transition-delay: 0.60s; }
.reveal-delay-6  { transition-delay: 0.72s; }
.reveal-delay-7  { transition-delay: 0.84s; }
.reveal-delay-8  { transition-delay: 0.96s; }
.reveal-delay-9  { transition-delay: 1.08s; }
.reveal-delay-10 { transition-delay: 1.20s; }

/* Subtle luxury hover effects */
.hover-sand-border {
  transition: border-color 0.4s ease, color 0.4s ease;
}
.hover-sand-border:hover {
  border-color: var(--color-sand);
}

.bg-sand { background-color: var(--color-sand); }
.text-sand { color: var(--color-sand); }
.border-sand { border-color: var(--color-sand); }

/* --- NAV LINK ANIMATED UNDERLINE & ACTIVE STATE --- */
header nav a {
  position: relative;
}
header nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--color-sand);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
header nav a:hover::after,
header nav a.active::after {
  width: 100%;
}
header nav a.active {
  color: var(--color-sand);
}

.header-logo-full,
.header-logo-icon {
  position: absolute !important;
  top: 50% !important;
  left: 0 !important;
  max-height: 100%;
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: left center;
  transform-origin: left center;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.4s;
}

.header-logo-full {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  visibility: visible;
  display: block;
}

.header-logo-icon {
  transform: translateY(-50%) scale(0.85);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: block;
}

/* --- HEADER SMOOTH TRANSITION BASE --- */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  padding-top: 1.15rem;
  padding-bottom: 0.85rem;
  background-color: transparent;
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  #main-header {
    padding-top: 1.4rem;
    padding-bottom: 1rem;
  }
}

@media (min-width: 1024px) {
  #main-header {
    padding-top: 1.65rem;
    padding-bottom: 1.25rem;
  }
}

/* Background overlay gradient initially over video */
#main-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0) 100%);
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: -1;
}

#header-logo-link {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  height: 3.25rem;
  width: 7.06rem;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#header-logo-link:hover {
  transform: scale(1.04);
}

@media (min-width: 640px) {
  #header-logo-link {
    height: 3.85rem;
    width: 8.36rem;
  }
}

@media (min-width: 1024px) {
  #header-logo-link {
    height: 4.35rem;
    width: 9.45rem;
  }
}

/* --- HEADER SCROLLED STATE (FONDO BLANCO PLENO Y TODO EN NEGRO) --- */
#main-header.scrolled {
  background-color: #FFFFFF !important;
  box-shadow: none !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

@media (min-width: 640px) {
  #main-header.scrolled {
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
  }
}

@media (min-width: 1024px) {
  #main-header.scrolled {
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
  }
}

#main-header.scrolled::before {
  opacity: 0 !important;
}

#main-header.scrolled #header-logo-link {
  height: 2.45rem !important;
  width: 2.45rem !important;
}

@media (min-width: 640px) {
  #main-header.scrolled #header-logo-link {
    height: 2.75rem !important;
    width: 2.75rem !important;
  }
}

@media (min-width: 1024px) {
  #main-header.scrolled #header-logo-link {
    height: 3.0rem !important;
    width: 3.0rem !important;
  }
}

#main-header.scrolled .header-logo-full {
  opacity: 0 !important;
  transform: translateY(-50%) scale(0.85) !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#main-header.scrolled .header-logo-icon {
  opacity: 1 !important;
  transform: translateY(-50%) scale(1) !important;
  visibility: visible !important;
  pointer-events: auto !important;
  filter: none !important;
}

#main-header nav a,
#main-header .btn-contacto,
#main-header .btn-brochure,
#main-header #mobile-menu-toggle {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#main-header.scrolled nav a {
  color: #171717 !important;
  text-shadow: none !important;
}

#main-header.scrolled nav a:hover,
#main-header.scrolled nav a.active {
  color: #000000 !important;
}

#main-header.scrolled nav a::after {
  background-color: #000000 !important;
}

#mobile-menu nav a.active {
  color: var(--color-sand) !important;
}

#main-header.scrolled .btn-contacto {
  background-color: #000000 !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}

#main-header.scrolled .btn-contacto:hover {
  background-color: #262626 !important;
  color: #FFFFFF !important;
}

#main-header.scrolled .btn-brochure {
  border-color: #D4D4D4 !important;
  background-color: #F5F5F5 !important;
  color: #171717 !important;
}

#main-header.scrolled .btn-brochure:hover {
  background-color: #000000 !important;
  color: #FFFFFF !important;
  border-color: #000000 !important;
}

#main-header.scrolled #mobile-menu-toggle {
  color: #171717 !important;
}

/* --- DIALOG & MODAL STYLES --- */
/* --- GALLERY SLIDER PERFECT FLEX LAYOUT --- */
#gallery-slider-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

#gallery-slider-track {
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.gallery-slide {
  box-sizing: border-box !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  position: relative !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.gallery-slide img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

dialog[open] {
  animation: modalScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- FLOATING ACTIONS (WHATSAPP & BACK TO TOP) --- */
.whatsapp-float-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .whatsapp-float-container {
    bottom: 2rem;
    right: 2rem;
    gap: 0.625rem;
  }
  .whatsapp-btn-flat {
    width: 3.875rem; /* 62px (+10px) */
    height: 3.875rem;
  }
  .whatsapp-btn-flat svg {
    width: 1.75rem;
    height: 1.75rem;
  }
  .back-to-top-btn {
    width: 2.25rem; /* 36px on desktop */
    height: 2.25rem;
  }
}

.back-to-top-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem; /* 32px on mobile */
  height: 2rem;
  border-radius: 50%;
  background-color: rgba(20, 34, 26, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.85);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

.back-to-top-btn.is-visible {
  opacity: 0.65;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  opacity: 1;
  background-color: #588B70;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.back-to-top-btn:active {
  transform: translateY(0) scale(0.95);
}

.whatsapp-btn-flat {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background-color: #588B70;
  color: #FFFFFF;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.whatsapp-btn-flat:hover {
  background-color: #49785F;
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.whatsapp-btn-flat:active {
  transform: scale(0.96);
}

/* --- UBICACIÓN SECTION & MAP MARKER ANIMATIONS --- */
.ubicacion-map-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1190.55 / 841.89;
  overflow: hidden;
  border-radius: 0.25rem;
  background-color: rgba(217, 211, 199, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ubicacion-map-wrapper svg,
.ubicacion-map-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile SVG centering focus on location marker */
@media (max-width: 768px) {
  .ubicacion-map-wrapper {
    height: auto;
  }
}

/* Animated Map Pin Bounce & Pulsing Radar Beacon */
.map-pin-path {
  fill: #3c597d;
  transform-origin: 942.55px 126.5px;
  animation: pinBounce 2.2s infinite ease-in-out;
}

.map-pulse-ring {
  fill: none;
  stroke: #3c597d;
  stroke-width: 2px;
  transform-origin: 942.55px 126.5px;
  opacity: 0;
  animation: mapPulse 2.6s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.ring-delay-1 {
  animation-delay: 0s;
}

.ring-delay-2 {
  animation-delay: 1.3s;
}

@keyframes pinBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes mapPulse {
  0% {
    transform: scale(0.4);
    opacity: 0.85;
    stroke-width: 3.5px;
  }
  100% {
    transform: scale(3.8);
    opacity: 0;
    stroke-width: 0.5px;
  }
}

/* Floating Cursor-Following Button for Google Maps */
.map-cursor-btn {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.88);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.map-cursor-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.ubicacion-map-wrapper:hover .map-cursor-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 768px) {
  .map-cursor-btn {
    display: none !important;
  }
}

/* Floating Cursor-Following Button for Gallery Slider */
.gallery-cursor-btn {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.88);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  pointer-events: none !important;
}

#gallery-slider-viewport:hover .gallery-cursor-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 768px) {
  .gallery-cursor-btn {
    display: none !important;
  }
}

/* --- MOBILE PARALLAX FULL IMAGE HEIGHT (100% VISIBLE, SIN RECORTES) --- */
@media (max-width: 639px) {
  #rutina-banner {
    height: auto !important;
    min-height: 280px !important;
    max-height: none !important;
    aspect-ratio: 16 / 10 !important;
  }

  #parallax-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    transform: none !important;
  }

  #parallax-bg img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  [id$="-parallax-container"] {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    position: relative !important;
  }

  [id$="-parallax-img"] {
    position: relative !important;
    inset: auto !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    transform: none !important;
  }
}

/* --- TEXT CLIP REVEAL ANIMATIONS (VERTICAL MASK CLIP) --- */
.txt-clip-wrapper {
  overflow: hidden;
  display: inline-block;
  vertical-align: bottom;
}

.txt-clip-anim {
  display: inline-block;
  transform: translate3d(0, 115%, 0);
  opacity: 0;
  transition: transform 1.25s var(--ease-ona), opacity 1.25s var(--ease-ona);
  will-change: transform, opacity;
}

.txt-clip-wrapper.active .txt-clip-anim,
.reveal.active .txt-clip-anim,
.active .txt-clip-anim {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* --- FRAMED RENDER HOVER ZOOM & SMOOTH PHYSICAL CLIP --- */
[id$="-parallax-container"] {
  transition: transform 0.8s var(--ease-ona), box-shadow 0.8s var(--ease-ona);
}

[id$="-parallax-container"]:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

/* --- FILM GRAIN TEXTURE OVERLAY --- */
.film-grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- MINIMALIST SCROLL INDICATOR --- */
.scroll-indicator-line {
  position: relative;
  width: 1px;
  height: 44px;
  background: rgba(217, 211, 199, 0.2);
  overflow: hidden;
  border-radius: 1px;
}
.scroll-indicator-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: #D9D3C7;
  animation: scrollLineSweep 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes scrollLineSweep {
  0% {
    transform: translateY(-100%);
  }
  50%, 100% {
    transform: translateY(200%);
  }
}

/* --- CONTACT INPUT FOCUS UNDERLINE ANIMATION --- */
.input-focus-group {
  position: relative;
}
.input-focus-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #000000;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.5s var(--ease-luxury);
  pointer-events: none;
}
.input-focus-group:focus-within .input-focus-line {
  transform: scaleX(1);
}

/* --- LIGHTBOX MODAL FULLSCREEN --- */
.lightbox-modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-luxury), visibility 0.4s var(--ease-luxury);
}
.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-img-container {
  transform: scale(0.95);
  transition: transform 0.4s var(--ease-luxury);
}
.lightbox-modal.active .lightbox-img-container {
  transform: scale(1);
}


