/* =========================================================
   1. COLORES Y VALORES GENERALES
========================================================= */

:root {
  color-scheme: dark;

  --background: #0e121b;
  --surface: #121923;
  --surface-raised: #151e2a;
  --border: rgba(0, 183, 255, 0.22);

  --text: #f5f7fb;
  --text-muted: #c4cbd5;
  --text-subtle: #9ca7b6;

  --blue: #00b7ff;
  --blue-light: #62d5ff;
  --focus: #ffd166;

  --container-width: 1220px;
  --header-height: 74px;
  --section-padding: 76px;
  --card-radius: 18px;
}


/* =========================================================
   2. REINICIO Y ESTILOS BÁSICOS
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 18px);
  background: var(--background);
}

body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

p {
  color: var(--text-muted);
}

::selection {
  color: #06121d;
  background: var(--blue-light);
}


/* =========================================================
   3. FONDO COMÚN: LÍNEAS Y PUNTOS QUE SUBEN
   Los puntos se desplazan hacia arriba y se repiten.
========================================================= */

/* Líneas verticales tenues */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(
      90deg,
      transparent 12%,
      rgba(0, 183, 255, 0.075) 12.08%,
      transparent 12.16%,
      transparent 30%,
      rgba(0, 183, 255, 0.055) 30.08%,
      transparent 30.16%,
      transparent 56%,
      rgba(0, 183, 255, 0.06) 56.08%,
      transparent 56.16%,
      transparent 75%,
      rgba(0, 183, 255, 0.05) 75.08%,
      transparent 75.16%
    );
}

/* Partículas dispersas que suben de abajo hacia arriba */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
  background-image:
    radial-gradient(circle at 7% 88%, rgba(0, 183, 255, 0.9) 0 1.5px, transparent 2.6px),
    radial-gradient(circle at 15% 31%, rgba(0, 183, 255, 0.7) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 24% 72%, rgba(0, 183, 255, 0.75) 0 1.4px, transparent 2.5px),
    radial-gradient(circle at 34% 18%, rgba(0, 183, 255, 0.65) 0 1.2px, transparent 2.3px),
    radial-gradient(circle at 43% 57%, rgba(0, 183, 255, 0.85) 0 1.5px, transparent 2.7px),
    radial-gradient(circle at 53% 84%, rgba(0, 183, 255, 0.7) 0 1.3px, transparent 2.5px),
    radial-gradient(circle at 63% 26%, rgba(0, 183, 255, 0.8) 0 1.4px, transparent 2.6px),
    radial-gradient(circle at 72% 68%, rgba(0, 183, 255, 0.7) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 82% 39%, rgba(0, 183, 255, 0.85) 0 1.5px, transparent 2.7px),
    radial-gradient(circle at 94% 78%, rgba(0, 183, 255, 0.65) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 19% 52%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 39% 92%, rgba(255, 255, 255, 0.45) 0 1px, transparent 2px),
    radial-gradient(circle at 69% 10%, rgba(255, 255, 255, 0.45) 0 1px, transparent 2px),
    radial-gradient(circle at 89% 58%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px);
  background-repeat: repeat-y;
  background-size: 100vw 100vh;
  background-position: 0 0;
  animation: particles-rise 32s linear infinite;
}

@keyframes particles-rise {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 0 -100vh;
  }
}

/* El contenido queda por delante de las líneas y los puntos */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}


/* =========================================================
   4. ACCESIBILIDAD Y FOCO DE TECLADO
========================================================= */

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 12px 16px;
  color: #07131d;
  background: #ffffff;
  border: 2px solid var(--blue);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

main:focus {
  outline: none;
}


/* =========================================================
   5. CONTENEDOR COMPARTIDO
========================================================= */

.container {
  width: min(var(--container-width), calc(100% - 48px));
  margin-inline: auto;
}

main {
  min-height: 60vh;
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 18px);
}


