/* =============================================================
   MAV Electricitat Barcelona — sistema de diseño (demo rediseño)
   Colores derivados del logotipo actual: azul #232F8E · gris #6E728A
   ============================================================= */

:root {
  --c-blue: #232F8E;
  --c-blue-dark: #1A2370;
  --c-blue-soft: #E9EBF7;
  --c-blue-tint: #F3F4FB;
  --c-grey: #6E728A;
  --c-ink: #171B2E;
  --c-text: #3B3F55;
  --c-muted: #7A7E93;
  --c-line: #E3E5EE;
  --c-bg: #FFFFFF;
  --c-bg-alt: #F6F7FA;
  --c-ok: #1E7F4F;
  --c-err: #B23A3A;

  --font-head: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(23, 27, 46, 0.08);
  --shadow-sm: 0 2px 8px rgba(23, 27, 46, 0.06);
  --container: 1200px;
  --gutter: 20px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--c-ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.015em;
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--c-text); max-width: 62ch; }
.muted { color: var(--c-muted); }
.small { font-size: .9rem; }

:focus-visible { outline: 3px solid rgba(35,47,142,.45); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -999px; top: 8px; background: var(--c-blue); color: #fff;
  padding: 10px 14px; border-radius: 6px; z-index: 1000;
}
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: 860px; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--alt { background: var(--c-bg-alt); }
.section--tint { background: var(--c-blue-tint); }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { max-width: 62ch; }
.section-head--center p { margin-left: auto; margin-right: auto; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--c-blue); margin-bottom: 12px;
}
.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: 960px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1.5px solid transparent; transition: all .2s var(--ease); text-decoration: none !important;
  line-height: 1.2; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--c-blue); color: #fff; }
