/* Layout fixes applied on top of the approved mockup styles.
   Loaded last on every page. Keep overrides scoped and documented here, not in the mockup copies. */

/* Logo carousels: span the full viewport width instead of the content container. */
/* !important: earlier stylesheets scope the carousel with ID selectors (e.g. .recon-home #confianza). */
.logo-carousel {
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
}
/* 100vw includes the vertical scrollbar; clip the bleed so the page never scrolls sideways. */
section:has(.logo-carousel) {
  overflow-x: clip;
}

/* Logos share one visual box so brand marks read at the same weight. */
.logo-slide {
  flex: 0 0 var(--logo-width, 200px);
  height: 104px;
  padding: 12px 20px;
}
.logo-slide img,
.logo-wide img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

/* Home hero: fills the visible screen below the header and never clips its content.
   The layout box uses border-box so its padding stays inside the viewport height.
   If the copy is taller than the screen, the hero grows instead of cutting it. */
.recon-home #inicio {
  box-sizing: border-box;
  padding: 0;
  height: auto;
  min-height: calc(100svh - var(--header-height, 88px));
}
.recon-home #inicio .hero-layout {
  box-sizing: border-box;
  min-height: calc(100svh - var(--header-height, 88px));
  height: auto;
}
.recon-home #inicio .hero-copy {
  box-sizing: border-box;
}
/* Vertical rhythm of the hero follows the screen height so the hero fits the visible viewport. */
.recon-home #inicio .hero-layout {
  padding-block: clamp(24px, 6vh, 72px);
}
/* On short screens the headline and logo scale with the height too, so the hero still fits. */
.recon-home #inicio .hero h1 {
  font-size: clamp(46px, min(7.5vw, 12.5vh), 110px);
}
.recon-home #inicio .hero h1 em img {
  width: clamp(180px, min(33vw, 24vh), 492px);
}

/* Header: wordmark sized by its real proportions (the PNG is trimmed to the artwork). */
.site-header .brand {
  width: clamp(132px, 13vw, 200px) !important;
  height: auto !important;
  max-width: none;
}
@media (max-width: 700px) {
  .site-header .brand { width: 132px !important; }
}

/* Language switch: one pill container with a filled active segment (no stacked outline box). */
.site-header .language {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
}
.site-header .language button,
.site-header .language button[aria-pressed] {
  width: auto !important;
  min-width: 40px;
  min-height: 30px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d9dfe5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
}
.site-header .language button[aria-pressed="true"] {
  background: var(--red, #e51f35);
  color: #fff;
}
.site-header .language button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Navigation text is readable at laptop widths (was 11px). */
.site-header .desktop-nav a {
  font-size: clamp(12px, 0.95vw, 13.5px) !important;
}

/* Mobile menu: larger labels and 48px touch targets. */
.site-header .mobile-menu a {
  font-size: 15px !important;
  min-height: 48px;
  display: flex;
  align-items: center;
}

/* Field error messages: readable size, announced next to the field. */
.field-error {
  font-size: 13px !important;
  line-height: 1.4;
}

/* Consent checkbox aligned with its text. */
.consent-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  line-height: 1.5;
}
.consent-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
}
.form-field-error-color,
.field-error {
  color: #b3001f !important;
  font-weight: 600;
}

/* Header call-to-action and breadcrumb: 12px minimum for legibility. */
.site-header .header-actions .btn {
  font-size: 12px;
}
.breadcrumb,
.breadcrumb a {
  font-size: 12px;
}

/* Desktop navigation links: 40px touch/click area. */
.site-header .desktop-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

/* Header CTA stays 12px at every width; footer legal line 12px. */
.site-header .header-actions .btn,
.site-header .btn {
  font-size: 12px !important;
}
.footer small,
.footer .copyright,
.footer p:last-child {
  font-size: 12px;
}

/* Footer social links: visible size without the old outline box. */
.footer .socials { gap: 12px; }
.footer .socials a {
  width: 44px;
  height: 44px;
  border: 0;
  display: grid;
  place-items: center;
}
.footer .socials img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.footer-address { line-height: 1.5; }

/* Bilingual pages (privacidad.html): show only the block for the active language.
   Lives in this stylesheet because the server CSP blocks inline <style> elements. */
html[lang="en"] [data-lang-block="es"] { display: none; }
html:not([lang="en"]) [data-lang-block="en"] { display: none; }

/* Header CTA label inherits the 12px button size on every page. Some pages (e.g. privacidad.html)
   otherwise inherit a larger span size, which overflows the header on phones. */
.site-header .header-actions .btn span {
  font-size: inherit !important;
}

/* Home product panels: every image fills the same frame, whatever its file proportion.
   The frame height comes from the grid row (min-height), not from the image, so the five
   products (800x450 and 800x600 sources) show at the same size when switching tabs. */
.recon-home .recon-product-image { min-height: clamp(420px, 39vw, 570px); }
.recon-home .recon-product-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
}

/* Header CTA uses the same pill shape as every other button on the site (9999px, see components.css). */
.site-header .btn {
  border-radius: 9999px;
}

/* Home solution sector badges are links to the matching section of soluciones.html. */
.recon-home #soluciones a.sector-badge {
  text-decoration: none;
  cursor: pointer;
}
.recon-home #soluciones a.sector-badge:hover,
.recon-home #soluciones a.sector-badge:focus-visible {
  background: var(--red-hover);
}
.recon-home #soluciones a.sector-badge:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

/* Certificate carousel: each logo links to its certificate, opened in a new tab. */
.logo-slide > a { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 4px; }
.logo-slide > a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
