/* WEHA V114 – mobile-only layout corrections.
   Desktop rules remain untouched; these overrides apply to tablets/phones. */

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  overflow-x: clip;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

@media (max-width: 1100px) {
  .site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100%;
    height: 78px !important;
    padding: 0 16px !important;
  }

  .site-brand {
    min-width: 0;
    gap: 0;
  }

  .brand-logo {
    font-size: 1.9rem !important;
  }

  .brand-logo-image {
    display: block;
    width: 132px !important;
    height: auto;
  }

  .brand-logo small {
    margin-top: 7px;
    font-size: .61rem !important;
  }

  .brand-since,
  .site-header > .site-nav {
    display: none;
  }

  .language:not(.language-links) {
    flex: 0 0 auto;
    margin-left: auto !important;
    padding: 9px 10px !important;
  }

  .language-links {
    flex: 0 0 auto;
    margin-left: auto !important;
    padding: 0 !important;
  }

  .menu-toggle {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin-left: 7px !important;
    padding: 10px 11px !important;
    border: 1px solid rgba(7, 60, 172, .18);
    border-radius: 4px;
    background: var(--blue, #073cac);
    color: #fff;
    font: 800 .7rem/1 Arial, Helvetica, sans-serif;
    letter-spacing: .05em;
  }

  .site-header.nav-open > .site-nav {
    position: absolute !important;
    inset: 78px 0 auto !important;
    z-index: 1001;
    display: flex !important;
    width: 100%;
    max-height: calc(100dvh - 78px);
    height: auto !important;
    margin: 0;
    padding: 8px 16px 14px;
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid rgba(7, 60, 172, .12);
    box-shadow: 0 14px 28px rgba(5, 27, 89, .15);
  }

  .site-header.nav-open > .site-nav a {
    min-height: 44px;
    width: 100%;
    border-bottom: 1px solid rgba(7, 60, 172, .08);
    white-space: normal;
    font-size: .76rem;
  }

  .carousel-page .carousel {
    height: calc(100dvh - 78px);
    padding-top: 0;
  }
}