.btn--primary:hover { background: var(--c-blue-dark); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--c-blue); border-color: rgba(35,47,142,.35); }
.btn--ghost:hover { background: var(--c-blue-soft); border-color: var(--c-blue); }
.btn--white { background: #fff; color: var(--c-blue); }
.btn--white:hover { background: var(--c-blue-soft); }
.btn--outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--outline-white:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn--sm { padding: 9px 16px; font-size: .88rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }
.link-arrow:hover { text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 46px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav > ul { display: flex; align-items: center; gap: 4px; }
.site-nav > ul > li { position: relative; }
.site-nav a, .site-nav .nav-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 8px;
  color: var(--c-ink); font-weight: 500; font-size: .95rem; background: none; border: 0;
  text-decoration: none;
}
.site-nav a:hover, .site-nav .nav-btn:hover, .site-nav li.is-active > a { color: var(--c-blue); background: var(--c-blue-tint); }
.site-nav .nav-btn svg { width: 14px; height: 14px; transition: transform .2s; }
.site-nav li.open > .nav-btn svg { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; background: #fff;
  border: 1px solid var(--c-line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .18s var(--ease);
}
.site-nav li.open > .dropdown, .site-nav li:hover > .dropdown, .site-nav li:focus-within > .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a { display: flex; width: 100%; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.dropdown a.is-active { color: var(--c-blue); background: var(--c-blue-tint); }
.dropdown .dropdown-all { border-top: 1px solid var(--c-line); margin-top: 6px; padding-top: 12px; color: var(--c-blue); font-weight: 600; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; border: 1px solid var(--c-line); border-radius: 999px; padding: 3px; }
.lang-switch a { padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--c-grey); text-decoration: none; }
.lang-switch a.is-active { background: var(--c-blue); color: #fff; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--c-line); border-radius: 10px; background: #fff;
  align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--c-ink); position: relative; transition: all .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--c-ink); transition: all .2s; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 1060px) {
  .site-nav a, .site-nav .nav-btn { padding: 10px 10px; font-size: .9rem; }
  .header-phone { display: none; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-header { backdrop-filter: none; background: #fff; } /* evita que backdrop-filter actúe como contenedor del panel fijo */
  .site-nav {
    position: fixed; inset: 76px 0 0 0; background: #fff; flex-direction: column; align-items: stretch;
    padding: 12px var(--gutter) 40px; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .25s var(--ease), visibility 0s linear .25s;
    border-top: 1px solid var(--c-line);
  }
  body.nav-open .site-nav { transform: none; visibility: visible; transition: transform .25s var(--ease), visibility 0s; }
  body.nav-open { overflow: hidden; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a, .site-nav .nav-btn { width: 100%; justify-content: space-between; padding: 14px 10px; font-size: 1.05rem; border-bottom: 1px solid var(--c-line); border-radius: 0; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 6px 14px; display: none; }
  .site-nav li.open > .dropdown { display: block; }
  .site-nav li:hover > .dropdown { display: none; }
  .site-nav li.open:hover > .dropdown { display: block; }
  .dropdown a { font-size: .98rem; border-bottom: 1px solid var(--c-line); }
  .site-nav .mobile-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
  .site-nav .mobile-cta .btn { justify-content: center; }
}
@media (min-width: 901px) { .site-nav .mobile-cta { display: none; } }

/* ---------- Hero (home): imagen arquitectonica a sangre, texto sobre la zona limpia de la izquierda ---------- */
.hero {
  position: relative; overflow: hidden; background: #87888A; /* color medio del borde izquierdo de la fotografia: el ancho sobrante se resuelve extendiendo este gris */
  height: min(calc(100vh - 76px), 56.25vw); min-height: 600px; max-height: 960px;
  display: flex; align-items: center;
}
/* La foto se escala por ALTURA (equivalente a background-size: auto 100%; background-position: right center).
   Nunca hace zoom al ensanchar la ventana: conserva su proporcion y queda alineada a la derecha. */
.hero-bg {
  position: absolute; top: 0; right: 0; bottom: 0; left: auto; height: 100%; width: auto; max-width: none; z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0, #000 7%); mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0, #000 7%);
}
/* Legibilidad: degradado muy sutil solo en la mitad izquierda, transparente hacia el centro */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(246,247,249,.62) 0%, rgba(246,247,249,.42) 32%, rgba(246,247,249,0) 60%);
}
.hero .container { position: relative; z-index: 2; }
.hero-copy { max-width: 46%; transform: translateY(-2%); }
.hero .eyebrow { color: var(--c-blue); margin-bottom: 16px; }
.hero h1 { margin-bottom: 18px; max-width: 19ch; font-size: clamp(2rem, 3.7vw, 3.1rem); line-height: 1.08; color: var(--c-ink); }
.hero h1 em { font-style: normal; color: var(--c-blue); }
.hero .lead { margin-bottom: 26px; max-width: 46ch; color: var(--c-ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero .btn--ghost { background: rgba(255,255,255,.82); border-color: rgba(35,47,142,.45); }
.hero .btn--ghost:hover { background: #fff; }
.hero-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-areas a {
  font-size: .78rem; font-weight: 500; color: var(--c-ink); background: rgba(255,255,255,.62); border: 1px solid rgba(23,27,46,.14);
  padding: 5px 11px; border-radius: 999px; text-decoration: none; transition: all .18s;
}
.hero-areas a:hover { border-color: var(--c-blue); color: var(--c-blue); background: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: heroIn .8s var(--ease) both; }
  @keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(-2%); } }
}
@media (max-width: 1100px) {
  .hero-copy { max-width: 52%; }
}
@media (max-width: 900px) {
  .hero { height: auto; min-height: 0; max-height: none; display: flex; flex-direction: column; background: var(--c-bg-alt); }
  .hero-bg { order: 2; }
  .hero-bg { -webkit-mask-image: none; mask-image: none; max-width: 100%; }
  .hero::before { display: none; }
  .hero .container { padding-top: 44px; padding-bottom: 36px; }
  .hero-copy { max-width: none; transform: none; }
  .hero h1 { max-width: none; }
  .hero-bg {
    position: static; display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: right center;
  }
  @keyframes heroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 520px) {
  .hero-bg { aspect-ratio: 4 / 3; object-position: 78% center; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

/* Página interior: cabecera */
.page-hero { background: var(--c-blue-tint); border-bottom: 1px solid var(--c-line); }
.page-hero .container { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }
.page-hero h1 { margin-bottom: 12px; }
.page-hero .lead { margin-bottom: 0; }
.page-hero--split .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.page-hero--split .media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; box-shadow: var(--shadow); }
.page-hero--split .media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .page-hero--split .container { grid-template-columns: 1fr; gap: 28px; } }
.breadcrumb { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--c-muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-blue); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--c-line); }

