/* ============================================
   Finansueños — estilos compartidos del sitio
   ============================================ */

/* ---------- Variables ---------- */
:root {
  --color-primary:     #1A3C6E;
  --color-primary-dark:#122B52;
  --color-secondary:   #F5A623;
  --color-secondary-dark: #E09400;
  --color-accent:      #2BBFA4;
  --color-line:        #00C3D7;
  --color-bg:          #FFFFFF;
  --color-bg-alt:      #F4F7FB;
  --color-footer-bg:   #271A8A;
  --color-footer-bottom: #221C35;
  --color-text:        #222222;
  --color-text-light:  #FFFFFF;
  --color-text-muted:  #666666;
  --color-whatsapp:    #25D366;

  --font-heading: 'Montserrat', sans-serif;
  --font-body:    'Open Sans', sans-serif;

  --max-width: 1200px;
  --border-radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.14);
}

/* ---------- Reset y base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: 848px; }

.section { padding: 60px 0; }
.section--alt { background: var(--color-bg-alt); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.logo img { height: 60px; width: auto; max-width: 280px; object-fit: contain; }

.nav-desktop ul { list-style: none; display: flex; gap: 32px; }
.nav-desktop a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-primary);
  transition: color 0.2s;
}
.nav-desktop a:hover,
.nav-desktop a.active { color: var(--color-accent); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

.nav-mobile { display: none; background: var(--color-bg); border-top: 1px solid #eee; }
.nav-mobile.open { display: block; }
.nav-mobile ul { list-style: none; }
.nav-mobile li { border-bottom: 1px solid #f0f0f0; }
.nav-mobile a {
  display: block;
  padding: 14px 24px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
}
.nav-mobile a:hover { background: var(--color-bg-alt); }
.nav-mobile a.active { color: var(--color-accent); }

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { transform: scale(1.04); }

.btn-primary { background: var(--color-primary); color: var(--color-text-light); }
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary { background: var(--color-secondary); color: #1A1A1A; }
.btn-secondary:hover { background: var(--color-secondary-dark); }

/* ---------- Inicio: banner principal ---------- */
.hero { overflow: hidden; line-height: 0; }
.hero-img {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  object-position: center;
}

/* ---------- Inicio: tarjetas de acción ---------- */
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.cta-card {
  background: var(--color-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.cta-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.cta-img { width: 100%; height: 220px; object-fit: cover; }

.cta-content { padding: 24px; text-align: center; }
.cta-content p { font-size: 1rem; margin: 4px 0; line-height: 1.5; }
.cta-content .btn { margin-top: 18px; }

/* ---------- Tarjetas imagen + texto (Tu Crédito, Sobre Nosotros) ---------- */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  display: flex;
  align-items: stretch;
  min-height: 320px;
  background: var(--color-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.feature-img {
  width: 50%;
  min-height: 300px;
  object-fit: cover;
  object-position: center;
}

.feature-content {
  width: 50%;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-content h2 {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
  line-height: 1.3;
}
.feature-content p { font-size: 1.05rem; color: var(--color-text-muted); line-height: 1.7; }
.feature-content .btn { margin-top: 22px; align-self: flex-start; }

/* ---------- Banner de páginas internas ---------- */
.page-header { position: relative; overflow: hidden; }
.page-header-img { width: 100%; max-height: 650px; object-fit: cover; }

/* Variante por defecto: franja degradada abajo con texto blanco */
.page-header-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 10%;
  background: linear-gradient(transparent, rgba(26, 60, 110, 0.9));
  text-align: left;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--color-text-light);
  line-height: 1.2;
}
.page-header p { font-size: 1.1rem; color: rgba(255,255,255,0.8); margin-top: 12px; }

/* Variante: texto a la derecha sin fondo (Tu Crédito) */
.page-header--right .page-header-content {
  top: 80%;
  bottom: auto;
  left: auto;
  right: 8%;
  transform: translateY(-50%);
  padding: 0;
  background: transparent;
  max-width: 450px;
}
.page-header--right h1 { color: var(--color-primary); }
.page-header--right p { color: #1A1A1A; font-size: 1.3rem; }

/* ---------- Medios de pago ---------- */
.medios-pago { text-align: center; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 40px;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.section-title::before,
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background-color: var(--color-line);
  border-radius: 2px;
}

.logos-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  max-width: 1000px;
  margin: 0 auto;
}

.payment-logo {
  flex: 0 0 calc(25% - 15px);
  min-width: 160px;
  height: 75px;
  object-fit: contain;
  padding: 15px;
  background: #FFFFFF;
  border: 1px solid #E5E5E5;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}
.payment-logo:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  border-color: var(--color-primary);
}
/* Wompi y Punto Pago ocupan la mitad del espacio */
.payment-logo.logo-mitad { flex: 0 0 calc(12.5% - 15px); min-width: 70px; }

/* ---------- Preguntas frecuentes ---------- */
.faq-item {
  background: var(--color-bg);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--color-secondary);
  transition: transform 0.3s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--color-bg-alt); }
