/* PORT AZUR mobile-layout refinement.
   Loaded after legacy styles; strictly scoped to mobile/tablet widths. */
@media (max-width: 780px) {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { max-width:100%; overflow-x:clip; }
  body { -webkit-text-size-adjust:100%; }
  .container, main > .container { width:100% !important; max-width:100% !important; padding-inline:18px !important; }
  h1, h2, h3 { overflow-wrap:normal; text-wrap:balance; }
  button, a, input, select, textarea { touch-action:manipulation; }

  /* Mobile identity and navigation: generous hit targets, avoid collisions */
  .site-header-v4 .header-menu-v4 {
    min-height:44px !important; height:44px !important;
    padding:0 15px !important; font-size:12px !important;
  }
  .site-header-v4 .header-brand-v4 { min-width:0 !important; }
  .site-header-v4 .header-logo-v4 { flex-shrink:0; }
  .site-header-v4 .header-center-v4.open {
    max-height:calc(100dvh - 70px);
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .site-header-v4 .header-center-v4.open .header-nav-row-v4 a {
    min-height:44px;
    align-items:center;
  }

  /* Shared section rhythm: desktop's 770px minimum must not survive on mobile */
  main.pa-materials .pa-section,
  main.pa-materials .pa-hero,
  main.services-v4 .service-v4-hero,
  main.company-v3 .company-v3-hero,
  main > .page-hero,
  main > .block.technical-request-v105b,
  main > .block.technical-quick-v105b,
  main > .block.technical-hub-v105b,
  main.home-hero-client,
  main .stage2-home-exact,
  body.home-client-v1 main > .hero,
  main.pa-contacts .pa-contact-details {
    min-height:0 !important; height:auto !important;
  }
  main.pa-materials .pa-section,
  main > .block.technical-hub-v105b,
  main > .block.technical-quick-v105b,
  main > .block.technical-request-v105b {
    padding-block:34px !important;
  }
  main > .page-hero { padding-block:52px 42px !important; }
  main.pa-materials .pa-hero { padding-block:32px 42px !important; }

  /* Full-bleed hero text requires contrast over photos/video */
  body.home-client-v1 .home-hero-client,
  main.services-v4 .service-v4-hero,
  main.company-v3 .company-v3-hero,
  main.pa-materials .pa-materials-hero { isolation:isolate; }
  body.home-client-v1 .home-hero-client::after {
    content:""; position:absolute; inset:0; pointer-events:none;
    background:linear-gradient(90deg,rgba(0,8,16,.62),rgba(0,8,16,.28)),
               linear-gradient(0deg,rgba(0,8,16,.50),transparent 40%);
    z-index:0;
  }
  body.home-client-v1 .home-hero-client .hero-content,
  body.home-client-v1 .home-hero-client .container { position:relative; z-index:1; }
  body.home-client-v1 .home-hero-client .home-hero-lead {
    font-size:clamp(16px,4.1vw,18px) !important;
    line-height:1.52 !important;
    max-width:36ch;
    color:#eef6ff !important;
    text-shadow:0 2px 14px rgba(0,0,0,.72);
  }
  body.home-client-v1 .home-hero-client h1 {
    font-size:clamp(34px,9vw,43px) !important;
    line-height:1.08 !important;
    letter-spacing:0 !important;
  }
  body.home-client-v1 .home-hero-client .hero-routes { gap:10px !important; }
  body.home-client-v1 .home-hero-client .hero-route {
    min-height:54px !important; padding:12px 14px !important;
  }

  /* Services: kicker over heading, natural content/table height */
  main.services-v4 .service-v4-hero { padding-block:30px 40px !important; }
  main.services-v4 .service-v4-list { padding-block:34px !important; }
  main.services-v4 .service-v4-block {
    height:auto !important; min-height:0 !important;
    padding:26px 0 !important;
  }
  main.services-v4 .service-v4-block-head {
    display:flex !important; flex-direction:column !important;
    align-items:flex-start !important; gap:9px !important;
    height:auto !important; min-height:0 !important;
    margin:0 0 17px !important;
  }
  main.services-v4 .service-v4-block-head .service-v4-block-kicker {
    display:block !important; position:static !important;
    width:100% !important; max-width:none !important;
    font-size:11px !important; line-height:1.5 !important;
    letter-spacing:.08em !important;
  }
  main.services-v4 .service-v4-block-head h2 {
    display:block !important; position:static !important;
    width:100% !important; max-width:none !important;
    margin:0 !important; padding:0 !important;
    font-size:clamp(26px,7.2vw,33px) !important;
    line-height:1.09 !important;
    text-wrap:balance;
  }
  main.services-v4 .service-v4-grid {
    display:flex !important; flex-direction:column !important;
    gap:14px !important;
    grid-template-rows:none !important;
    height:auto !important; min-height:0 !important;
    overflow:visible !important;
  }
  main.services-v4 .service-v4-grid > figure {
    margin:0 !important; height:auto !important; min-height:0 !important;
    aspect-ratio:4 / 3;
    flex:none !important;
  }
  main.services-v4 .service-v4-grid > figure img {
    width:100% !important; height:100% !important;
    object-fit:cover !important;
  }
  main.services-v4 .service-v4-copy {
    display:block !important; overflow:visible !important;
    height:auto !important; max-height:none !important;
    min-height:0 !important;
    flex:none !important;
  }
  main.services-v4 .service-v4-specs {
    display:table !important; position:static !important;
    width:100% !important; max-width:100% !important;
    height:auto !important; max-height:none !important;
    opacity:1 !important; visibility:visible !important;
    table-layout:fixed !important; margin:12px 0 0 !important;
  }
  main.services-v4 .service-v4-specs th,
  main.services-v4 .service-v4-specs td {
    font-size:13px !important; line-height:1.36 !important;
    overflow-wrap:anywhere; white-space:normal !important;
    padding:9px 8px !important; vertical-align:top;
  }
  main.services-v4 .service-v4-grid > .service-v4-block-action {
    position:static !important; flex:none !important;
    margin:2px 0 0 !important;
    min-height:48px !important; height:auto !important;
    padding:12px 14px !important;
  }
  main.services-v4 .service-v4-cta { min-height:0 !important; height:auto !important; padding-block:38px !important; }
  main.services-v4 .service-v4-cta p { line-height:1.5 !important; }

  /* Company: retain editorial layout while freeing cramped two-column stats */
  main.company-v3 .company-v3-hero { padding-block:30px 42px !important; }
  main.company-v3 .company-v3-block,
  main.company-v3 .company-v3-partners {
    min-height:0 !important; height:auto !important;
    padding-block:26px !important;
  }
  main.company-v3 .company-v3-block-head { margin-bottom:17px !important; }
  main.company-v3 .company-v3-block-head h2 {
    font-size:clamp(27px,7.2vw,34px) !important;
    line-height:1.1 !important;
    overflow-wrap:anywhere;
  }
  main.company-v3 .company-v3-block-grid { height:auto !important; min-height:0 !important; }
  main.company-v3 .company-v3-block-grid figure {
    min-height:0 !important; height:auto !important; aspect-ratio:16/10;
  }
  main.company-v3 .company-v3-block-grid figure img {
    width:100% !important; height:100% !important; object-fit:cover !important;
  }
  main.company-v3 .stage2-warehouse-topline {
    display:grid !important; grid-template-columns:1fr 1fr !important;
    gap:12px !important; align-items:start !important;
  }
  main.company-v3 .stage2-warehouse-place,
  main.company-v3 .stage2-warehouse-stat {
    min-width:0 !important; max-width:100% !important; width:auto !important;
    text-align:left !important;
  }
  main.company-v3 .stage2-warehouse-stat strong { font-size:clamp(20px,5.2vw,25px) !important; white-space:nowrap !important; }
  main.company-v3 .stage2-warehouse-meta-label {
    display:flex !important; align-items:flex-start !important;
    gap:4px !important; font-size:10px !important; line-height:1.35 !important;
    min-width:0 !important; max-width:100% !important;
    overflow-wrap:anywhere !important; white-space:normal !important;
  }
  main.company-v3 .stage2-stock-topline {
    grid-template-columns:1fr 1fr !important; gap:10px !important;
  }
  main.company-v3 .stage2-meta-item {
    min-width:0 !important; text-align:left !important;
    overflow-wrap:anywhere !important;
  }
  main.company-v3 .stage2-meta-item strong {
    font-size:clamp(11px,3vw,13px) !important; line-height:1.3 !important;
  }
  main.company-v3 .company-v3-list li,
  main.company-v3 .stage2-warehouse-list li,
  main.company-v3 .stage2-stock-list li {
    text-align:left !important;
    justify-content:flex-start !important;
  }
  main.company-v3 .partners-clean-grid {
    display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
  }
  main.company-v3 .partner-clean-card {
    min-width:0 !important; height:auto !important; min-height:0 !important;
    padding:10px !important;
  }
  main.company-v3 .partner-clean-logo-stage {
    height:96px !important; min-height:0 !important;
    padding:7px !important;
  }
  main.company-v3 .partner-clean-logo-stage img {
    width:100% !important; max-height:82px !important; object-fit:contain !important;
  }
  main.company-v3 .partner-clean-name {
    font-size:11px !important; line-height:1.35 !important;
    overflow-wrap:break-word;
  }

  /* Material pages: remove desktop min-height slabs, preserve actual text/photos */
  main.pa-materials .pa-section { padding-block:34px !important; }
  main.pa-materials .pa-section-divider-final { margin-block:0 !important; }
  main.pa-materials .pa-materials-hero { padding-block:32px 42px !important; }
  main.pa-materials .pa-section h2 { line-height:1.12 !important; }
  main.pa-materials .pa-request-spec { padding-bottom:38px !important; }
  main.pa-materials input, main.pa-materials select, main.pa-materials textarea {
    max-width:100% !important;
  }

  /* Technical-center CTA was inheriting a full-viewport height */
  main > .block.technical-request-v105b { padding-block:34px !important; }
  main > .block.technical-request-v105b .container { min-height:0 !important; }
  main > .block.technical-quick-v105b,
  main > .block.technical-hub-v105b { padding-block:34px !important; }

  /* Contacts: labels above long company IDs and bank details; map not a blank skyscraper */
  main.pa-contacts .pa-contact-details { padding-block:30px 36px !important; }
  main.pa-contacts .pa-contact-card dl > div {
    display:grid !important; grid-template-columns:1fr !important;
    gap:3px !important; padding:10px 0 !important;
  }
  main.pa-contacts .pa-contact-card dt { font-size:12px !important; line-height:1.25 !important; }
  main.pa-contacts .pa-contact-card dd {
    font-size:15px !important; line-height:1.4 !important;
    margin:0 !important; overflow-wrap:anywhere !important;
  }
  main.pa-contacts .pa-route-map-wrap { height:315px !important; min-height:315px !important; }
  main.pa-contacts .pa-route-map-wrap iframe { height:100% !important; min-height:0 !important; }
  main.pa-contacts .pa-route-logistics { gap:0 !important; }

  /* Unified footer: two concise columns rather than 700px of isolated links */
  footer.site-footer { padding:30px 0 20px !important; min-height:0 !important; }
  footer.site-footer .footer-grid {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:22px 18px !important; align-items:start !important;
  }
  footer.site-footer .footer-grid > div {
    min-width:0 !important; margin:0 !important; padding:0 !important;
  }
  footer.site-footer .footer-grid > div:first-child { grid-column:1/-1 !important; }
  footer.site-footer .footer-grid h4 {
    font-size:11px !important; line-height:1.4 !important;
    margin:0 0 8px !important;
  }
  footer.site-footer .footer-grid a:not(.footer-brand-lockup-v4) {
    display:block; font-size:13px !important; line-height:1.5 !important;
    margin:0 0 7px !important; overflow-wrap:anywhere;
  }
  footer.site-footer .footer-brand-lockup-v4 { margin:0 !important; }
  footer.site-footer .footer-bottom { margin-top:20px !important; padding-top:14px !important; }
}
@media (max-width: 359px) {
  main.company-v3 .partners-clean-grid { grid-template-columns:1fr !important; }
  .container { padding-inline:15px !important; }
}

/* High-specificity guard against legacy viewport-height overrides injected for v4. */
@media (max-width:780px) {
  html[data-preview="v4"] body main.services-v4 section.service-v4-list article.service-v4-block {
    display:block!important;
    min-height:0!important; height:auto!important; max-height:none!important;
    overflow:visible!important; padding:28px 18px!important;
  }
  html[data-preview="v4"] body main.services-v4 section.service-v4-list article.service-v4-block .service-v4-grid {
    display:flex!important; flex-direction:column!important; flex-wrap:nowrap!important;
    align-items:stretch!important; gap:14px!important;
    grid-template-rows:none!important; grid-template-columns:none!important;
    height:auto!important; min-height:0!important; max-height:none!important;
    overflow:visible!important; flex:none!important;
  }
  html[data-preview="v4"] body main.services-v4 .service-v4-block .service-v4-grid .service-v4-copy {
    display:block!important; flex:none!important; flex-basis:auto!important;
    height:auto!important; min-height:0!important; max-height:none!important;
    overflow:visible!important; opacity:1!important;
  }
  html[data-preview="v4"] body main.services-v4 .service-v4-block .service-v4-grid .service-v4-specs {
    position:static!important; display:table!important; float:none!important;
    width:100%!important; height:auto!important;
    visibility:visible!important; opacity:1!important;
    margin:14px 0 0!important; overflow:visible!important;
  }
  html[data-preview="v4"] body main.services-v4 .service-v4-block .service-v4-grid .service-v4-block-action {
    position:static!important; align-self:stretch!important;
    margin:0!important; height:auto!important; min-height:48px!important;
    max-height:none!important; padding:12px 14px!important;
    flex:none!important;
  }
  html[data-preview="v4"] body main.pa-materials .pa-section,
  html[data-preview="v4"] body main.pa-materials .pa-materials-hero,
  html[data-preview="v4"] body main > section.technical-request-v105b,
  html[data-preview="v4"] body main > section.technical-hub-v105b,
  html[data-preview="v4"] body main > section.technical-quick-v105b {
    min-height:0!important; max-height:none!important; height:auto!important;
  }
  html[data-preview="v4"] body main.company-v3 .stage2-warehouse-topline .stage2-warehouse-stat {
    min-width:0!important; width:auto!important; max-width:100%!important;
    white-space:normal!important;
  }
  html[data-preview="v4"] body main.company-v3 .stage2-warehouse-topline .stage2-warehouse-stat .stage2-warehouse-meta-label {
    width:auto!important; max-width:100%!important; white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
}
@media (max-width:780px) {
  body.home-client-v1 .home-hero-client .hero-media video {
    filter:brightness(.48) saturate(.87)!important;
  }
}

@media(max-width:780px) {
  html[data-preview="v4"] body main.company-v3 .stage2-warehouse-block .stage2-warehouse-topline {
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:13px!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  html[data-preview="v4"] body main.company-v3 .stage2-warehouse-block .stage2-warehouse-topline .stage2-warehouse-place,
  html[data-preview="v4"] body main.company-v3 .stage2-warehouse-block .stage2-warehouse-topline .stage2-warehouse-stat {
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    align-items:flex-start!important;
    text-align:left!important;
    justify-content:flex-start!important;
    overflow-wrap:anywhere!important;
  }
  html[data-preview="v4"] body main.company-v3 .stage2-warehouse-block .stage2-warehouse-topline .stage2-warehouse-meta-label {
    position:static!important;
    display:flex!important;
    white-space:normal!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
}

@media(max-width:780px) {
  html[data-preview="v4"] body main.company-v3 .company-v3-assets .company-v3-block-head h2 {
    font-size:clamp(25px,6.6vw,30px)!important;
    line-height:1.12!important;
    letter-spacing:0!important;
    word-break:normal!important;
    overflow-wrap:anywhere!important;
  }
  html[data-preview="v4"] body main.company-v3 .stage2-warehouse-block .stage2-warehouse-action {
    margin-top:16px!important;
  }
  html[data-preview="v4"] body main.company-v3 .company-v3-assets .company-v3-partners .partners-clean-grid {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:auto!important;
    align-items:stretch!important;
    gap:11px!important;
    height:auto!important;
  }
  html[data-preview="v4"] body main.company-v3 .company-v3-assets .company-v3-partners .partners-clean-grid .partner-clean-card {
    width:auto!important; min-width:0!important;
    height:auto!important; min-height:0!important;
    padding:9px!important;
    display:flex!important; flex-direction:column!important;
  }
  html[data-preview="v4"] body main.company-v3 .company-v3-assets .company-v3-partners .partner-clean-logo-stage {
    width:100%!important; height:91px!important;
    min-height:0!important;
    flex:0 0 auto!important;
    padding:5px!important;
  }
  html[data-preview="v4"] body main.company-v3 .company-v3-assets .company-v3-partners .partner-clean-name {
    width:100%!important;
    font-size:11px!important; line-height:1.35!important;
    overflow-wrap:anywhere!important;
    margin-top:8px!important;
    text-align:center!important;
  }
}
@media(max-width:359px) {
  html[data-preview="v4"] body main.company-v3 .company-v3-assets .company-v3-partners .partners-clean-grid {
    grid-template-columns:1fr!important;
  }
}

@media(max-width:780px) {
  html[data-preview="v4"] body.home-client-v1 main .home-hero-client .hero-media video {
    filter:brightness(.33) contrast(.95) saturate(.85)!important;
  }
  html[data-preview="v4"] body main.pa-contacts .pa-contact-details .pa-contact-card dl > div {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:4px!important;
    min-height:0!important;
    padding:9px 0!important;
    align-items:start!important;
  }
  html[data-preview="v4"] body main.pa-contacts .pa-contact-details .pa-contact-card dl > div dt,
  html[data-preview="v4"] body main.pa-contacts .pa-contact-details .pa-contact-card dl > div dd {
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
    grid-column:1!important;
    padding:0!important;
  }
  html[data-preview="v4"] body main.pa-contacts .pa-contact-details .pa-contact-card dl > div dt {
    grid-row:1!important;
    font-size:12px!important;
    color:#84a9c4!important;
  }
  html[data-preview="v4"] body main.pa-contacts .pa-contact-details .pa-contact-card dl > div dd {
    grid-row:2!important;
    font-size:15px!important;
    line-height:1.4!important;
  }
  html[data-preview="v4"] body main.pa-contacts .pa-contact-details .pa-route-map-wrap {
    height:315px!important;
    min-height:315px!important;
    max-height:315px!important;
  }
  html[data-preview="v4"] body main.pa-contacts .pa-contact-details .pa-route-map-wrap iframe {
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
  }
}

@media(max-width:780px) {
  html[data-preview="v4"] body main .directory-filter-row-v105 button,
  html[data-preview="v4"] body main .directory-controls-v105d .directory-filter-row-v105 button {
    min-height:44px!important;
    padding:9px 12px!important;
    line-height:1.25!important;
  }
  html[data-preview="v4"] body main .directory-controls-v105d input,
  html[data-preview="v4"] body main .directory-controls-v105d select {
    min-height:44px!important;
    max-width:100%!important;
  }
}

/* Tablet portrait: avoid a desktop-sized one-line home headline at 768px. */
@media (min-width:681px) and (max-width:900px) {
  html[data-preview="v4"] body.home-client-v1 main .home-hero-client h1,
  html[data-preview="v4"] body.home-client-v1 main .home-hero-client h1 .hero-accent,
  html[data-preview="v4"] body.home-client-v1 main .home-hero-client h1 .hero-main-line {
    max-width:100%!important;
    width:auto!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
    text-wrap:balance;
    font-size:clamp(36px,6.6vw,54px)!important;
    line-height:1.08!important;
    letter-spacing:0!important;
  }
}

@media(min-width:681px) and (max-width:900px) {
  html[data-preview="v4"] body.home-client-v1 main section.home-hero-client .container .home-hero-copy h1 {
    width:100%!important; max-width:100%!important;
    font:900 clamp(36px,5.8vw,46px)/1.1 "a_MachinaOrto", sans-serif!important;
    white-space:normal!important;
  }
  html[data-preview="v4"] body.home-client-v1 main section.home-hero-client .container .home-hero-copy h1 span.hero-accent,
  html[data-preview="v4"] body.home-client-v1 main section.home-hero-client .container .home-hero-copy h1 span.hero-main-line {
    display:block!important;
    width:auto!important; min-width:0!important; max-width:100%!important;
    font-size:clamp(36px,5.8vw,46px)!important;
    line-height:1.1!important; white-space:normal!important;
    letter-spacing:0!important; transform:none!important;
    overflow-wrap:break-word!important;
  }
}