/* ---------- Intro / pilares ---------- */
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; } }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .pillars { grid-template-columns: 1fr; } }
.pillar { background: #fff; border: 1px solid var(--c-line); border-radius: 12px; padding: 22px; }
.pillar .icon { width: 42px; height: 42px; border-radius: 10px; background: var(--c-blue-soft); color: var(--c-blue); display: grid; place-items: center; margin-bottom: 14px; }
.pillar .icon svg { width: 22px; height: 22px; }
.pillar h3 { font-size: 1.05rem; margin-bottom: 6px; }
.pillar p { margin: 0; font-size: .93rem; color: var(--c-text); }

/* ---------- Tarjetas de servicio ---------- */
.service-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s var(--ease); color: inherit; text-decoration: none !important;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.service-card .media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--c-bg-alt); }
.service-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.service-card:hover .media img { transform: scale(1.04); }
.service-card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.service-card h3 { display: flex; align-items: center; gap: 10px; margin: 0; }
.service-card h3 svg { width: 22px; height: 22px; color: var(--c-blue); flex: none; }
.service-card ul { display: grid; gap: 4px; font-size: .92rem; color: var(--c-text); }
.service-card ul li { padding-left: 16px; position: relative; }
.service-card ul li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--c-blue); opacity: .6; }
.service-card .link-arrow { margin-top: auto; padding-top: 8px; }

/* Servicios en página general: tarjetas horizontales */
.service-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(36px, 5vw, 64px) 0; border-top: 1px solid var(--c-line);
}
.service-row:first-of-type { border-top: 0; padding-top: 0; }
.service-row:nth-child(even) .service-row__media { order: 2; }
.service-row__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 11; box-shadow: var(--shadow-sm); }
.service-row__media img { width: 100%; height: 100%; object-fit: cover; }
.service-row h2 { display: flex; align-items: center; gap: 12px; }
.service-row h2 svg { width: 28px; height: 28px; color: var(--c-blue); }
@media (max-width: 820px) {
  .service-row { grid-template-columns: 1fr; }
  .service-row:nth-child(even) .service-row__media { order: 0; }
}

/* Checklist */
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
@media (max-width: 640px) { .checklist { grid-template-columns: 1fr; } }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.checklist li svg { width: 20px; height: 20px; flex: none; color: var(--c-blue); margin-top: 3px; }
.checklist--compact li { padding: 6px 0; border: 0; }