/* =========================================================
   6. ENCABEZADO, LOGO Y MENÚ
========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--text);
  background: rgba(14, 18, 27, 0.96);
  border-bottom: 1px solid rgba(98, 213, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 7px rgba(0, 183, 255, 0.35));
}

.brand-name {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-name small {
  display: block;
  margin-top: 3px;
  color: var(--blue-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.nav-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.primary-nav a,
.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"],
.footer-links a:hover {
  color: var(--blue);
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(156, 167, 182, 0.45);
  border-radius: 999px;
}

.language-switch button {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.language-switch button[aria-pressed="true"] {
  color: #06121d;
  background: var(--blue);
}


/* =========================================================
   7. BOTONES COMPARTIDOS
========================================================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
  padding: 12px 24px;
  color: #06121d;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 12px;
  box-shadow: 0 0 24px rgba(0, 183, 255, 0.25);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.button:hover {
  background: var(--blue-light);
  border-color: var(--blue-light);
  box-shadow: 0 0 32px rgba(0, 183, 255, 0.42);
  transform: translateY(-2px);
}


/* =========================================================
   8. PÁGINA HOME — PORTADA
========================================================= */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: calc(100svh - var(--header-height));
  padding: 70px 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(0, 86, 145, 0.14), transparent 55%),
    transparent;
}

.hero-content {
  width: min(1100px, calc(100% - 48px));
  max-width: 1100px;
  margin-inline: auto;
  text-align: center;
}

.hero-logo {
  display: block;
  width: min(150px, 42vw);
  height: auto;
  margin: 0 auto 30px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 18px rgba(0, 183, 255, 0.72));
}

.hero h1 {
  max-width: 1100px;
  margin: 0 auto 18px;
  color: var(--text);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 24px rgba(0, 183, 255, 0.16);
}

.hero-title-accent,
.title-accent,
.service-title-accent {
  color: var(--blue);
  text-shadow: 0 0 26px rgba(0, 183, 255, 0.55);
}

.hero .hero-subtitle {
  margin: 0 auto 16px;
  color: #e7ebf1;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.hero .hero-tagline {
  margin: 0 auto 38px;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.hero-cta {
  margin-inline: auto;
}


/* =========================================================
   9. HOME — SECCIÓN "WHY CHOOSE J&D"
========================================================= */

.why-section {
  padding: 72px 0 82px;
  border-top: 1px solid rgba(98, 213, 255, 0.16);
}

.section-heading {
  max-width: 820px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-heading h1,
.section-heading h2,
.page-intro h1 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 800;
  text-wrap: balance;
}

.section-heading > p,
.page-intro > p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.65;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.reason-card {
  min-height: 168px;
  padding: 26px 24px;
  background: rgba(18, 25, 35, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
}

.reason-card h3 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
}

.reason-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}


/* =========================================================
   10. PÁGINA SERVICES — ENCABEZADO Y TARJETAS
========================================================= */

.services-page {
  padding: 72px 0 88px;
  background: transparent;
}

.services-page > .container > .section-heading {
  margin-bottom: 72px;
}

.services-page .section-heading h1 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  text-align: center;
  text-wrap: balance;
}

.services-list {
  width: 100%;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.service-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 330px;
  padding: 24px;
  background: rgba(18, 25, 35, 0.94);
  border: 1px solid rgba(0, 183, 255, 0.14);
  border-radius: 14px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.service-card:hover {
  border-color: rgba(0, 183, 255, 0.38);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(-3px);
}

.service-icon,
.info-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  margin-bottom: 24px;
  color: var(--blue);
  background: rgba(0, 183, 255, 0.11);
  border-radius: 15px;
}

.service-icon svg,
.info-card-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.service-card h2 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
}

.service-card p {
  margin: 0 0 22px;
  color: var(--text-muted);
  line-height: 1.65;
}

.service-card-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-top: auto;
  color: var(--blue-light);
  font-weight: 800;
  text-decoration: none;
}

.service-card-link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* =========================================================
   11. PÁGINA LOCATION — UBICACIÓN
========================================================= */

