/* =================================================================
   JBMF Tax Counselors — hoja de estilos compartida (V02B)
   Estructura, navegación, footer y modal de contacto.
   Las imágenes de fondo de cada página van en su <style> inline.
   ================================================================= */

/* ============ Reset mínimo ============ */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }

/* ============ Fuente Open Sans self-host (RGPD, sin Google Fonts) ============ */
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/OpenSans-roman.woff2') format('woff2');
  font-weight: 300 800;
  font-style: normal;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/OpenSans-italic.woff2') format('woff2');
  font-weight: 300 800;
  font-style: italic;
  font-stretch: 75% 125%;
  font-display: swap;
}

/* ============ Base ============ */
html { background: #000; }
html, body {
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
  color: #000;
}
body {
  background: transparent;
  padding-top: 111px;    /* compensa header fijo */
  padding-bottom: 103px; /* compensa footer fijo */
  min-height: 100vh;
  position: relative;
}
/* Páginas con footer en flujo (textos largos: legal, privacidad) */
body.footer-flow { padding-bottom: 0; }

/* ============ Fondo fijo ============ */
.fondo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: #000;
  background-size: cover;
  background-position: center;
}
body > .container { position: relative; z-index: 10; }

.fondo-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
}
/* Carrusel de 3 imágenes (home) */
.fondo--carousel .fondo-slide { animation: fondoFade 18s infinite; }
.fondo--carousel .fondo-slide:nth-child(1) { animation-delay: 0s; }
.fondo--carousel .fondo-slide:nth-child(2) { animation-delay: 6s; }
.fondo--carousel .fondo-slide:nth-child(3) { animation-delay: 12s; }
/* Loop de 2 imágenes (asesoramiento, legales) */
.fondo--loop .fondo-slide { animation: fondoFade2 16s infinite; }
.fondo--loop .fondo-slide:nth-child(1) { animation-delay: 0s; }
.fondo--loop .fondo-slide:nth-child(2) { animation-delay: 8s; }

