/* ============================================================
   Angel | Broker Hipotecario Elda — Design System
   ============================================================ */

:root {
  /* Color */
  --primary: #10263d;
  --primary-light: #1b3a57;
  --primary-dark: #0a1b2c;
  --accent: #5c8b67;
  --accent-hover: #4a7354;
  --accent-light: #e8efe7;
  --gold: #c9a24b;
  --warm-bg: #faf9f6;
  --white: #ffffff;
  --text: #1b1f23;
  --text-muted: #5b6670;
  --border: #e3e7e4;

  /* Type */
  --font-heading: "Plus Jakarta Sans", sans-serif;
  --font-body: "Inter", sans-serif;

  /* Spacing (8pt) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-6: 48px;
  --sp-8: 64px;
  --sp-12: 96px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(16, 38, 61, 0.08), 0 1px 2px rgba(16, 38, 61, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 38, 61, 0.1);

  --container-max: 1240px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; font-weight: 700; color: var(--primary); }

/* ---------- Typography scale ---------- */
h1, .h1 { font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem); letter-spacing: -0.02em; }
h2, .h2 { font-size: clamp(1.6rem, 1.35rem + 1.2vw, 2.3rem); letter-spacing: -0.01em; margin-bottom: var(--sp-3); }
h3, .h3 { font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem); margin-bottom: var(--sp-1); }
p { margin-bottom: var(--sp-2); }
.lead { font-size: 1.15rem; color: var(--text-muted); }
.section-kicker {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-1);
}
.section-head { max-width: 680px; margin-bottom: var(--sp-6); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Layout ---------- */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--sp-3); }
section { padding: var(--sp-12) 0; }
.section-sage { background: var(--accent-light); }
.section-navy { background: var(--primary); color: rgba(255,255,255,0.92); }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-warm { background: var(--warm-bg); }
.grid { display: grid; gap: var(--sp-3); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-gap { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  section { padding: var(--sp-8) 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--white); color: var(--primary); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); transform: translateY(-1px); }
.btn-ghost-light { background: rgba(255,255,255,0.12); color: var(--white); border: 1.5px solid rgba(255,255,255,0.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.2); }
.btn-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }

/* ---------- Badge / pill ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.28);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
}
.badge-light { background: var(--accent-light); border: 1px solid var(--accent); color: var(--primary); }

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  margin-bottom: var(--sp-2);
}
.card-img { border-radius: var(--radius-md); overflow: hidden; margin-bottom: var(--sp-2); aspect-ratio: 4/3; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Header ---------- */
.topbar {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.topbar-info { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.topbar-info a { display: inline-flex; align-items: center; gap: 6px; }
.topbar-info a:hover { color: var(--white); }
.topbar-hours { color: rgba(255,255,255,0.6); }

header[role="banner"] { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; max-width: var(--container-max); margin: 0 auto; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 44px; height: 44px; flex-shrink: 0; }
.brand-text { line-height: 1.15; }
.brand-text .brand-name { display: block; font-family: var(--font-heading); font-weight: 800; font-size: 1.05rem; color: var(--primary); }
.brand-text .brand-sub { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; color: var(--accent); text-transform: uppercase; }

nav[role="navigation"] > ul { display: flex; gap: var(--sp-4); align-items: center; }
nav[role="navigation"] ul li { position: relative; }
nav[role="navigation"] a { font-weight: 600; font-size: 0.96rem; color: var(--text); }
nav[role="navigation"] a:hover, nav[role="navigation"] a.active { color: var(--accent); }
.nav-cta { display: flex; align-items: center; gap: var(--sp-2); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--primary); border-radius: 2px; }

/* Dropdowns: Servicios / Zonas */
.has-dropdown { display: flex; align-items: center; }
.nav-link-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; }
.nav-link-toggle .fa-chevron-down { font-size: 0.68rem; color: var(--text-muted); transition: transform 200ms ease; }
.has-dropdown.open .nav-link-toggle .fa-chevron-down { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 14px; min-width: 250px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: 8px; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  z-index: 60;
}
.has-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu li { margin: 0; }
.dropdown-menu a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 0.92rem; font-weight: 500; color: var(--text); }
.dropdown-menu a:hover { background: var(--accent-light); color: var(--primary); }
.dropdown-menu li:first-child a { font-weight: 700; color: var(--primary); border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 4px; padding-bottom: 12px; }