.location-page {
  padding: 64px 0 88px;
  background: transparent;
}

.page-intro {
  max-width: 820px;
  margin: 0 auto 66px;
  text-align: center;
}

.page-intro h1 {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
}

.location-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}

.location-details {
  display: grid;
  gap: 24px;
}

.info-card,
.service-area-card,
.contact-info-card {
  background: rgba(18, 25, 35, 0.94);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 150px;
  padding: 30px 32px;
}

.info-card .info-card-icon {
  margin: 0;
}

.info-card h2,
.service-area-card h2,
.contact-info-card h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.info-card p,
.service-area-card p,
.contact-info-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.info-card a,
.contact-info-card a,
.footer-column > a {
  color: var(--text-muted);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.info-card a:hover,
.contact-info-card a:hover,
.footer-column > a:hover {
  color: var(--blue-light);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.service-area-card {
  min-height: 428px;
  padding: 30px 32px;
}

.service-area-card > p {
  margin: 22px 0 24px;
}

.service-area-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-area-list li {
  position: relative;
  padding-left: 20px;
  color: var(--text-muted);
}

.service-area-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
}


/* =========================================================
   12. PÁGINA CONTACT — FORMULARIO Y DATOS
========================================================= */

.contact-page {
  padding: 64px 0 88px;
  background: transparent;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}

.contact-form-card {
  padding: 30px 32px;
  background: rgba(18, 25, 35, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.contact-form-card > h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 23px;
  font-weight: 800;
}

.form-required-note {
  margin: 0 0 22px;
  color: var(--text-subtle);
  font-size: 13px;
}

.contact-form {
  display: grid;
  gap: 22px;
}

.form-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.form-field label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.required-mark {
  color: #ff8585;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  background: #101720;
  border: 1px solid rgba(0, 183, 255, 0.25);
  border-radius: 10px;
}

.form-field textarea {
  min-height: 138px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #aab3bf;
  opacity: 1;
}

.form-field input:hover,
.form-field textarea:hover {
  border-color: rgba(0, 183, 255, 0.5);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(0, 183, 255, 0.18);
  outline-offset: 2px;
}

.form-submit {
  width: 100%;
  border: 0;
}

.contact-side {
  display: grid;
  gap: 24px;
}

.contact-info-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 150px;
  padding: 30px 32px;
}

.contact-info-card .info-card-icon {
  margin: 0;
}

.contact-info-card p {
  margin-top: 8px;
  color: var(--text-subtle);
  font-size: 14px;
}


/* =========================================================
   13. PIE DE PÁGINA COMPARTIDO
========================================================= */

.site-footer {
  padding: 48px 0 22px;
  background: rgba(9, 12, 18, 0.72);
  border-top: 1px solid rgba(98, 213, 255, 0.17);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.8fr) minmax(220px, 1fr);
  gap: 52px;
  padding-bottom: 34px;
}