/* ---------- Bloque acreditaciones ---------- */
.accred { background: var(--c-blue); color: #fff; position: relative; overflow: hidden; }
.accred::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.accred h2, .accred h3 { color: #fff; }
.accred .eyebrow { color: rgba(255,255,255,.75); }
.accred .container { position: relative; }
.accred-head { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; margin-bottom: 40px; }
.accred-head p { color: rgba(255,255,255,.85); max-width: 60ch; margin: 0; }
.accred-oge { justify-self: end; background: #fff; border-radius: 12px; padding: 18px 22px; display: flex; align-items: center; gap: 18px; color: var(--c-ink); }
.accred-oge img { height: 54px; width: auto; }
.accred-oge .reg { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.accred-oge .reg small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .78rem; color: var(--c-muted); letter-spacing: 0; }
@media (max-width: 860px) { .accred-head { grid-template-columns: 1fr; } .accred-oge { justify-self: start; } }
.accred-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 960px) { .accred-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .accred-grid { grid-template-columns: 1fr; } }
.accred-item { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 22px; }
.accred-item .code { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; letter-spacing: .02em; margin-bottom: 8px; }
.accred-item p { margin: 0; color: rgba(255,255,255,.88); font-size: .95rem; }
.accred-foot { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; color: rgba(255,255,255,.8); font-size: .9rem; }
.accred-foot img { height: 64px; width: auto; background: #fff; border-radius: 10px; padding: 6px; }

/* ---------- Obras ---------- */
.work-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--c-ink); color: #fff; text-decoration: none !important; }
.work-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); opacity: .92; }
.work-tile:hover img { transform: scale(1.04); }
.work-tile .caption {
  position: absolute; inset: auto 0 0 0; padding: 22px; background: linear-gradient(180deg, rgba(23,27,46,0) 0%, rgba(23,27,46,.85) 100%);
}
.work-tile .caption h3 { color: #fff; margin: 0; font-size: 1.2rem; }
.work-tile .caption span { font-size: .85rem; color: rgba(255,255,255,.8); }
.work-tile--large { aspect-ratio: 16 / 9; }
.works-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 700px) { .works-grid { grid-template-columns: 1fr; } }

.project { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--c-line); }
.project:first-of-type { border-top: 0; }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.project-head h2 { margin: 0; }
.project-logo { height: 56px; width: auto; max-width: 220px; object-fit: contain; }
.project-logo--dark { background: #222; padding: 6px 10px; border-radius: 6px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .gallery, .gallery--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .gallery, .gallery--4 { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.gallery a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--c-bg-alt); position: relative; }
.gallery a img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gallery a:hover img { transform: scale(1.04); }
.gallery a::after {
  content: ""; position: absolute; inset: 0; background: rgba(35,47,142,0); transition: background .2s;
}
.gallery a:hover::after { background: rgba(35,47,142,.12); }
.gallery--tall a { aspect-ratio: 3 / 4; }

/* ---------- Colaboradores ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1000px) { .logo-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) { .logo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .logo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.logo-card {
  background: #fff; border: 1px solid var(--c-line); border-radius: 12px; height: 108px; display: grid; place-items: center; padding: 18px 22px;
  transition: all .2s var(--ease);
}
.logo-card img { max-height: 46px; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .72; transition: all .25s; }
.logo-card:hover { border-color: rgba(35,47,142,.35); box-shadow: var(--shadow-sm); }
.logo-card:hover img { filter: none; opacity: 1; }
.logo-card--placeholder { border-style: dashed; color: var(--c-muted); font-size: .8rem; text-align: center; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* ---------- CTA ---------- */
.cta-band { background: var(--c-ink); color: #fff; }
.cta-band .container { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); }
.cta-band h2 { color: #fff; margin-bottom: 10px; }
.cta-band p { color: rgba(255,255,255,.78); margin: 0; max-width: 56ch; }
.cta-contact { display: grid; gap: 12px; justify-self: end; }
.cta-contact a { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; }
.cta-contact a span.ic { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: none; }
.cta-contact a svg { width: 22px; height: 22px; }
.cta-contact a:hover { color: #C9CFFF; }
@media (max-width: 800px) { .cta-band .container { grid-template-columns: 1fr; } .cta-contact { justify-self: start; } }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { display: grid; gap: 14px; margin: 24px 0; }
.contact-list a, .contact-list .item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--c-line); border-radius: 12px; color: var(--c-ink); text-decoration: none !important; background: #fff; transition: all .2s; }
.contact-list a:hover { border-color: var(--c-blue); box-shadow: var(--shadow-sm); }
.contact-list .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--c-blue-soft); color: var(--c-blue); display: grid; place-items: center; flex: none; }
.contact-list .ic svg { width: 22px; height: 22px; }
.contact-list strong { display: block; font-family: var(--font-head); font-size: 1.1rem; }
.contact-list small { color: var(--c-muted); }
.social { display: flex; gap: 10px; }
.social a { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--c-line); display: grid; place-items: center; color: var(--c-ink); }
.social a:hover { color: var(--c-blue); border-color: var(--c-blue); }
.social svg { width: 20px; height: 20px; }