@media (max-width: 900px) {
  nav[role="navigation"] { position: fixed; top: 0; right: -100%; width: min(320px, 85vw); height: 100vh; overflow-y: auto; background: var(--white); flex-direction: column; padding: var(--sp-8) var(--sp-3); box-shadow: var(--shadow-md); transition: right 220ms ease; }
  nav[role="navigation"].open { right: 0; }
  nav[role="navigation"] > ul { flex-direction: column; align-items: flex-start; gap: var(--sp-3); width: 100%; }
  .has-dropdown { flex-direction: column; align-items: flex-start; width: 100%; }
  .nav-link-toggle { width: 100%; justify-content: space-between; padding: 4px 0; }
  .dropdown-menu {
    position: static; margin-top: 8px; box-shadow: none; border: none; padding: 0 0 0 12px;
    opacity: 1; visibility: visible; transform: none;
    max-height: 0; overflow: hidden; transition: max-height 220ms ease;
  }
  .has-dropdown.open .dropdown-menu { max-height: 420px; }
  .nav-toggle { display: flex; }
  .nav-cta .btn-secondary { display: none; }
  .topbar-hours { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--sp-8) 0 var(--sp-12); background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%); color: var(--white); overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-8); align-items: center; }
.hero-badge { margin-bottom: var(--sp-2); }
.hero h1 { color: var(--white); margin-bottom: var(--sp-2); line-height: 1.15; }
.hero h1 span { color: var(--accent); }
.hero-services { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.82rem; font-weight: 700; color: rgba(255,255,255,0.65); margin-bottom: var(--sp-2); }
.hero-subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.82); max-width: 46ch; margin-bottom: var(--sp-4); }
.hero-ctas { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.hero-media { position: relative; }
.hero-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.hero-stat-card {
  position: absolute; bottom: -24px; left: -24px;
  background: var(--white); color: var(--text);
  border-radius: var(--radius-md); padding: var(--sp-2) var(--sp-3);
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px;
}
.hero-stat-card strong { font-family: var(--font-heading); font-size: 1.4rem; color: var(--primary); display: block; }
.hero-stat-card span { font-size: 0.78rem; color: var(--text-muted); }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-stat-card { left: 12px; bottom: -20px; }
}

/* ---------- Bank marquee ---------- */
.bank-marquee { background: var(--white); border-bottom: 1px solid var(--border); padding: var(--sp-4) 0; overflow: hidden; }
.marquee-kicker { text-align: center; font-family: var(--font-heading); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--sp-3); }
.marquee-viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 56px; align-items: center; animation: marquee-scroll 36s linear infinite; }
.marquee-track span { font-family: var(--font-heading); font-weight: 600; font-size: 1.05rem; color: var(--text-muted); opacity: 0.8; white-space: nowrap; }
@keyframes marquee-scroll { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
@media (max-width: 640px) { .marquee-track span { font-size: 0.92rem; } }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { background: var(--primary); color: var(--white); padding: var(--sp-8) 0 var(--sp-6); }
.page-hero h1 { color: var(--white); }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: var(--sp-2); }
.breadcrumb a { color: rgba(255,255,255,0.85); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Process steps ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 56px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700;
}

/* ---------- FAQ / Accordion ---------- */
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) 4px; text-align: left;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.02rem; color: var(--primary);
}
.accordion-trigger .icon { transition: transform 200ms ease; color: var(--accent); flex-shrink: 0; margin-left: var(--sp-2); }
.accordion-item.open .accordion-trigger .icon { transform: rotate(45deg); }
.accordion-panel { max-height: 0; overflow: hidden; transition: max-height 260ms ease; }
.accordion-panel p { padding: 0 4px var(--sp-3); color: var(--text-muted); }

