/*
  Advans Asesores - Layout & Components
  Tokens: heredados de master.css (fuente única de verdad)
  Theming: via .web-asesores en master.css
  Estilo: Premium "Nude Project" — parallax, glass, footer reveal
*/

/* ── Alias locales (mapean a tokens de master.css) ──────────── */
.web-asesores {
  --primary:        var(--color-primary);
  --primary-rgb:    var(--color-primary-rgb);
  --accent-salmon:  var(--color-accent-warm);
  --accent-yellow:  var(--color-accent);
  --accent-blue:    var(--color-accent-cool);
  --text-main:      var(--color-gray-900);
  --text-muted:     var(--color-gray-500);
  --bg-white:       var(--color-white);
  --bg-soft:        var(--color-off-white);
  --transition:     all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --container-width: 1200px;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  font-family: var(--font-body);
  color: var(--color-gray-900);
  line-height: 1.6;
  background-color: var(--color-white);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* Header — Estilo unificado advans.es (dos filas) */
header {
  width: 100%;
  background: white;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9000;
  border-bottom: 1px solid #eee;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo svg {
  height: 26px;
  width: auto;
  fill: var(--color-primary, #0b1c2e);
}

/* Logo personalizado por sitio (settings: branding_logo_{site}) */
.logo .logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.header-actions {
  display: flex;
  gap: 15px;
}

/* ── Botones de contenido — estilo premium Asesores ────────── */
.btn-area {
  background: var(--color-primary-light, #002D57);
  color: #ffffff;
  padding: 8px 22px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.25s ease, color 0.25s ease,
              transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-area:hover {
  background: var(--color-accent, #e0e67e);
  color: var(--color-primary, #0b1c2e);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 28, 46, 0.18);
}

/* Variante outline */
.btn-area--outline {
  background: transparent;
  color: var(--color-primary-light, #002D57);
  border: 2px solid var(--color-primary-light, #002D57);
  padding: 6px 22px;
}

.btn-area--outline:hover {
  background: var(--color-primary-light, #002D57);
  color: #ffffff;
  border-color: var(--color-primary-light, #002D57);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 28, 46, 0.18);
}

/* Botones sobre fondo oscuro (secciones CTA con fondo navy) */
.cta-brokers .btn-area,
.cms-cta-section .btn-area {
  background: var(--color-accent, #e0e67e);
  color: var(--color-primary, #0b1c2e);
  font-weight: 700;
}

.cta-brokers .btn-area:hover,
.cms-cta-section .btn-area:hover {
  background: #ffffff;
  color: var(--color-primary, #0b1c2e);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

/* Centrado: todos los contenedores de botón */
.cms-cta-buttons {
  align-items: center;
}

.header-bottom {
  border-top: 1px solid #f5f5f5;
  padding: 15px 0;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-primary);
  letter-spacing: 0.12em;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

/* WCAG AA: indicador visual por subrayado lima + texto navy (17:1) */
.nav-links a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.nav-links a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
  font-weight: 700;
}

.btn-cta {
  background: var(--color-primary-light, #002D57);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 45, 87, 0.3);
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(11,28,46,0.7), rgba(11,28,46,0.3));
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: white;
  max-width: 800px;
}

.hero-tagline {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 20px;
  color: var(--accent-yellow);
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.9;
  margin-bottom: 30px;
}

/* Sections */
section {
  padding: 120px 0;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 60px;
  line-height: 1;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.card-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  position: relative;
  height: 500px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: #333; /* Fallback */
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
  opacity: 0.7; /* Make text more readable */
}

.card:hover img {
  transform: scale(1.1);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
}

.card-overlay p {
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 400;
}

.card-title-under {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 10px;
}

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid #eee;
  padding: 30px 0;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  padding: 10px 0;
}

.plus-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.faq-item:hover .plus-icon {
  background: var(--color-accent, #e0e67e);
  color: var(--color-primary, #0b1c2e);
  transform: rotate(90deg);
}

.faq-item.active .plus-icon {
  background: var(--color-accent, #e0e67e);
  color: var(--color-primary, #0b1c2e);
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  color: var(--text-muted);
  margin-top: 0;
}

.faq-item.active .faq-answer {
  max-height: 200px;
  margin-top: 20px;
}

/* Footer Reveal Animation */
.page-content-wrapper {
  position: relative;
  background-color: var(--bg-white);
  z-index: 2;
  margin-bottom: var(--footer-h, 340px); /* JS lo ajusta al tamaño real */
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  min-height: 100vh;
}

/* Páginas con hero CMS no necesitan el padding del wrapper (el slider lo gestiona) */
.web-asesores .page-content-wrapper:has(.cms-slider-section) {
  padding-top: 0 !important;
}

footer {
  font-family: var(--font-heading);
  background: #f8f9fa;
  color: var(--color-primary, #0b1c2e);
  padding: 48px 0 32px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  overflow: hidden;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 20px;
}

.footer-logo {
  font-size: 2rem;
  margin-bottom: 20px;
}
.footer-logo .logo-img {
  height: 48px;
  width: auto;
  display: block;
}

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 16px;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  /* Container: padding lateral menor para no salirse en móviles estrechos */
  .container { padding: 0 16px; }

  /* Ocultar botones "Clientes / Partners" en móvil (caben en el menú hamburguesa) */
  .header-actions { display: none !important; }

  /* Bot widget: ventana del chatbot solo se ensancha cuando está abierta,
     para no inflar el contenedor flex cuando está cerrada con opacity:0 */
  .bot-widget__window.open { width: calc(100vw - 32px); max-width: 360px; }

  .card {
    height: 400px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .footer-main p { margin: 0 auto; }

  .footer-social { justify-content: center; }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  /* Botones sueltos: centrar en móvil */
  .cms-cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cms-button-wrap--left {
    text-align: center;
  }
}

/* ── FOOTER SOCIAL ICONS ─────────────────────────── */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 45, 87, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-light, #002D57);
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-icon:hover {
  background: var(--color-primary-light, #002D57);
  color: #ffffff;
  transform: translateY(-3px);
  border-color: var(--color-primary-light, #002D57);
}

.social-icon i, .social-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
}