@keyframes fondoFade {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  33%  { opacity: 1; }
  38%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes fondoFade2 {
  0%   { opacity: 0; }
  6%   { opacity: 1; }
  44%  { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ============ Header / navegación ============ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.8);
  min-height: 110px;
}
.navbar .container {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  min-height: 110px;
  gap: 24px;
  position: relative;
}
.menuTop { flex: 1; display: flex; justify-content: center; }
.menuTop .menu { display: flex; gap: 28px; margin: 0; }
.menuTop .menu > li { position: relative; }
.menuTop .menu > li > a {
  display: block;
  position: relative;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.12em;
  padding: 6px 18px;
  color: #ddd;
  transition: color .2s ease;
}
.menuTop .menu > li > a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background-color: #fff;
  transform: translateX(-50%);
  transition: width .35s ease;
}
.menuTop .menu > li > a:hover { color: #fff; }
.menuTop .menu > li > a:hover::after { width: calc(100% - 36px); }
.menuTop .menu > li.has-sub > a::after { content: none; }
/* Chevron del submenú (span inyectado por nav.js) — oculto en escritorio */
.nav-chevron { display: none; }

/* Item activo */
.menuTop .menu > li.is-active > a { color: #fff; }
.menuTop .menu > li.is-active > a::after { width: calc(100% - 36px); }

/* Dropdown Socios */
.menuTop .menu > li ul {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 320px;
  padding: 22px 0 14px;
  background-color: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
  z-index: 10;
  list-style: none;
}
.menuTop .menu > li ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.85);
}
.menuTop .menu > li:hover ul,
.menuTop .menu > li:focus-within ul {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.menuTop .menu > li ul li { padding: 0; margin: 0; list-style: none; }
.menuTop .menu > li ul li a {
  display: block;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #ddd;
  white-space: nowrap;
  transition: color .2s ease, padding-left .2s ease;
}
.menuTop .menu > li ul li a:hover { color: #fff; padding-left: 34px; background: transparent; }
.menuTop .menu > li ul li a::after { content: none; }

/* Idiomas */
.idiomas {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
}
.idiomas a { color: #ddd; transition: color .2s; }
.idiomas a:hover { color: #fff; }

/* Logo blanco arriba-izquierda (páginas interiores) */
.navbar-logo {
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 5;
}
.navbar-logo img { height: 80px; width: auto; display: block; transition: opacity .2s ease; }
.navbar-logo:hover img { opacity: 0.8; }

/* ============ Contenido home (.inicio) ============ */
.inicio { text-align: center; padding-top: 100px; padding-bottom: 100px; color: #fff; }
.logo-firma {
  display: block;
  margin: 0 auto;
  width: min(520px, 60vw);
  height: auto;
  filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
}
.separator {
  width: min(750px, 80vw);
  height: 3px;
  background: rgba(255, 255, 255, 0.9);
  margin: -18px auto 22px;
  border: 0;
  border-radius: 999px;
}
.nombres {
  font-size: clamp(11px, 1.4vw, 16px);
  letter-spacing: 0.15em;
  margin: 0 0 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.45);
}
.tax-counselors {
  font-size: clamp(18px, 2.4vw, 28px);
  letter-spacing: 0.35em;
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.45);
}

/* ============ Páginas interiores ============ */
.pagina { max-width: 880px; margin: 24px auto; padding: 0 20px; }
/* Página de socio: caja a la izquierda para no tapar el retrato */
.pagina--socio { max-width: 600px; margin: 24px 0 24px clamp(20px, 6vw, 80px); padding: 0 20px; }

.cuerpo { padding: 32px 0; }
/* Variante caja oscura translúcida (asesoramiento, legales) */
.cuerpo--box {
  background-color: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  padding: 32px clamp(24px, 4vw, 56px);
  color: #f0f0f0;
}
.cuerpo--box .page-title { color: #fff; }
.cuerpo--box .page-title-rule { background: #fff; }
.cuerpo--box p { color: #e6e6e6; }
/* Variante transparente con texto negro (socios, sobre la zona clara del retrato) */
.cuerpo--bare { background: transparent; box-shadow: none; color: #000; }
.cuerpo--bare .page-title { color: #000; font-weight: 400; }
.cuerpo--bare .page-title-rule { background: #000; }
.cuerpo--bare p { color: #000; text-align: justify; hyphens: auto; }
.cuerpo--bare p strong { font-weight: 500; color: #000; }

.page-title {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.page-title-rule { width: 50px; height: 2px; border: 0; margin: 0 0 20px; }
.cuerpo p { font-size: clamp(13px, 0.95vw, 15px); line-height: 1.65; margin: 0 0 13px; }
.cuerpo p:last-child { margin-bottom: 0; }
.pagina--socio .page-title { white-space: nowrap; }

/* ============ Footer ============ */
.footer {
  background-color: rgba(0, 0, 0, 0.8);
  color: #FFFFFF;
  min-height: 103px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}
/* Footer en flujo (páginas de texto largo) */
.footer--flow { position: static; }
.footer .container { max-width: 1170px; margin: 0 auto; padding: 0 15px; }
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: 24px 0;
  flex-wrap: wrap;
}
.footer-info p { margin: 4px 0; font-size: 13px; line-height: 1.7; letter-spacing: 0.02em; color: #ddd; }
.footer-address { font-weight: 400; }
.footer-contact { font-weight: 300; }
.footer-info .dot { margin: 0 8px; color: rgba(255, 255, 255, 0.35); }
.footer-info a { color: #ddd; transition: color .2s; }
.footer-info a:hover { color: #fff; }
.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.footer-links a { color: #ddd; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-links .dot { color: rgba(255, 255, 255, 0.35); }

/* ============ Responsive ============ */
@media (min-width: 992px) and (max-width: 1199px) {
  .menuTop .menu > li > a { font-size: 14px; padding: 1px 7px; }
}
@media (min-width: 768px) and (max-width: 991px) {
  .menuTop .menu > li > a { font-size: 14px; padding: 1px 7px; }
  .footer { position: static; min-height: auto; }
  body { padding-bottom: 0; }
}
@media (max-width: 767px) {
  body {
    padding-top: 102px;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
  }

  /* --- Navbar: idiomas (y logo en interiores) arriba; menú en fila abajo --- */
  .navbar { min-height: 102px; }
  .navbar .container {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding: 0 12px;
    min-height: 102px;
    gap: 0;
    position: relative;
  }
  /* Logo de interiores: arriba centrado */
  .navbar-logo {
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
  }
  .navbar-logo img { height: 48px; }

  /* Idiomas: a la altura del logo, alineado al final de "Contacto" */
  .idiomas {
    position: absolute;
    top: 30px;
    right: 22px;
    transform: none;
  }
  .idiomas a { font-size: 13px; letter-spacing: 0.08em; }

  /* --- Menú en fila, sin hamburguesa --- */
  .menuTop { flex: none; width: 100%; }
  .menuTop .menu {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    gap: 0;
    justify-content: space-around;
    padding-bottom: 8px;
  }
  .menuTop .menu > li { position: relative; width: auto; }
  .menuTop .menu > li > a {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.02em;
    padding: 8px 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .menuTop .menu > li > a::after { display: none; }

  /* Chevron en "Socios" */
  .nav-chevron {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid #cccccc;
    border-bottom: 1.5px solid #cccccc;
    transform: rotate(45deg);
    transition: transform .25s ease;
    margin-left: 5px;
    flex: none;
  }
  .menuTop .menu > li.is-open-sub .nav-chevron { transform: rotate(-135deg); }

  /* Submenú Socios: dropdown absoluto, se abre con .is-open-sub (toque) */
  .menuTop .menu > li ul {
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 240px;
    padding: 16px 0 10px;
    background-color: rgba(0, 0, 0, 0.92);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  }
  /* Neutralizar el hover/focus de escritorio en móvil */
  .menuTop .menu > li:hover ul,
  .menuTop .menu > li:focus-within ul {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-6px);
  }
  .menuTop .menu > li.is-open-sub ul {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  .menuTop .menu > li ul li a { padding: 10px 22px; font-size: 13px; white-space: normal; }

  /* --- Home: main ocupa el espacio restante; footer queda al fondo --- */
  main.container:not(.pagina) {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .inicio { padding: 16px 15px; width: 100%; }
  .nombres { font-size: 17px; line-height: 1.7; margin-bottom: 18px; }
  .nombres .nombre { display: block; }
  .nombres .sep { display: none; }

  /* --- Páginas interiores --- */
  .pagina { margin: 30px auto; }
  .pagina--socio .page-title { white-space: normal; font-size: 22px; }
  .cuerpo--box { padding: 32px 22px; }

  /* --- Páginas de socio en móvil: foto arriba, texto debajo --- */
  body.socio .fondo {
    position: static;
    width: 100%;
    height: 46vh;
    flex: none;
    background-size: 160% auto;
    background-position: right top;
    background-repeat: no-repeat;
    background-color: #000;
  }
  body.socio main.container.pagina--socio {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 20px 24px;
    flex: 1;
  }
  body.socio .cuerpo--bare { color: #ececec; padding: 18px 0 0; }
  body.socio .cuerpo--bare .page-title { color: #fff; font-weight: 300; margin: 0 0 4px; }
  body.socio .cuerpo--bare .page-title-rule { background: #fff; margin: 0 0 14px; }
  body.socio .cuerpo--bare p { color: #e6e6e6; text-align: left; hyphens: none; margin: 0 0 10px; }
  body.socio .cuerpo--bare p strong { color: #fff; font-weight: 500; }

  /* --- Footer --- */
  .footer { position: static; min-height: auto; flex: none; }
  .footer-row { flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 16px 0; }
  .footer-info p { font-size: 11.5px; letter-spacing: 0; }
  .footer-info p.footer-address { font-size: 15px; letter-spacing: 0.02em; }
  .footer-info p.footer-contact { white-space: nowrap; }
  .footer-info .dot { margin: 0 4px; }
}

/* ============ Modal de contacto (inyectado por js/contact-modal.js) ============ */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 40px);
}
.contact-modal.is-open,
.contact-modal.is-closing { display: flex; }
.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.55);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  animation: contactBackdropIn 0.35s ease-out;
}
.contact-modal__card {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: #faf8f4;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
  animation: contactCardIn 0.45s cubic-bezier(.2, .65, .25, 1);
}
.contact-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  background: none;
  border: none;
  padding: 0;
  width: 48px;
  height: 48px;
  cursor: pointer;
  color: #000;
  font-family: 'Open Sans', sans-serif;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(.2, .65, .25, 1), color 0.2s ease;
}
.contact-modal__close:hover { transform: rotate(90deg); color: #555; }
.contact-modal__map {
  background: #f2efe8;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-modal__map svg { width: 100%; height: 100%; display: block; }
.contact-modal__body { padding: clamp(40px, 5vw, 64px) clamp(36px, 4vw, 56px); display: flex; flex-direction: column; }
.contact-modal__eyebrow {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #000;
  border-bottom: 1px solid #000;
  padding-bottom: 14px;
  margin: 0 0 28px;
}
.contact-modal__title {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #000;
  margin: 0 0 6px;
}
.contact-modal__sub { font-family: 'Open Sans', sans-serif; font-size: 15px; font-weight: 300; color: #555; margin: 0 0 clamp(28px, 3vw, 40px); }
.contact-modal__links { margin-top: auto; }
.contact-modal__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #000;
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid #d8d5cc;
  transition: padding-left 0.2s ease, color 0.15s ease;
}
.contact-modal__link:first-child { border-top: 1px solid #d8d5cc; }
.contact-modal__link:hover { color: #555; padding-left: 4px; }
.contact-modal__link--static { cursor: default; }
.contact-modal__link--static:hover { color: #000; padding-left: 0; }
.contact-modal__link .tag { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: #888; }
.radar-ring { transform-origin: center; transform-box: fill-box; animation: radarPulse 4s cubic-bezier(.25, .6, .4, 1) infinite; opacity: 0; }
.radar-ring-1 { animation-delay: 0s; }
.radar-ring-2 { animation-delay: 1.6s; }
.radar-ring-3 { animation-delay: 3.2s; }
@keyframes radarPulse {
  0%   { transform: scale(1);   opacity: 0.22; }
  80%  { opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
@keyframes contactBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes contactCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.contact-modal.is-closing .contact-modal__backdrop { animation: contactBackdropOut 0.35s ease-in forwards; }
.contact-modal.is-closing .contact-modal__card { animation: contactCardOut 0.4s cubic-bezier(.45, 0, .55, 1) forwards; }
@keyframes contactBackdropOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes contactCardOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.985); }
}
@media (max-width: 767px) {
  .contact-modal__card { grid-template-columns: 1fr; }
  .contact-modal__map { min-height: 220px; aspect-ratio: 16/10; }
}