.footer-brand > p {
  max-width: 390px;
  margin: 20px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-column h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.footer-column p {
  margin: 0;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a {
  font-weight: 400;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.social-links a {
  color: var(--text-subtle);
  font-size: 14px;
  text-decoration: none;
}

.social-links a:hover {
  color: var(--blue-light);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid rgba(98, 213, 255, 0.18);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-subtle);
  font-size: 13px;
}


/* =========================================================
   14. TABLETAS
========================================================= */

@media (max-width: 980px) {
  :root {
    --section-padding: 62px;
  }

  .nav-row {
    gap: 18px;
  }

  .nav-tools {
    gap: 16px;
  }

  .primary-nav {
    gap: 18px;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .reason-grid {
    gap: 18px;
  }

  .location-grid,
  .contact-grid {
    gap: 22px;
  }

  .footer-main {
    gap: 30px;
  }
}


/* =========================================================
   15. TELÉFONOS
========================================================= */

@media (max-width: 680px) {
  :root {
    --header-height: 0px;
  }

  .container {
    width: min(100% - 32px, var(--container-width));
  }

  .nav-row {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
  }

  .brand-name {
    font-size: 15px;
  }

  .nav-tools {
    width: 100%;
    flex-direction: column;
    gap: 12px;
  }

  .primary-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
  }

  .primary-nav a {
    font-size: 13px;
  }

  .language-switch button {
    min-width: 36px;
    min-height: 36px;
  }

  .hero {
    min-height: 74vh;
    padding: 58px 0;
  }

  .hero-logo {
    width: 132px;
    margin-bottom: 24px;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .hero .hero-subtitle {
    font-size: clamp(1.15rem, 5.6vw, 1.55rem);
  }

  .hero .hero-tagline {
    margin-bottom: 28px;
  }

  .why-section,
  .services-page,
  .location-page,
  .contact-page {
    padding: 54px 0 64px;
  }

  .section-heading,
  .page-intro {
    margin-bottom: 38px;
  }

  .section-heading h1,
  .section-heading h2,
  .page-intro h1,
  .services-page .section-heading h1 {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }

  .section-heading > p,
  .page-intro > p {
    font-size: 16px;
  }

  .reason-grid,
  .service-grid,
  .location-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .reason-card,
  .service-card {
    min-height: 0;
  }

  .service-card {
    padding: 22px;
  }

  .info-card,
  .service-area-card,
  .contact-form-card,
  .contact-info-card {
    padding: 24px 22px;
  }

  .service-area-card {
    min-height: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }

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

  .footer-bottom {
    text-align: left;
  }
}


/* =========================================================
   16. MOVIMIENTO REDUCIDO
   Mantiene los puntos quietos si el usuario lo prefiere.
========================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::after {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* =========================================================
   MENÚ MÓVIL: LOGO, IDIOMA Y BOTÓN HAMBURGUESA
========================================================= */

.mobile-menu-toggle {
  display: none;
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.brand-name-main {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.brand-name small {
  display: inline;
  margin: 0;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 680px) {
  .nav-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand language toggle"
      "nav nav nav";
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 8px 0;
  }

  .brand {
    grid-area: brand;
    gap: 8px;
    min-width: 0;
  }

  .brand-logo {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }

  .brand-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.12;
  }

  .brand-name-main {
    font-size: 15px;
  }

  .brand-name small {
    font-size: 13px;
    letter-spacing: 0.07em;
  }

  /* Hace que los elementos internos ocupen áreas del grid del encabezado */
  .nav-tools {
    display: contents;
  }

  /* Selector móvil plano, como en la referencia */
  .language-switch {
    grid-area: language;
    display: flex;
    gap: 2px;
    padding: 0 8px 0 0;
    border: 0;
    border-right: 1px solid var(--border);
    border-radius: 0;
  }

  .language-switch button {
    min-width: 32px;
    min-height: 32px;
    padding: 5px 7px;
    border-radius: 6px;
  }

  /* Botón cuadrado con tres líneas */
  .mobile-menu-toggle {
    grid-area: toggle;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #ffffff;
    background: #087fa5;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
  }

  .menu-icon {
    display: grid;
    gap: 4px;
    width: 18px;
  }

  .menu-icon span {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
  }

  /* El menú sigue visible si JavaScript no carga */
  .primary-nav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding-top: 8px;
  }

  /* JavaScript oculta el menú hasta pulsar la hamburguesa */
  .nav-row.menu-enabled:not(.menu-open) .primary-nav {
    display: none;
  }

  .nav-row.menu-enabled.menu-open .primary-nav {
    display: flex;
    border-top: 1px solid var(--border);
  }

  .primary-nav a {
    min-height: 44px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 15px;
  }
}

/* Teléfonos muy estrechos: segunda fila para idioma y hamburguesa */
@media (max-width: 380px) {
  .nav-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand brand brand"
      "empty language toggle"
      "nav nav nav";
  }

  .brand {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .language-switch {
    grid-column: 2;
    grid-row: 2;
  }

  .mobile-menu-toggle {
    grid-column: 3;
    grid-row: 2;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}
