/* ==========================================================================
   estilos.css — Lcdo. Saturnino Rivera Ibargüen | Abogado en Panamá
   Paleta: azul marino (--navy) + dorado (--gold) + blanco humo (--smoke)
   Tipografía: Playfair Display (titulares) + Inter (cuerpo)
   ========================================================================== */

:root {
  --navy: #0D1B2A;
  --navy-2: #16283D;
  --navy-soft: #1E3550;
  --gold: #C9A227;
  --gold-light: #E4C766;
  --smoke: #F8F7F4;
  --charcoal: #2B2B2B;
  --gray: #6B7178;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, Segoe UI, sans-serif;
}

/* ============ BASE ============ */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px; /* compensa la navbar fija al navegar por anclas */
  overflow-x: hidden; /* evita scroll horizontal por márgenes negativos de las filas de Bootstrap */
}

body {
  font-family: var(--font-sans);
  color: var(--charcoal);
  background-color: #ffffff;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
}

a {
  text-decoration: none;
}

.py-lg-6 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: .5rem;
}

.titulo-seccion {
  font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  color: var(--navy);
  margin-bottom: .75rem;
}

.subtitulo-seccion {
  color: var(--gray);
  max-width: 640px;
  font-size: 1.05rem;
}

.parrafo-cuerpo {
  color: var(--charcoal);
  line-height: 1.85;
  font-size: 1.02rem;
}

/* ============ BOTONES ============ */
.btn-gold {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  font-weight: 600;
  padding: .7rem 1.6rem;
  border-radius: 2px;
  transition: background-color .25s ease, transform .25s ease, color .25s ease;
}
.btn-gold:hover, .btn-gold:focus {
  background-color: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--navy);
  transform: translateY(-2px);
}

.btn-outline-light {
  border-radius: 2px;
  font-weight: 600;
  padding: .7rem 1.6rem;
}
.btn-outline-light:hover {
  transform: translateY(-2px);
}

.btn-outline-navy {
  border: 1.5px solid var(--navy);
  color: var(--navy);
  font-weight: 600;
  padding: .65rem 1.6rem;
  border-radius: 2px;
  display: inline-block;
  transition: all .25s ease;
}
.btn-outline-navy:hover {
  background-color: var(--navy);
  color: #fff;
}

/* ============ NAVBAR ============ */
.navbar {
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  background-color: transparent;
  transition: background-color .35s ease, padding .35s ease, box-shadow .35s ease;
}

.navbar.navbar-scrolled {
  background-color: rgba(13, 27, 42, .96);
  padding-top: .6rem;
  padding-bottom: .6rem;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
}

.logo-navbar {
  height: 48px;
  width: auto;
  border-radius: 4px;
  transition: height .3s ease;
}
.navbar-scrolled .logo-navbar {
  height: 40px;
}

.navbar-nav .nav-link {
  color: #F1EFEA;
  font-weight: 500;
  font-size: .95rem;
  padding: .5rem 1rem !important;
  position: relative;
}
.navbar-nav .nav-link:hover {
  color: var(--gold-light);
}

/* ============ HERO ============ */
/* Panel navy de ancho completo: texto a la izquierda, foto real (sin
   lavado oscuro) a la derecha con insignia y tarjeta flotantes, y la
   franja de estadísticas integrada al pie del mismo panel. */
.hero {
  position: relative;
  padding-top: 7rem;
  color: #fff;
  background-color: var(--navy);
  background-image: radial-gradient(ellipse at 15% 20%, var(--navy-soft) 0%, var(--navy) 55%);
  overflow: hidden;
  border-radius: 0 0 28px 28px;
}

/* Icono de marca de agua detrás del texto, sutil, como en la referencia */
.hero-marca-agua {
  position: absolute;
  top: -3.5rem;
  left: -2.5rem;
  font-size: 22rem;
  color: rgba(255,255,255,.035);
  pointer-events: none;
  line-height: 1;
}