.faq-answer { padding: 0 20px 18px; color: var(--color-text-muted); line-height: 1.7; }
.faq-answer a { color: var(--color-primary); font-weight: 600; }

/* ---------- Formulario (Registra tu comercio) ---------- */
.contact-section { padding: 80px 20px; background-color: var(--color-bg-alt); }

.contact-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  background: var(--color-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.contact-header { text-align: center; margin-bottom: 40px; }
.contact-header h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--color-primary);
  margin-bottom: 10px;
  line-height: 1.25;
}
.contact-header p { color: var(--color-text-muted); font-size: 1.1rem; }

.form-group { margin-bottom: 24px; }
.form-label { display: block; font-weight: 600; color: var(--color-primary); margin-bottom: 8px; }

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #d1d9e6;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(43, 191, 164, 0.2);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231A3C6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 120px; }

.btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--color-secondary);
  color: #1A1A1A;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.btn-submit:hover { background: var(--color-secondary-dark); transform: translateY(-2px); }
.btn-submit:disabled { opacity: 0.7; cursor: wait; transform: none; }

/* Mensaje de éxito */
.toast-message {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #FFFFFF;
  border-left: 6px solid var(--color-accent);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  font-weight: 600;
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-message.show { transform: translateX(0); }
.toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  font-family: var(--font-heading);
  color: var(--color-text-light);
}
.site-footer--flush { margin-top: 0; }

.footer-main { background-color: var(--color-footer-bg); padding: 50px 0; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.footer-inner > * { flex: 1; min-width: 250px; display: flex; }

.footer-logo { justify-content: flex-start; }
.footer-logo img { max-width: 250px; }

.footer-nav { justify-content: center; }
.footer-nav ul { list-style: none; display: flex; flex-direction: column; gap: 18px; text-align: center; }
.footer-nav a { font-weight: 800; font-size: 1.15rem; transition: color 0.3s; }
.footer-nav a:hover { color: var(--color-accent); }

.footer-contact { justify-content: flex-end; }
.footer-contact-content { display: flex; flex-direction: column; align-items: flex-start; }
.footer-contact-label { font-family: var(--font-body); font-size: 1.05rem; margin-bottom: 8px; }

.footer-phone {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 1.3rem;
  font-weight: 400;
}
.footer-phone svg { width: 32px; height: 32px; }

.footer-social { display: flex; gap: 16px; padding-left: 44px; }
.footer-social svg { width: 28px; height: 28px; fill: #FFFFFF; transition: transform 0.3s; }
.footer-social a:hover svg { transform: scale(1.15); }

.footer-bottom { background-color: var(--color-footer-bottom); padding: 18px 0; }
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--color-whatsapp);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s, box-shadow 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5); }
.whatsapp-float svg { width: 32px; height: 32px; fill: white; }

/* ---------- Animación de entrada (solo si hay JavaScript) ---------- */
.js .fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js .fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .payment-logo { flex: 0 0 calc(33.333% - 15px); }

  .footer-inner { flex-direction: column; text-align: center; gap: 40px; }
  .footer-inner > * { justify-content: center; width: 100%; }
  .footer-contact-content { align-items: center; }
  .footer-social { padding-left: 0; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .hamburger { display: flex; }

  .section { padding: 40px 0; }

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

  .feature-card { flex-direction: column; min-height: 0; }
  .feature-img { order: -1; width: 100%; height: 220px; min-height: 0; }
  .feature-content { width: 100%; padding: 28px 24px; text-align: center; }
  .feature-content h2 { font-size: 1.5rem; }
  .feature-content .btn { align-self: center; }

  /* El banner ya trae su propio texto: el título va debajo de la imagen */
  .page-header .page-header-content {
    position: static;
    transform: none;
    max-width: none;
    padding: 24px;
    text-align: center;
    background: var(--color-bg-alt);
  }
  .page-header h1 { color: var(--color-primary); }
  .page-header p { color: var(--color-text-muted); font-size: 1.05rem; margin-top: 6px; }
}

@media (max-width: 600px) {
  .logo img { height: 50px; }

  .section-title { font-size: 1.4rem; gap: 10px; }
  .logos-grid { gap: 12px; }
  .payment-logo { flex: 0 0 100%; height: 90px; padding: 20px; }
  .payment-logo.logo-mitad { flex: 0 0 calc(50% - 6px); }

  .contact-section { padding: 40px 16px; }
  .contact-wrapper { padding: 30px 20px; }
  .contact-header h1 { font-size: 1.8rem; }

  .toast-message { left: 16px; right: 16px; bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .fade-in { opacity: 1; transform: none; }
}

/* Texto solo para lectores de pantalla y buscadores */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Campo trampa del formulario: fuera de la vista de las personas */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Página 404 ---------- */
.not-found { text-align: center; padding: 100px 0; }
.not-found .not-found-code {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-accent);
}
.not-found h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-primary);
  margin: 16px 0 12px;
}
.not-found p { color: var(--color-text-muted); }
.not-found-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
