/* ==========================================================
   COSMOPOLITAN — capa de diseño y animaciones (web_new)
   Se carga DESPUÉS de cosmostyle.css: mantiene la identidad actual
   (negro, gris, azul #004C97, Montserrat + Raleway) y la mejora.
   ========================================================== */
:root {
  --blue: #004C97; --blue-d: #003a73; --blue-l: #1f74c8;
  --ink: #111; --grey: #bebebe; --grey-l: #f2f3f5;
  --ease: cubic-bezier(.22, .61, .36, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 76px;
}
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; animation: pageIn .6s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
::selection { background: var(--blue); color: #fff; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue-l); outline-offset: 3px; border-radius: 3px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 3000; background: #fff; color: var(--blue); padding: 10px 16px; border-radius: 6px; font-weight: 700; }
.skip-link:focus { left: 12px; }

/* ---------- Barra de progreso de lectura ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--blue), var(--blue-l)); z-index: 2000; pointer-events: none; }

/* ---------- Menú ---------- */
.navbar {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; padding: .55rem 0;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px);
  transition: padding .35s var(--ease), box-shadow .35s var(--ease), transform .45s var(--ease-out), background .35s;
  animation: navIn .9s var(--ease-out) both;
}
@keyframes navIn { from { transform: translateY(-100%); } to { transform: none; } }
.navbar.is-scrolled { padding: .2rem 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .10); }
.navbar.is-hidden { transform: translateY(-110%); }
.navbar-brand img { width: min(350px, 62vw); height: auto; transition: width .35s var(--ease); display: block; }
.navbar.is-scrolled .navbar-brand img { width: min(270px, 55vw); }
.nav-link { letter-spacing: .06em; transition: color .25s; }
.nav-link.active { color: var(--blue) !important; }
.nav-link.active::after { width: 100%; }
.navbar-toggler { border: 0; box-shadow: none !important; padding: .4rem .6rem; }
@media (max-width: 991px) {
  .navbar-collapse { border-radius: 0 0 14px 14px; }
  .navbar-collapse.collapsing { transition: height .35s var(--ease); }
  .navbar-nav .nav-item { opacity: 0; transform: translateY(-8px); }
  .navbar-collapse.show .nav-item { animation: itemIn .45s var(--ease-out) forwards; }
  .navbar-collapse.show .nav-item:nth-child(2) { animation-delay: .04s; } .navbar-collapse.show .nav-item:nth-child(3) { animation-delay: .08s; }
  .navbar-collapse.show .nav-item:nth-child(4) { animation-delay: .12s; } .navbar-collapse.show .nav-item:nth-child(5) { animation-delay: .16s; }
  .navbar-collapse.show .nav-item:nth-child(6) { animation-delay: .2s; } .navbar-collapse.show .nav-item:nth-child(7) { animation-delay: .24s; }
}
@keyframes itemIn { to { opacity: 1; transform: none; } }
.dropdown-menu { animation: dropIn .22s var(--ease-out); }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } }
.nav-item.dropdown:hover .dropdown-menu, .dropdown-menu.show { display: block; }

/* ---------- Revelado al hacer scroll (sustituye a AOS) ---------- */
.js [data-reveal] { opacity: 0; transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0s); will-change: opacity, transform; }
.js [data-reveal="up"], .js [data-reveal=""] { transform: translate3d(0, 38px, 0); }
.js [data-reveal="down"] { transform: translate3d(0, -38px, 0); }
.js [data-reveal="left"] { transform: translate3d(48px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(-48px, 0, 0); }
.js [data-reveal="zoom"] { transform: scale(.92); }
.js [data-reveal="blur"] { filter: blur(10px); transform: scale(1.02); }
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; filter: none !important; }
  body, .navbar { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Portada: vídeo ---------- */
.video-container { isolation: isolate; }
.video-container::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, .45) 100%); pointer-events: none; z-index: 1; }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2; width: 28px; height: 46px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 20px; display: block; }
.scroll-cue::before { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 9px; margin-left: -2px; border-radius: 3px; background: #fff; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }
.video-wrapper video { transform: scale(1.04); transition: transform 8s linear; }
.video-container:hover .video-wrapper video { transform: scale(1.08); }

/* ---------- Cabeceras de sección (hero con imagen) ---------- */
.hero-section .hero-image { transform: scale(1.12); animation: kenburns 18s ease-in-out infinite alternate; will-change: transform; }
@keyframes kenburns { to { transform: scale(1.02) translate3d(0, -1.5%, 0); } }
.hero-section .content-wrapper > * { animation: heroIn 1s var(--ease-out) both; }
.hero-section .content-wrapper > *:nth-child(2) { animation-delay: .15s; } .hero-section .content-wrapper > *:nth-child(3) { animation-delay: .3s; } .hero-section .content-wrapper > *:nth-child(4) { animation-delay: .45s; }
@keyframes heroIn { from { opacity: 0; transform: translate3d(0, 28px, 0); } }
.hero-section .overlay { background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .45)); }