.hero-texto {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.hero-titulo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-subtitulo {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: #DDE3EA;
  max-width: 560px;
  line-height: 1.6;
}

/* ---- Foto del hero con insignia y tarjeta flotantes ---- */
.hero-imagen-wrap {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
}

.hero-imagen {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  box-shadow: 0 30px 60px rgba(0,0,0,.4);
}

.hero-insignia {
  position: absolute;
  top: 18px;
  left: -18px;
  display: flex;
  align-items: center;
  gap: .5rem;
  background-color: rgba(13,27,42,.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(201,162,39,.5);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .5rem .9rem;
  border-radius: 40px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.hero-insignia i {
  color: var(--gold);
}

.hero-tarjeta-flotante {
  position: absolute;
  bottom: -22px;
  right: -18px;
  display: flex;
  align-items: center;
  gap: .85rem;
  background-color: #fff;
  color: var(--navy);
  padding: .9rem 1.15rem;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,.28);
  max-width: 250px;
}
.hero-tarjeta-icono {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--navy);
  color: var(--gold);
  border-radius: 50%;
  font-size: 1.05rem;
}
.hero-tarjeta-flotante strong {
  display: block;
  font-size: .88rem;
  line-height: 1.2;
}
.hero-tarjeta-flotante span {
  display: block;
  font-size: .76rem;
  color: var(--gray);
  line-height: 1.3;
}

/* ============ FRANJA DE CONFIANZA (integrada al pie del hero) ============ */
.hero-stats {
  position: relative;
  z-index: 1;
  margin-top: 3rem;
  /* Colchón inferior más generoso que el superior: así el contenido
     (icono+número+etiqueta) queda más arriba y el botón flotante de
     WhatsApp, si llega a solaparse en pantallas cortas, sólo se posa
     sobre espacio vacío del panel, nunca sobre el texto. */
  padding: 1.25rem 0 3.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
}

.fila-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 1.75rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.stat-icono {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201,162,39,.5);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.1rem;
}

.stat-texto {
  text-align: left;
}

.contador {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  color: #fff;
  line-height: 1;
}

.stat-etiqueta {
  color: #A9B1BB;
  font-size: .82rem;
  margin-top: .3rem;
  margin-bottom: 0;
  white-space: nowrap;
}

.stat-divisor {
  width: 1px;
  align-self: stretch;
  background-color: rgba(255,255,255,.12);
}

/* ============ ÁREAS DE PRÁCTICA ============ */
.tarjeta-area {
  background-color: #fff;
  border: 1px solid #E7E4DC;
  border-radius: 4px;
  padding: 2.2rem 1.75rem;
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.tarjeta-area:hover {
  border-color: var(--gold);
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(13,27,42,.08);
}

.tarjeta-area-icono {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.tarjeta-area-titulo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .6rem;
}

.tarjeta-area-texto {
  color: var(--gray);
  font-size: .95rem;
  line-height: 1.65;
  margin-bottom: 0;
}

/* ============ SOBRE MÍ ============ */
.seccion-sobre-mi {
  background-color: var(--smoke);
}

.sobre-mi-foto-wrap {
  position: relative;
  padding: 1.25rem 1.25rem 0 0;
}
.sobre-mi-foto-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  height: 85%;
  border: 2px solid var(--gold);
  border-radius: 4px;
  z-index: 0;
}
.sobre-mi-foto {
  position: relative;
  z-index: 1;
  border-radius: 4px;
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  box-shadow: 0 24px 48px rgba(13,27,42,.18);
}

/* ============ POR QUÉ ELEGIRNOS ============ */
.porque-icono {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--navy);
  color: var(--gold);
  border-radius: 50%;
  font-size: 1.6rem;
}

.porque-titulo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .5rem;
}

.porque-texto {
  color: var(--gray);
  font-size: .93rem;
  line-height: 1.6;
}

/* ============ CTA INTERMEDIO ============ */
.cta-intermedio {
  position: relative;
  background-size: cover;
  background-position: center 20%;
  background-attachment: scroll;
  color: #fff;
}

.cta-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,27,42,.88);
}

.cta-titulo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin-bottom: .5rem;
}

.cta-subtitulo {
  color: #D9DFE6;
  font-size: 1.05rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ============ CONTACTO ============ */
.formulario-contacto .form-label {
  font-weight: 600;
  color: var(--navy);
  font-size: .9rem;
}

.formulario-contacto .form-control,
.formulario-contacto .form-select {
  border-radius: 2px;
  border: 1px solid #D8D5CC;
  padding: .65rem .85rem;
}
.formulario-contacto .form-control:focus,
.formulario-contacto .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 .2rem rgba(201,162,39,.15);
}

/* Honeypot: oculto visualmente pero accesible a bots que no leen CSS */
.campo-trampa {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}

.tarjeta-contacto-info {
  background-color: var(--navy);
  color: #fff;
  border-radius: 4px;
  padding: 2.25rem;
}

.datos-contacto {
  margin: 0;
}
.datos-contacto li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.4rem;
}
.datos-contacto li:last-child {
  margin-bottom: 0;
}
.datos-contacto li i {
  color: var(--gold);
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  margin-top: .2rem;
}
.datos-contacto-etiqueta {
  display: block;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
  color: #9FA8B3;
  margin-bottom: .15rem;
}
.datos-contacto a,
.datos-contacto span {
  color: #F1EFEA;
  font-size: .98rem;
}
.datos-contacto a:hover {
  color: var(--gold-light);
}

.mapa-wrap {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
}

/* ============ FOOTER ============ */
.footer-principal {
  background-color: var(--navy);
  color: #C7CDD5;
}