/* ---------- Chips / zone lists ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 8px 16px; font-size: 0.88rem; font-weight: 600; }
.chip-link { background: var(--accent-light); border: 1px solid var(--accent); color: var(--primary); }
.chip-link:hover { background: var(--accent); color: var(--white); }

/* ---------- Testimonials / Reviews ---------- */
.testimonial { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4); }
.testimonial .stars { color: var(--gold); letter-spacing: 2px; margin-bottom: var(--sp-1); }
.testimonial-author { display: flex; align-items: center; gap: 12px; margin-top: var(--sp-3); }
.testimonial-author strong { display: block; font-family: var(--font-heading); font-size: 0.95rem; }
.testimonial-author span { font-size: 0.82rem; color: var(--text-muted); }
.avatar-circle { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: var(--white); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 700; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--sp-2); }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--primary); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text); font-size: 0.98rem; transition: border-color 160ms ease;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: var(--text-muted); }
.form-check input { margin-top: 3px; }
.form-check a { color: var(--accent); text-decoration: underline; }
.form-note { font-size: 0.8rem; color: var(--text-muted); margin-top: var(--sp-1); }
.form-card { background: var(--white); border-radius: var(--radius-lg); padding: var(--sp-4); box-shadow: var(--shadow-md); }
.field-error { border-color: #c0453a !important; }
.form-status { font-size: 0.88rem; margin-top: var(--sp-2); }
.form-status-error { color: #c0453a; }
.form-status-success { color: var(--accent); }

/* ---------- Footer ---------- */
footer[role="contentinfo"] { background: var(--primary-dark); color: rgba(255,255,255,0.72); padding: var(--sp-8) 0 var(--sp-3); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-2); }
.footer-brand .brand-name { color: var(--white); font-family: var(--font-heading); font-weight: 800; }
.footer-brand .brand-sub { color: var(--accent); font-size: 0.68rem; letter-spacing: 0.08em; font-weight: 700; text-transform: uppercase; display:block; }
.footer-address { font-style: normal; color: rgba(255,255,255,0.55); font-size: 0.9rem; line-height: 1.6; margin-bottom: var(--sp-2); }
.footer-contact-line { font-size: 0.92rem; margin-bottom: 4px; }
.footer-contact-line a:hover { color: var(--white); }
.footer-hours { margin-top: var(--sp-3); }
.footer-hours p { color: var(--accent); font-size: 0.85rem; margin-bottom: 4px; }
footer h4 { color: var(--white); font-family: var(--font-heading); font-size: 0.95rem; margin-bottom: var(--sp-2); }
footer ul li { margin-bottom: 10px; }
footer a:hover { color: var(--white); }
.footer-social { display: flex; gap: 10px; margin-top: var(--sp-2); }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; }
.footer-social a:hover { background: var(--accent); border-color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: var(--sp-3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2); font-size: 0.82rem; }
.footer-bottom a:hover { color: var(--white); }

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

/* ---------- Misc utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.divider { height: 1px; background: var(--border); margin: var(--sp-4) 0; }
.icon-list li { display: flex; gap: 10px; margin-bottom: 10px; }
.icon-list i { color: var(--accent); margin-top: 3px; }
.wa-float {
  position: fixed; bottom: 22px; right: 22px; z-index: 70;
  width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  box-shadow: var(--shadow-md); transition: transform 180ms ease;
}
.wa-float:hover { transform: scale(1.08); }
@media (max-width: 640px) {
  .wa-float { width: 52px; height: 52px; bottom: 16px; right: 16px; font-size: 1.4rem; }
}

/* 404 */
.error-page { min-height: 50vh; display: flex; align-items: center; }
.error-code { font-family: var(--font-heading); font-size: clamp(4rem, 3rem + 6vw, 8rem); color: var(--accent-light); font-weight: 800; line-height: 1; }

/* Legal pages */
.legal-content h2 { margin-top: var(--sp-4); }
.legal-content p, .legal-content li { color: var(--text-muted); }
.legal-content ul { list-style: disc; padding-left: 1.4em; margin-bottom: var(--sp-2); }
.legal-content ul li { margin-bottom: 6px; }

/* Blog */
.post-body h2 { margin-top: var(--sp-6); }
.post-body h3 { margin-top: var(--sp-4); }
.post-body p, .post-body li { color: var(--text); }
.post-body ul, .post-body ol { margin: 0 0 var(--sp-2) 1.4em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-meta { color: var(--text-muted); font-size: 0.88rem; margin-bottom: var(--sp-3); }
.post-cta { background: var(--accent-light); border-radius: var(--radius-md); padding: var(--sp-4); margin-top: var(--sp-6); }