/* ---------- Titulares ---------- */
h1.cm-font-montserrat, h2.cm-font-montserrat { letter-spacing: -.01em; }
.section-rule { display: block; width: 64px; height: 4px; border-radius: 2px; background: var(--blue); margin: 14px auto 0; transform-origin: 0 50%; }

/* ---------- Botones ---------- */
.cm-btn { box-shadow: 0 2px 0 rgba(0, 0, 0, .08); transition: color .4s, border-color .4s, transform .3s var(--ease), box-shadow .3s; }
.cm-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 76, 151, .28); }
.cm-btn:active { transform: translateY(0); }
.btn-outline-light.cm-btn { border-color: transparent; }

/* ---------- Tarjetas e imágenes ---------- */
.card { border-radius: 12px; overflow: hidden; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0, 0, 0, .16); }
.card .card-img-top { transition: transform .8s var(--ease); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.card:hover .card-img-top { transform: scale(1.06); }
.img-zoom { transition: transform .7s var(--ease), box-shadow .5s; border-radius: 10px; }
.img-zoom:hover { transform: scale(1.03); }
.card-hover img, .custom-section img { transition: transform .8s var(--ease); }
.list-group-item { transition: background .25s, padding-left .25s var(--ease); }
.list-group-item:hover { padding-left: 1.4rem; }

/* ---------- Servicios (amenities) ---------- */
.amenity { transition: transform .4s var(--ease); }
.amenity i, .amenity svg { transition: transform .45s var(--ease-out), color .3s; }
.amenity:hover { transform: translateY(-6px); }
.amenity:hover i { transform: scale(1.18) rotate(-4deg); color: var(--blue-l); }

/* ---------- Galería + visor ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 10px 0; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; border-radius: 8px; transition: transform .5s var(--ease), filter .4s, box-shadow .4s; }
.gallery img:hover { transform: scale(1.03); filter: brightness(1.08); box-shadow: 0 12px 28px rgba(0, 0, 0, .25); position: relative; z-index: 2; }
.lb { position: fixed; inset: 0; z-index: 4000; background: rgba(5, 8, 14, .94); display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; }
.lb.is-open { display: flex; opacity: 1; }
.lb img { max-width: 92vw; max-height: 86vh; border-radius: 6px; box-shadow: 0 20px 80px rgba(0, 0, 0, .6); animation: lbIn .35s var(--ease-out); user-select: none; }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } }
.lb button { position: absolute; background: rgba(255, 255, 255, .1); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; cursor: pointer; transition: background .2s, transform .2s; display: grid; place-items: center; }
.lb button:hover { background: rgba(255, 255, 255, .25); transform: scale(1.08); }
.lb .lb-x { top: 18px; right: 18px; } .lb .lb-p { left: 18px; top: 50%; margin-top: -24px; } .lb .lb-n { right: 18px; top: 50%; margin-top: -24px; }
.lb .lb-c { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #cfd6e2; font: 600 13px Montserrat, sans-serif; letter-spacing: .1em; }

/* ---------- Formularios ---------- */
.form-control, .form-select { transition: border-color .25s, box-shadow .25s, background .25s; }
.form-control:focus, .form-select:focus { border-color: var(--blue-l); box-shadow: 0 0 0 .25rem rgba(0, 76, 151, .18); }
.contact-form { border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }

/* ---------- Pie ---------- */
.footer a { transition: color .25s, padding-left .25s var(--ease); }
.footer ul a:hover { padding-left: 5px; }

/* ---------- Botón arriba ---------- */
.to-top { position: fixed; right: 20px; bottom: 24px; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--blue); color: #fff; font-size: 16px; cursor: pointer; z-index: 900; box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; transition: opacity .3s, transform .35s var(--ease-out), background .25s; }
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--blue-d); transform: translateY(-3px); }

/* ---------- WhatsApp: un latido suave ---------- */
.cbh-phone { animation: waPop .8s var(--ease-out) 1.2s both; }
@keyframes waPop { from { transform: scale(.4); opacity: 0; } }

/* ---------- Contadores ---------- */
[data-count] { font-variant-numeric: tabular-nums; }

/* ---------- Detalles móviles ---------- */
@media (max-width: 768px) {
  .card:hover { transform: none; }
  .scroll-cue { bottom: 16px; }
  .to-top { right: 14px; bottom: 20px; }
}
@media print { .navbar, .to-top, .cbh-phone, .scroll-progress { display: none !important; } }

/* Menú desplegado: sin caja blanca propia (la barra ya es blanca) */
.navbar .navbar-collapse { background: transparent !important; box-shadow: none !important; }

/* ---------- Separación bajo el menú fijo ----------
   El contenido empieza justo debajo del menú (sin franja blanca ni títulos tapados).
   La portada con vídeo (page-home) va a pantalla completa por debajo del menú. */
:root { --nav-h: 78px; }
main { padding-top: var(--nav-h); }
body.page-home main { padding-top: 0; }
main > section:first-child.mt-5, main > section:first-of-type.mt-5 { margin-top: 0 !important; }
@media (max-width: 991px) { :root { --nav-h: 70px; } }