@media (max-width: 760px) {
  h1,
  h2,
  h3,
  p,
  a,
  dt,
  dd,
  blockquote {
    overflow-wrap: anywhere;
  }

  main,
  section,
  article,
  figure,
  div {
    min-width: 0;
  }

  /* Homepage carousel */
  .carousel-page {
    min-height: 100dvh;
    overflow: hidden;
  }

  .carousel {
    height: calc(100dvh - 78px);
    min-height: 590px;
    padding-top: 0 !important;
  }

  .slide,
  .slide-frame,
  .unified-slide,
  .slide-contact {
    height: 100%;
    min-height: 0;
  }

  .unified-slide {
    display: block;
    padding: clamp(26px, 5.5vh, 46px) 24px 76px !important;
  }

  .unified-copy,
  .tech-template .unified-copy,
  .history-template .unified-copy,
  .products-template .unified-copy,
  .validation-template .unified-copy {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .unified-kicker,
  .contact-kicker {
    margin: 0 0 .7rem;
    font-size: .68rem;
    letter-spacing: .11em;
  }

  .unified-copy :is(h1,h2),
  .tech-template .unified-copy :is(h1,h2),
  .history-template .unified-copy :is(h1,h2),
  .products-template .unified-copy :is(h1,h2),
  .validation-template .unified-copy :is(h1,h2),
  .contact-copy :is(h1,h2) {
    margin: 0;
    font-size: clamp(2.15rem, 9.7vw, 3rem) !important;
    line-height: 1.03;
    letter-spacing: -.04em;
  }

  .unified-rule,
  .contact-rule {
    width: 48px;
    height: 3px;
    margin: 1rem 0;
  }

  .unified-lead,
  .validation-template .unified-lead,
  .contact-copy > p:not(.contact-kicker) {
    max-width: 31rem !important;
    font-size: .95rem !important;
    line-height: 1.45;
  }

  .unified-button {
    gap: 1rem;
    max-width: 100%;
    margin-top: 1.25rem;
    padding: .92rem 1rem;
    font-size: .72rem;
  }

  .unified-button span {
    font-size: 1rem;
  }

  .unified-benefits,
  .technology-process,
  .history-original-elements,
  .validation-original-elements,
  .products-applications {
    display: none !important;
  }

  .unified-visual {
    display: none !important;
  }

  .home-process-visual {
    display: block !important;
    left: 21% !important;
    right: -8% !important;
    top: auto !important;
    bottom: 62px !important;
    width: auto !important;
    height: 36% !important;
    opacity: .7;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 88%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 88%, transparent);
  }

  .home-process-visual::after {
    background: linear-gradient(90deg, #fff 0, rgba(255,255,255,.65) 18%, transparent 55%);
  }

  .products-original-elements {
    position: absolute;
    z-index: 2;
    inset: auto 0 54px;
    display: block;
    height: 27%;
    pointer-events: none;
  }

  .products-devices {
    left: 9% !important;
    top: 0 !important;
    width: 82% !important;
    height: 100% !important;
    object-fit: contain;
  }

  .slide-contact {
    display: block;
    padding: clamp(30px, 7vh, 56px) 24px 76px !important;
  }

  .contact-copy {
    width: 100%;
  }

  .contact-copy > p:not(.contact-kicker) br {
    display: none;
  }

  .contact-actions {
    align-items: stretch;
    gap: .75rem;
    margin-top: 1.35rem;
  }

  .button-primary,
  .button-secondary {
    width: 100%;
    padding: .9rem 1rem;
    text-align: center;
    font-size: .72rem;
  }

  .contact-panel {
    display: none !important;
  }

  .carousel-arrow {
    top: auto;
    bottom: 12px;
    width: 34px;
    height: 38px;
    transform: none;
    border-radius: 5px;
    font-size: 1.55rem;
  }

  .carousel-prev {
    left: 12px;
  }

  .carousel-next {
    right: 12px;
  }

  .carousel-ui {
    bottom: 12px;
    max-width: calc(100% - 110px);
    gap: 8px;
    padding: 5px 8px;
  }

  .carousel-dots {
    gap: 6px;
  }

  .carousel-dot {
    width: 7px;
    height: 7px;
  }

  .carousel-dot.is-active {
    width: 20px;
  }

  .carousel-toggle {
    width: 24px;
    height: 24px;
  }

  /* Shared subpage safeguards */
  .hero,
  [class$="-hero"],
  [class*="-hero "] {
    min-height: 0;
  }

  .hero h1,
  [class$="-hero"] h1,
  [class*="-hero "] h1 {
    font-size: clamp(2.55rem, 12vw, 3.55rem) !important;
    line-height: 1.02;
  }

  .hero-actions,
  .proof-actions,
  .w100-actions,
  .award-actions,
  .case-actions,
  .download-actions,
  .reference-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions a,
  .proof-actions a,
  .w100-actions a,
  .award-actions a,
  .case-actions a,
  .download-actions a,
  .reference-actions a {
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .hero-facts,
  .benefit-strip,
  .mode-grid,
  .data-table > div,
  .technical-grid,
  .application-grid,
  .products-grid,
  .product-grid,
  .references-grid,
  .downloads-grid,
  .contact-grid,
  .contact-details,
  .case-grid,
  .industry-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-facts > div + div,
  .benefit-strip > div + div {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(7,60,172,.12);
  }

  .w60-hero,
  .technology-panel,
  .technical-section,
  .installation-gallery,
  .w60-intro,
  .w60-proof,
  .w60-consulting,
  .i500-hero,
  .i500-intro,
  .i500-section {
    grid-template-columns: 1fr !important;
  }

  .w60-hero-visual,
  .technology-image,
  .production-visual,
  .award-document {
    min-height: 260px !important;
    padding: 1.25rem !important;
  }

  .installation-gallery figure,
  .commercial-installation img,
  .tv-image {
    min-height: 0 !important;
    height: 260px !important;
  }

  .intro-note {
    grid-column: auto !important;
  }

  .data-table dd {
    text-align: left;
  }

  .footer {
    padding-left: 18px;
    padding-right: 18px;
    text-align: center;
  }

  .footer .legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 12px 0 0;
  }

  .legal-links-fixed {
    position: static;
    justify-content: center;
    margin: 0;
    border-radius: 0;
  }
}

@media (max-width: 380px) {
  .language:not(.language-links) span {
    display: none;
  }

  .menu-toggle {
    padding-inline: 9px !important;
  }

  .unified-slide,
  .slide-contact {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .unified-copy :is(h1,h2),
  .tech-template .unified-copy :is(h1,h2),
  .history-template .unified-copy :is(h1,h2),
  .products-template .unified-copy :is(h1,h2),
  .validation-template .unified-copy :is(h1,h2),
  .contact-copy :is(h1,h2) {
    font-size: 2.08rem !important;
  }
}