.form-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: clamp(22px, 3vw, 36px); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--c-ink); }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid #CDD0DC; border-radius: 10px; font: inherit; color: var(--c-ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(35,47,142,.15); }
.field textarea { min-height: 140px; resize: vertical; }
.field .hint { font-size: .82rem; color: var(--c-muted); margin-top: 6px; }
.field.has-error input, .field.has-error textarea { border-color: var(--c-err); }
.field .error { display: none; color: var(--c-err); font-size: .82rem; margin-top: 6px; }
.field.has-error .error { display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--c-blue); flex: none; }
.form-note { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--c-bg-alt); font-size: .88rem; display: none; }
.form-note.is-ok { display: block; background: #E8F5EE; color: var(--c-ok); }
.form-note.is-err { display: block; background: #FBECEC; color: var(--c-err); }

.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-bg-alt); min-height: 380px; position: relative; }
.map-wrap iframe { width: 100%; height: 420px; border: 0; display: block; }
.map-consent { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; }
.map-consent > div { max-width: 420px; }
.map-consent p { font-size: .92rem; }

/* ---------- Placeholders (material pendiente) ---------- */
.placeholder {
  display: grid; place-items: center; text-align: center; background: repeating-linear-gradient(135deg, #F3F4F8 0 12px, #EDEEF4 12px 24px);
  border: 2px dashed #C3C6D4; border-radius: 12px; color: var(--c-grey); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .82rem; padding: 18px; line-height: 1.4;
}
.placeholder--media { aspect-ratio: 4 / 3; }
.placeholder--wide { aspect-ratio: 16 / 9; }
.placeholder--inline { display: inline; border: 0; padding: 2px 6px; background: #FFF4D6; color: #8A5A00; border-radius: 4px; font-size: .85em; }
.pending-note { background: #FFF8E6; border: 1px solid #F1DFA5; color: #6B4E00; border-radius: 10px; padding: 12px 16px; font-size: .9rem; }
.pending-note strong { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* ---------- Prose (legal) ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.45rem; margin-top: 2em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; }
.prose ul { list-style: disc; padding-left: 22px; margin-bottom: 1em; }
.prose li { margin-bottom: .35em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1em 0 1.5em; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.prose th { color: var(--c-ink); background: var(--c-bg-alt); }

/* ---------- Footer ---------- */
.site-footer { background: #1B2140; color: rgba(255,255,255,.78); font-size: .93rem; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 40px; padding: clamp(48px, 6vw, 72px) 0 40px; }
@media (max-width: 960px) { .footer-main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-main { grid-template-columns: 1fr; gap: 28px; } }
.footer-brand img { height: 48px; width: auto; background: #fff; padding: 8px 12px; border-radius: 8px; margin-bottom: 18px; }
.footer-brand p { max-width: 38ch; margin-bottom: 18px; }
.site-footer h4 { color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
.site-footer ul li { margin-bottom: 8px; }
.footer-contact li { display: flex; gap: 10px; align-items: center; }
.footer-contact svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 22px 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; font-size: .85rem; color: rgba(255,255,255,.6); }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-gremi { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.footer-gremi img { height: 56px; width: auto; background: #fff; border-radius: 8px; padding: 4px; }
.footer-gremi span { font-size: .82rem; max-width: 22ch; line-height: 1.35; }

/* ---------- Cookies ---------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300; max-width: 560px; margin: 0 auto;
  background: #fff; border: 1px solid var(--c-line); border-radius: 14px; box-shadow: 0 16px 50px rgba(23,27,46,.22);
  padding: 22px; display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-banner h2 { font-size: 1.1rem; margin-bottom: 6px; }
.cookie-banner p { font-size: .9rem; margin-bottom: 14px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-actions .btn { padding: 10px 16px; font-size: .88rem; }
@media (min-width: 700px) { .cookie-banner { left: auto; right: 24px; bottom: 24px; margin: 0; } }

.modal { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(23,27,46,.55); }
.modal.is-open { display: flex; }
.modal__dialog { background: #fff; border-radius: 16px; max-width: 620px; width: 100%; max-height: 90vh; overflow: auto; padding: 28px; position: relative; }
.modal__close { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--c-line); background: #fff; display: grid; place-items: center; }
.modal__close svg { width: 18px; height: 18px; }
.cookie-cat { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--c-line); }
.cookie-cat:first-of-type { border-top: 0; }
.cookie-cat h3 { font-size: 1rem; margin-bottom: 4px; }
.cookie-cat p { font-size: .88rem; margin: 0; color: var(--c-muted); }
.cookie-cat .toggle { flex: none; margin-top: 2px; }
.toggle { position: relative; width: 46px; height: 26px; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #C9CCDA; transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--c-blue); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:disabled + span { background: var(--c-blue); opacity: .55; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; justify-content: flex-end; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 500; background: rgba(12,14,24,.92); display: none; align-items: center; justify-content: center; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(92vw, 1400px); max-height: 86vh; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox figcaption { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: .9rem; padding: 0 60px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.1); border: 0; color: #fff; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lightbox button svg { width: 22px; height: 22px; }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 60px; transform: none; } }

/* ---------- Reveal (animación discreta) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- Utilidades ---------- */
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.demo-badge {
  position: fixed; left: 12px; bottom: 12px; z-index: 90; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  background: #fff; border: 1px solid var(--c-line); color: var(--c-muted); padding: 5px 9px; border-radius: 6px; opacity: .85;
}
@media print { .site-header, .site-footer, .cookie-banner, .demo-badge { display: none; } }

/* ---------- Obras de referencia: carrusel por proyecto ---------- */
.section--works { padding-top: clamp(24px, 3vw, 36px); padding-bottom: clamp(32px, 4vw, 48px); }
.section--works .project { padding: 26px 0 30px; border-top: 1px solid var(--c-line); }
.section--works .project:first-of-type { border-top: 0; padding-top: 0; }
.section--works .project-head { margin-bottom: 14px; }
.section--works .project-head h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.section--works .project-logo { height: 44px; max-width: 180px; }
.carousel { position: relative; --car-gap: 14px; --car-cols: 4; }
.carousel-track {
  display: flex; gap: var(--car-gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item {
  flex: 0 0 calc((100% - (var(--car-cols) - 1) * var(--car-gap)) / var(--car-cols));
  aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--c-bg-alt); position: relative;
  scroll-snap-align: start; display: block;
}
.carousel-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
a.carousel-item:hover img { transform: scale(1.04); }
a.carousel-item::after { content: ""; position: absolute; inset: 0; background: rgba(35,47,142,0); transition: background .2s; }
a.carousel-item:hover::after { background: rgba(35,47,142,.12); }
.carousel-item.placeholder { aspect-ratio: 4 / 3; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--c-line); background: rgba(255,255,255,.96); color: var(--c-ink); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: all .2s var(--ease);
}
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-btn:hover { color: var(--c-blue); border-color: var(--c-blue); }
.carousel-btn--prev { left: -21px; }
.carousel-btn--next { right: -21px; }
.carousel-btn[hidden] { display: none; }
@media (max-width: 1240px) { .carousel-btn--prev { left: 8px; } .carousel-btn--next { right: 8px; } }
@media (max-width: 1000px) { .carousel { --car-cols: 3; } }
@media (max-width: 720px) { .carousel { --car-cols: 2; } }
@media (max-width: 520px) { .carousel { --car-cols: 1; --car-gap: 12px; } .carousel-btn { width: 38px; height: 38px; } }
.section--works .project-head { flex-wrap: nowrap; }
.section--works .project-head h2 { min-width: 0; }
@media (max-width: 520px) { .section--works .project-logo { height: 32px; max-width: 120px; } .section--works .project-head h2 { font-size: 1.25rem; } }
