/* ═══════════════════════════════════════════
   OCLINIC — Layout
   ═══════════════════════════════════════════ */

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: calc(var(--scroll-progress) * 100%);
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  z-index: calc(var(--z-nav) + 1);
  transition: width 0.1s linear;
}

/* 3D Background Container */
.scene-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-bg);
  pointer-events: none;
}

.scene-container canvas {
  display: block;
}

.scene-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, transparent 50%, rgba(250, 250, 250, 0.5) 100%),
    linear-gradient(to bottom, rgba(250, 250, 250, 0.1) 0%, rgba(250, 250, 250, 0.65) 40%, rgba(250, 250, 250, 0.85) 70%, var(--bg-primary) 100%);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: 900px;
}

.container--wide {
  max-width: 1400px;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-nav);
  padding: var(--space-sm) 0;
  transition: background var(--duration-base) var(--ease-out),
    backdrop-filter var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.nav.scrolled {
  background: var(--glass-cream);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border-light);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Real logo image in nav */
.nav__logo {
  height: 80px;
  /* Tamaño ajustado para elegancia */
  width: auto;
  object-fit: contain;
  display: block;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.nav__logo:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.nav__monogram {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-dark);
  flex-shrink: 0;
}

.nav__name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav__link {
  font-size: var(--small);
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--duration-base) var(--ease-out);
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

/* Main Content */
main {
  position: relative;
  z-index: var(--z-content);
}

/* Sections */
section {
  padding: var(--space-xl) 0;
}

.section--dark {
  position: relative;
  z-index: var(--z-content);
  background: linear-gradient(135deg, #0A1128 0%, #0d1a3a 100%);
  color: var(--text-on-dark);
}

.section--dark em {
  color: var(--green-clinic);
}

.section__label {
  font-family: var(--font-mono);
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  display: block;
}

.section__title {
  margin-bottom: var(--space-sm);
}

.section__lead {
  font-size: var(--body);
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.8;
}

.section--dark .section__lead {
  color: rgba(240, 244, 248, 0.75);
  /* Texto secundario sobre azul noche - muy legible */
}

/* Split Layout */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.split--reverse {
  direction: rtl;
}

.split--reverse>* {
  direction: ltr;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* --- Services Sticky Showcase --- */
.services-showcase {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-xl);
  align-items: start;
}

.services-showcase__visual {
  position: sticky;
  top: 100px;
  height: calc(100vh - 140px);
  min-height: 500px;
  max-height: 700px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.services-showcase__visual .visual-block {
  height: 100%;
  width: 100%;
  border-radius: 0;
}

@media (max-width: 900px) {
  .services-showcase {
    grid-template-columns: 1fr;
  }

  .services-showcase__visual {
    position: relative;
    top: 0;
    height: 400px;
    margin-bottom: var(--space-lg);
  }
}

/* Footer */
.footer {
  position: relative;
  z-index: var(--z-content);
  background: var(--glass-cream);
  /* Fondo armónico y claro */
  color: var(--text-primary);
  padding: var(--space-xl) 0 var(--space-md);
  border-top: 1px solid var(--border-light);
  overflow: hidden;
}

/* Elementos flotantes dinámicos en el footer */
.footer::before,
.footer::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  animation: floatBackground 12s infinite alternate ease-in-out;
}

.footer::before {
  top: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: rgba(212, 175, 55, 0.12);
  /* Brillo dorado */
}

.footer::after {
  bottom: -150px;
  right: 10%;
  width: 400px;
  height: 400px;
  background: rgba(184, 155, 114, 0.08);
  /* Brillo champagne */
  animation-delay: -5s;
}

.footer__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* Footer logo */
.footer__logo {
  height: 100px;
  /* Tamaño ajustado para elegancia */
  width: auto;
  object-fit: contain;
  display: block;
  margin-bottom: var(--space-sm);
  transition: transform var(--duration-base) var(--ease-out);
}

.footer__brand-link:hover .footer__logo {
  transform: scale(1.05);
}

.footer__address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: var(--space-sm);
  color: var(--text-secondary);
  font-size: var(--small);
  line-height: 1.6;
}

.footer__address svg {
  color: var(--accent);
  /* Icono de pin en dorado */
  flex-shrink: 0;
  margin-top: 3px;
}

.footer__brand-text {
  font-size: var(--small);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-top: var(--space-sm);
}

.footer__col-title {
  font-family: var(--font-mono);
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-dark);
  margin-bottom: var(--space-sm);
}

.footer__link {
  display: block;
  font-size: var(--small);
  color: var(--text-secondary);
  padding: 4px 0;
  transition: color var(--duration-fast) var(--ease-out), transform var(--duration-fast);
}

.footer__link:hover {
  color: var(--accent);
  /* Hover en Oro */
  transform: translateX(4px);
  /* Elemento dinámico en navegación */
}

.footer__bottom {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-md);
  text-align: center;
  font-size: var(--micro);
  color: rgba(74, 85, 104, 0.6);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(80px + var(--space-lg));
  padding-bottom: var(--space-xl);
}

.hero__content {
  max-width: 720px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-dark);
  background: var(--glass-light);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border-accent);
  margin-bottom: var(--space-md);
}

.hero__title {
  margin-bottom: var(--space-md);
  font-weight: 400;
  line-height: 1.15;
}

.hero__lead {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
  max-width: 580px;
}

.hero__ctas {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.hero__microcopy {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.hero__microcopy span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero__microcopy span::before {
  content: '✦';
  color: var(--accent);
  font-size: 0.6em;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.hero__stat {
  text-align: center;
  padding: var(--space-sm);
  background: var(--glass-light);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.hero__stat-icon {
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.hero__stat-label {
  font-family: var(--font-mono);
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-lg);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--micro);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.scroll-hint__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .nav__links {
    display: none;
  }

  .split {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .split--reverse {
    direction: ltr;
  }

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

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

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

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  section {
    padding: var(--space-lg) 0;
  }

  .hero {
    min-height: auto;
    padding-top: calc(70px + var(--space-md));
  }
}

@media (max-width: 500px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  .hero__ctas {
    flex-direction: column;
  }

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

  .container {
    padding: 0 var(--space-sm);
  }
}

/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 100px;
  right: 30px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  animation: floatWhatsApp 3s infinite ease-in-out;
}

.whatsapp-float:hover {
  transform: scale(1.15) rotate(-5deg);
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.6);
  animation: none;
}

.whatsapp-float svg {
  width: 35px;
  height: 35px;
}

@keyframes floatWhatsApp {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes floatBackground {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -50px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

/* Custom Cursor */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  /* Borde dorado tenue */
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
}

/* Hover state for links/buttons */
body.cursor-hover .custom-cursor {
  width: 12px;
  height: 12px;
  background-color: #006466;
  /* Esmeralda en hover */
}

body.cursor-hover .custom-cursor-follower {
  width: 50px;
  height: 50px;
  background-color: rgba(0, 100, 102, 0.1);
  border-color: transparent;
}

/* --- Mobile Menu Styles --- */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 100;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  position: absolute;
  left: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-line:nth-child(1) { top: 0; }
.hamburger-line:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger-line:nth-child(3) { bottom: 0; }

.nav__hamburger.is-active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav__hamburger.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.nav__hamburger.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav__hamburger {
    display: block;
  }
  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: var(--glass-cream);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    transition: right 0.4s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    z-index: 99;
  }
  .nav__links.is-open {
    right: 0;
  }
  .nav__book-btn {
    display: none;
  }
  .nav__link {
    font-size: 1.5rem;
  }
}