/* Capa global de experiencia, accesibilidad y legibilidad. */
:root {
  --brand-blue: #123f86;
  --brand-cyan: #009fe3;
  --ink: #0f172a;
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
body { color: var(--ink); background: #fff; }

/* El header ocupa espacio real y siempre mantiene contraste. */
#siteHeader {
  position: sticky !important;
  top: 0;
  transform: none !important;
  background: #fff !important;
  color: var(--ink) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .08);
}

#siteHeader > div { padding-top: .65rem !important; padding-bottom: .65rem !important; }
#siteHeader > div > div {
  background: rgba(255, 255, 255, .98) !important;
  border-color: rgba(15, 23, 42, .08) !important;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .10) !important;
}

#siteHeader nav a,
#siteHeader nav button { color: var(--ink) !important; }
#siteHeader nav a:hover,
#siteHeader nav button:hover { background: #eef6ff !important; color: #0e4f96 !important; }

#siteHeader a,
#siteHeader button { min-height: 44px; }

.quality-badge {
  background: #e6f4fb !important;
  color: #075d9c !important;
}

.primary-cta {
  background: #0077b6 !important;
  color: #fff !important;
}
.primary-cta:hover { background: #005f91 !important; }

/* Utilidades de producción usadas por páginas internas. */
[class~="h-[60vh]"] { height: 60vh; }
[class~="h-[100svh]"] { height: 100svh; }
[class~="min-h-[300px]"] { min-height: 300px; }
[class~="min-h-[520px]"] { min-height: 520px; }
[class~="min-h-[600px]"] { min-height: 600px; }
[class~="min-h-[720px]"] { min-height: 720px; }
[class~="flex-none"] { flex: none; }
[class~="h-5"] { height: 1.25rem; }
[class~="w-5"] { width: 1.25rem; }
[class~="left-3"] { left: .75rem; }
[class~="right-3"] { right: .75rem; }
[class~="bg-black/30"] { background-color: rgba(0, 0, 0, .30); }
[class~="bg-[linear-gradient(to_bottom,rgba(0,0,0,.08)_0%,rgba(0,0,0,.30)_45%,rgba(0,0,0,.60)_100%)]"] {
  background-image: linear-gradient(to bottom, rgba(0,0,0,.08) 0%, rgba(0,0,0,.30) 45%, rgba(0,0,0,.60) 100%);
}
[class~="bg-white/60"] { background-color: rgba(255, 255, 255, .60); }
[class~="opacity-75"] { opacity: .75; }
[class~="from-black/20"] {
  --tw-gradient-from: rgba(0, 0, 0, .2) var(--tw-gradient-from-position);
  --tw-gradient-to: rgba(0, 0, 0, 0) var(--tw-gradient-to-position);
}
[class~="bg-[linear-gradient(to_bottom,rgba(0,0,0,.5),rgba(0,0,0,.85))]"] {
  background-image: linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,.85));
}

/* Evita el gran espacio superior heredado de los héroes cuando el header ya es sticky. */
#siteHeader ~ section:first-of-type,
#mobileMenu + section { padding-top: 2rem !important; }

/* Contraste mínimo sobre fotografías y tarjetas translúcidas. */
section:has(> img.absolute) > div.relative { text-shadow: 0 1px 3px rgba(0, 0, 0, .65); }
footer input,
footer textarea { background: rgba(255, 255, 255, .16) !important; }
footer input::placeholder,
footer textarea::placeholder { color: rgba(255, 255, 255, .72) !important; }

/* La tarjeta de datos de contacto está sobre una sección clara. */
body[data-page="contacto"] main aside > div:first-child,
body[data-page="contacto"] section aside > div:first-child {
  background: #fff !important;
  color: var(--ink) !important;
  border: 1px solid #dbe5f0 !important;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .09);
}
body[data-page="contacto"] aside > div:first-child ul,
body[data-page="contacto"] aside > div:first-child li,
body[data-page="contacto"] aside > div:first-child span { color: #334155 !important; }

a, button, input, select, textarea { outline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline: 3px solid #38bdf8; }

@media (max-width: 767px) {
  #siteHeader > div { padding-left: .75rem !important; padding-right: .75rem !important; }
  #siteHeader img { max-height: 2.25rem; }
  #siteHeader ~ section:first-of-type,
  #mobileMenu + section { padding-top: 1.25rem !important; }

  [data-menu-panel] {
    left: auto !important;
    right: 0 !important;
    width: min(88vw, 24rem) !important;
  }

  [data-menu-panel] nav a,
  [data-menu-panel] nav span,
  [data-menu-close],
  [data-menu-toggle] { min-height: 44px; }

  input, select, textarea { font-size: 16px !important; }

  section h1 { font-size: clamp(2rem, 9vw, 3rem) !important; line-height: 1.08 !important; }
  section h2 { line-height: 1.15 !important; }

  section a[class*="inline-flex"],
  section button[type="submit"] { min-height: 48px; }

  section a[class*="inline-flex"] { width: 100%; }

  section .sm\:flex-row a[class*="inline-flex"] { max-width: 28rem; }

  footer .grid.grid-cols-2 { grid-template-columns: 1fr !important; gap: 2rem !important; }
  footer address { max-width: 28rem; }
}

@media (min-width: 768px) {
  section > div[class*="max-w-7xl"] { padding-left: clamp(1.5rem, 4vw, 4rem); padding-right: clamp(1.5rem, 4vw, 4rem); }
  [class~="md:h-screen"] { height: 100vh; }
  [class~="md:min-h-0"] { min-height: 0; }
  [class~="md:min-h-[600px]"] { min-height: 600px; }
  [class~="md:gap-12"] { gap: 3rem; }
  [class~="md:h-12"] { height: 3rem; }
  [class~="md:w-12"] { width: 3rem; }
  [class~="md:h-6"] { height: 1.5rem; }
  [class~="md:w-6"] { width: 1.5rem; }
  [class~="md:left-5"] { left: 1.25rem; }
  [class~="md:right-5"] { right: 1.25rem; }
}

@media (min-width: 1024px) {
  [class~="lg:grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [class~="lg:grid-cols-5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  [class~="lg:grid-cols-6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  [class~="lg:col-span-2"] { grid-column: span 2 / span 2; }
  [class~="lg:min-h-[680px]"] { min-height: 680px; }
  [class~="lg:gap-16"] { gap: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
