/* Tema base del sitio publico. Los colores de marca llegan como --brand y
   --accent desde Ajustes del sitio (base.html); el resto se deriva de ellos. */
:root {
  --ink: #1d232b;
  --muted: #5b6573;
  --line: #e3e7ec;
  --bg: #ffffff;
  --bg-alt: #f5f7f9;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(16, 24, 40, .08);
  --wrap: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.center { text-align: center; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .8em 1.4em; border-radius: 999px; font-weight: 650; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 1rem; transition: transform .15s ease, filter .15s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }

/* Cabecera */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand-logo { max-height: 48px; width: auto; }
.brand-name { font-weight: 800; font-size: 1.25rem; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 550; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current] { border-color: var(--brand); color: var(--brand); }
.nav-cta { padding: .55em 1.1em; }
.has-sub { position: relative; }
.site-nav .sub-nav { display: none; position: absolute; top: 100%; left: -14px; min-width: 240px; flex-direction: column; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px 14px; z-index: 60; }
.site-nav .has-sub:hover > .sub-nav, .site-nav .has-sub:focus-within > .sub-nav { display: flex; }
.site-nav .sub-nav a:not(.btn) { display: block; padding: 8px 0; border: 0; font-weight: 500; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .2s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 20px 20px; display: none; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: 14px; }
  .site-nav .sub-nav { display: flex; position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; }
}

/* Avisos (formulario sin JavaScript) */
.flash-list { margin-top: 16px; }
.flash { padding: 12px 16px; border-radius: 10px; background: var(--bg-alt); border-left: 4px solid var(--brand); }
.flash-error { border-color: #c0392b; }

/* Secciones */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section-alt { background: var(--bg-alt); }
.section-brand { background: var(--brand); color: #fff; }
.section-title { text-align: center; }
.section-intro { text-align: center; color: var(--muted); max-width: 720px; margin: -0.2em auto 2.2em; }
.section-brand .section-intro { color: rgba(255,255,255,.85); }
.page-title { padding: 56px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose h2 { margin-top: 1.2em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: .8em; }

/* Portada */
.hero { position: relative; color: #fff; background: var(--brand) center/cover no-repeat; }
.hero-cover { min-height: min(78vh, 720px); display: flex; align-items: center; }
.hero-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,14,20,.78), rgba(10,14,20,.35)); }
.hero-cover.hero-plain::before { background: none; }
.hero-inner { position: relative; padding: 80px 20px; display: grid; gap: 40px; align-items: center; }
.hero-copy { max-width: 720px; }
.hero .eyebrow { color: #fff; opacity: .85; }
.hero .lead { font-size: 1.2rem; opacity: .92; }
.hero-split { background: var(--bg-alt); color: var(--ink); }
.hero-split .eyebrow { color: var(--accent); }
.hero-split .btn-ghost { color: var(--brand); }
.hero-split .hero-inner { grid-template-columns: 1.1fr 1fr; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 860px) { .hero-split .hero-inner { grid-template-columns: 1fr; } }

/* Imagen y texto */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split-reverse .split-media { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split-reverse .split-media { order: 0; } }

/* Tarjetas */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card-body { padding: 22px; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body p { color: var(--muted); margin: 0 0 .8em; }
.card-link { font-weight: 650; text-decoration: none; }

/* Cifras */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; text-align: center; }
.stat-value { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.1; }
.stat-label { opacity: .85; }

/* Galeria y logos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 10px; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 32px 48px; }
.logos img { max-height: 64px; width: auto; filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s; }
.logos img:hover { filter: none; opacity: 1; }

/* Preguntas frecuentes */
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }

/* Llamado a la accion */
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; padding: clamp(28px, 5vw, 48px); border-radius: calc(var(--radius) * 1.4); }
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { margin: 0; opacity: .9; }

/* Video */
.video iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: var(--radius); }

/* Contacto */
.contact-with-aside { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.contact-with-aside .section-title, .contact-with-aside .section-intro { text-align: left; margin-left: 0; }
@media (max-width: 860px) { .contact-with-aside { grid-template-columns: 1fr; } }
.contact-form { display: grid; gap: 14px; background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); }
.contact-form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.contact-form input, .contact-form textarea { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.form-hint { margin: 0; color: var(--muted); font-size: .9rem; }
.form-status:empty { display: none; }
.form-status { padding: 12px 14px; border-radius: 10px; background: #eaf6ee; color: #1d6b38; }
.form-status.error { background: #fdecea; color: #a12b1f; }
.contact-form button { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-data { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 14px; }
.contact-data strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.map { width: 100%; height: 300px; border: 0; border-radius: var(--radius); }

.contact-form .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--muted); }
.contact-form .consent input { width: auto; margin-top: .3em; flex: none; }

/* Migas */
.breadcrumbs { padding-top: 24px; font-size: .9rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; }
.breadcrumbs a { color: inherit; }

/* Banners rotativos */
.carousel { position: relative; color: #fff; background: var(--brand); }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: min(70vh, 620px); display: flex; align-items: center; background: center/cover no-repeat; }
.carousel-slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,14,20,.72), rgba(10,14,20,.2)); }
.carousel-copy { position: relative; padding-top: 56px; padding-bottom: 56px; }
.carousel-copy > * { max-width: 720px; }
.carousel-copy .lead { font-size: 1.2rem; opacity: .92; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 1.4rem; cursor: pointer; }
.carousel-nav:hover { background: rgba(255,255,255,.35); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
@media (max-width: 620px) { .carousel-nav { display: none; } }

/* Testimonios */
.testimonial { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.testimonial blockquote { margin: 0; }
.testimonial figcaption { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.testimonial img { border-radius: 50%; width: 48px; height: 48px; }
.testimonial small { display: block; color: var(--muted); }

/* Sedes */
.location h3 { margin-bottom: .3em; }
.location p { margin: 0 0 .3em; color: var(--muted); }
.location .map { margin-top: 12px; height: 220px; }

/* Descargas */
.downloads { list-style: none; padding: 0; margin: 0 auto; max-width: 820px; display: grid; gap: 10px; }
.downloads a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 600; background: #fff; }
.downloads a:hover { box-shadow: var(--shadow); }
.downloads small { color: var(--muted); font-weight: 500; text-transform: uppercase; }

/* Novedades */
.article-date { color: var(--muted); font-size: .9rem; display: block; margin-bottom: .4em; }
.article-cover img { width: 100%; border-radius: var(--radius); margin-bottom: 24px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 32px; }

/* Aviso de cookies */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; z-index: 70; }
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: .95rem; }
.cookie-banner .btn-row { margin-top: 12px; }
.cookie-banner .btn { padding: .5em 1.1em; color: #fff; }
.cookie-banner .btn-ghost { color: var(--ink); }

/* Pie */
.site-footer { background: #11161d; color: #c9d1db; padding: 56px 0 24px; margin-top: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.2rem; margin-bottom: .4em; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: .6em; }
.footer-list, .socials { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.socials { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.footer-legal a { text-decoration: underline; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 32px; padding-top: 18px; font-size: .9rem; }

/* WhatsApp flotante */
.whatsapp-float { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 60; }