.logo-footer {
  height: 52px;
  width: auto;
  border-radius: 4px;
}

.text-footer-muted {
  color: #9FA8B3;
  font-size: .92rem;
  line-height: 1.7;
}

.footer-titulo {
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1rem;
}

.footer-links li {
  margin-bottom: .6rem;
}
.footer-links a {
  color: #B9C0C9;
  font-size: .92rem;
}
.footer-links a:hover {
  color: var(--gold-light);
}

.footer-social a {
  color: #B9C0C9;
  font-size: 1.15rem;
}
.footer-social a:hover {
  color: var(--gold);
}

.footer-inferior {
  background-color: #09141F;
  color: #8C94A0;
}
.footer-inferior a {
  color: #B9C0C9;
}
.footer-inferior a:hover {
  color: var(--gold);
}

/* ============ BOTÓN FLOTANTE DE WHATSAPP ============ */
.whatsapp-flotante {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  background-color: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 1050;
  transition: transform .3s ease, opacity .3s ease;
  animation: whatsapp-pulso 2.4s ease-in-out infinite;
}
.whatsapp-flotante:hover {
  transform: scale(1.08);
  color: #fff;
}

/* Oculto mientras el hero está en pantalla (ver assets/js/main.js),
   para que nunca se solape con la tarjeta flotante ni con la franja
   de estadísticas del hero, sin importar la altura de la pantalla. */
.whatsapp-flotante.whatsapp-oculto {
  opacity: 0;
  transform: scale(.6);
  pointer-events: none;
}

@keyframes whatsapp-pulso {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 0 0 0 rgba(37,211,102,.5); }
  50% { box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 0 0 10px rgba(37,211,102,0); }
}

/* ============ MENÚ INFERIOR MÓVIL (tipo app) ============ */
/* Barra flotante fija tipo pastilla, sólo en móvil/tablet (< 992px,
   ver clase d-lg-none en footer.php). El elemento .activo se resalta
   en dorado según la sección visible (ver assets/js/main.js). */
.menu-inferior {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 1045;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background-color: var(--navy);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: .4rem .3rem;
  box-shadow: 0 14px 34px rgba(0,0,0,.35);
}

.menu-inferior-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  flex: 1;
  padding: .4rem .2rem;
  border-radius: 14px;
  color: #A9B1BB;
  font-size: .66rem;
  font-weight: 600;
  line-height: 1;
  transition: color .2s ease, background-color .2s ease;
}
.menu-inferior-item i {
  font-size: 1.05rem;
}
.menu-inferior-item span {
  white-space: nowrap;
}

/* Sección activa según el scroll */
.menu-inferior-item.activo {
  color: var(--gold);
  background-color: rgba(201,162,39,.12);
}

/* El acceso a WhatsApp siempre destaca en dorado, como acción principal */
.menu-inferior-destacado {
  color: var(--gold);
}
.menu-inferior-destacado i {
  color: var(--gold);
}

/* ============ ANIMACIONES DE SCROLL (fade-in) ============ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: var(--navy);
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 4px;
  }
  .hero {
    padding-top: 8rem;
  }
  .hero-marca-agua {
    font-size: 14rem;
  }

  /* Deja espacio libre al final de la página para que el menú
     inferior fijo (.menu-inferior) no tape el footer ni el final
     del formulario de contacto. */
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 767.98px) {
  .tarjeta-contacto-info {
    padding: 1.75rem;
  }
  .sobre-mi-foto-wrap::before {
    display: none;
  }

  /* Hero: la insignia y la tarjeta flotante se recogen dentro de la foto
     para no desbordar el ancho de pantalla en móvil */
  .hero {
    padding-top: 7rem;
    border-radius: 0 0 20px 20px;
  }
  .hero-imagen-wrap {
    max-width: 300px;
  }
  .hero-insignia {
    left: 0;
    top: 12px;
    font-size: .68rem;
    padding: .4rem .7rem;
  }
  .hero-tarjeta-flotante {
    right: 0;
    bottom: -18px;
    max-width: 210px;
    padding: .75rem .9rem;
  }
  .hero-stats {
    margin-top: 3rem;
    padding: 1.25rem 0 2.5rem;
  }

  /* Franja de estadísticas: cuadrícula 2x2 sin divisores en móvil.
     min-width:0 permite que los elementos flex/grid se encojan y el
     texto pueda envolver en vez de desbordar el ancho de pantalla. */
  .fila-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem .75rem;
  }
  .stat-divisor {
    display: none;
  }
  .stat-item {
    min-width: 0;
    align-items: flex-start;
  }
  .stat-icono {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .stat-texto {
    min-width: 0;
  }
  .stat-etiqueta {
    white-space: normal;
    font-size: .76rem;
    line-height: 1.3;
  }
}
