/* Home — variante A «Midea, evoluto» · B2B (brief/b2b-installatori.md §5.1). Only home-specific rules; header, footer,
   buttons, cards, quotation list, tech panel, search, quick add and switcher come from base.css + theme.js.
   Shopify: sections/hero-carousel, collection-list, collection-banner-tabs, image-with-text, featured-collection,
   trust band, «per i negozi», newsletter → each block below maps to one of them. */

.home-a { overflow-x: clip; }
.home-a h1, .home-a h2, .home-a h3 { text-wrap: balance; }
.home-a p { text-wrap: pretty; }
.ha-h2 { margin-top: 12px; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.1; letter-spacing: -0.025em; }
.ha-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: clamp(32px, 4vw, 56px); }
.ha-head__lead { margin-top: 16px; } /* lead under the title, when the right side of the head holds controls */
.ha-head > .tabs__list { flex: none; } /* the title wraps, the tabs never scroll */

/* ---------- hero carousel ---------- */
.ha-hero { position: relative; height: calc(92vh - var(--header-height)); min-height: 560px; max-height: 980px; overflow: hidden; background: var(--color-deep); color: #fff; }
.ha-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 1s var(--ease-out), visibility 1s; }
.ha-slide.is-on { opacity: 1; visibility: visible; z-index: 1; }
.ha-slide picture, .ha-slide img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* slow push-in that starts after the crossfade, from scale(1): an incoming slide is never larger than the first one,
   so it never becomes a later LCP candidate for visitors who just watch (FV-P5) */
.ha-slide img { object-fit: cover; transform: none; transition: transform 3s linear 1s; } /* 1 s crossfade + 3 s push-in = DUR 4000 ms */
.ha-slide:not(.is-on) img { transition: transform 0s linear 1s; } /* reset only once the slide has faded out */
.ha-slide.is-on img { transform: scale(1.06); }
/* scrim behind the text column: eyebrow and paragraph ≥ 4.5:1, title ≥ 3:1 even over the lightest photos */
.ha-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(0 40 76 / 0.8) 0%, rgb(0 40 76 / 0.66) 40%, rgb(0 40 76 / 0.48) 58%, rgb(0 40 76 / 0) 80%), linear-gradient(0deg, rgb(0 40 76 / 0.45), rgb(0 40 76 / 0) 38%); }
.ha-slide__body { position: absolute; left: 0; right: 0; bottom: clamp(120px, 15vh, 168px); z-index: 2; }
.ha-slide__txt { grid-column: 1 / 8; }
.ha-slide__k { font-size: 14px; line-height: 1.35; font-weight: var(--font-weight-semibold); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.92; }
.ha-slide__h { margin: 18px 0; font-size: clamp(40px, 4.4vw, 64px); line-height: 1.06; letter-spacing: -0.03em; font-weight: var(--font-weight-medium); }
.ha-ln { display: block; overflow: hidden; padding-bottom: 0.06em; }
.ha-ln > span { display: block; transform: translateY(105%); transition: transform 1s var(--ease-out); }
.ha-slide.is-on .ha-ln > span { transform: none; }
.ha-slide.is-on .ha-ln:nth-child(2) > span { transition-delay: 0.12s; }
.ha-slide__p { max-width: 46ch; font-size: 20px; line-height: 1.5; opacity: 0; transform: translateY(12px); transition: opacity 0.8s 0.3s, transform 0.8s 0.3s var(--ease-out); }
.ha-slide.is-on .ha-slide__p { opacity: 0.95; transform: none; }
.ha-slide__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; opacity: 0; transition: opacity 0.8s 0.45s; }
.ha-slide.is-on .ha-slide__cta { opacity: 1; }
.ha-slide__cta .button { min-height: 52px; padding: 0 30px; }
.ha-hero__ui { position: absolute; left: 0; right: 0; bottom: 40px; z-index: 3; }
.ha-hero__ui .page-width { display: flex; align-items: flex-end; gap: 32px; }
.ha-dots { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 168px)); gap: 20px; list-style: none; padding: 0; }
.ha-dot { display: block; width: 100%; min-height: var(--touch-target); padding: 12px 0 0; text-align: left; color: #fff; }
.ha-dot__l { display: block; font-size: 14px; line-height: 1; font-weight: var(--font-weight-medium); opacity: 0.72; transition: opacity var(--duration-base); }
.ha-dot__l b { margin-right: 4px; font-weight: var(--font-weight-semibold); }
.ha-dot[aria-current="true"] .ha-dot__l, .ha-dot:hover .ha-dot__l { opacity: 1; }
.ha-dot__bar { display: block; height: 2px; margin-top: 12px; background: rgb(255 255 255 / 0.35); overflow: hidden; }
.ha-dot__bar i { display: block; width: 100%; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; }
.ha-ctrl, .ha-rail-ctrl { display: flex; gap: 8px; }
.ha-round { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / 0.75); color: #fff; transition: background-color var(--duration-base), color var(--duration-base), border-color var(--duration-base); }
.ha-round:hover { background: #fff; color: var(--color-deep); }
.ha-round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ha-round:focus-visible { border-radius: 50%; }
.ha-round--line { border-color: var(--color-border); color: var(--color-foreground); }
.ha-round--line:hover { background: var(--color-deep); border-color: var(--color-deep); color: #fff; }
.ha-round--line:disabled { opacity: 0.35; cursor: default; background: none; color: var(--color-foreground); border-color: var(--color-border); }

/* ---------- categories: white cards, product cropped to its own edges → common baseline ---------- */
.ha-cats { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--grid-gap); list-style: none; padding: 0; }
.ha-cats > li { display: flex; grid-column: span 4; }
.ha-cats > li.ha-cat-l { grid-column: span 4; }
.ha-cat { flex: 1; display: grid; grid-template-rows: auto 1fr auto; padding: 28px 28px 26px; background: #fff; border-radius: var(--radius-card); transition: translate 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out); }
.ha-cat:hover { translate: 0 -4px; box-shadow: var(--shadow-md); }
.ha-cat h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; font-weight: var(--font-weight-medium); }
.ha-cat-l .ha-cat h3 { font-size: 26px; }
.ha-cat p { max-width: 32ch; margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--color-muted); }
.ha-cat__media { --mh: 190px; align-self: end; display: flex; align-items: flex-end; justify-content: center; height: var(--mh); margin: 28px 0 22px; }
.ha-cat-l .ha-cat__media { --mh: 250px; }
.ha-crop { position: relative; flex: none; overflow: hidden; aspect-ratio: var(--ar); width: min(100%, calc(var(--mh) * var(--ar))); transform-origin: 50% 100%; transition: transform 0.7s var(--ease-out); }
.ha-crop img { position: absolute; max-width: none; width: var(--w); height: auto; left: var(--x); top: var(--y); }
.ha-cat:hover .ha-crop { transform: scale(1.04); }
.ha-cat .link { padding-top: 18px; border-top: 1px solid var(--color-border); }

/* spec-as-visual tile (no official photo) and service tile */
.ha-cat__fig { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 10px; }
.ha-fig__v { white-space: nowrap; font-size: clamp(36px, 3.4vw, 48px); line-height: 1; letter-spacing: -0.03em; font-weight: var(--font-weight-light); color: var(--color-deep); font-variant-numeric: tabular-nums; }
.ha-fig__l { font-size: 13px; line-height: 1.4; color: var(--color-muted); }
.ha-cat--deep { background: var(--color-deep); color: #fff; }
.ha-cat--deep p { color: rgb(255 255 255 / 0.8); }
.ha-cat--deep .link { color: #fff; border-top-color: rgb(255 255 255 / 0.2); }
.ha-steps { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 0; padding: 0; list-style: none; }
.ha-steps li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid rgb(255 255 255 / 0.18); font-size: 15px; font-weight: var(--font-weight-medium); }
.ha-steps .icon { width: 20px; height: 20px; opacity: 0.85; }

/* ---------- distributor trust band ---------- */
.ha-trust { padding-block: clamp(64px, 7vw, 104px); border-bottom: 1px solid var(--color-border); }
.ha-trust .grid { align-items: start; }
.ha-trust__intro { grid-column: 1 / 6; }
.ha-trust__lockup { margin-bottom: 28px; font-size: 14px; gap: 14px; }
.ha-trust__lockup img { height: 36px; }
.ha-trust__lockup .cobrand__rule { height: 32px; }
.ha-trust__lead { margin-top: 16px; }
.ha-trust__list { grid-column: 7 / 13; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); padding: 0; list-style: none; }
.ha-trust__list li { padding-top: 22px; border-top: 1px solid var(--color-foreground); }
.ha-trust__list svg { width: 32px; height: 32px; fill: none; stroke: var(--color-primary); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ha-trust__list h3 { margin-top: 18px; font-size: 17px; line-height: 1.3; font-weight: var(--font-weight-semibold); }
.ha-trust__list p { margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--color-muted); }

/* ---------- storage banner with tabs ---------- */
.ha-clima { padding-top: var(--space-section); } /* same breathing room as the other sections (head above the full-bleed band) */
.ha-band { position: relative; height: min(78vh, 760px); min-height: 520px; overflow: hidden; background: var(--color-surface); }
.ha-pane { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.8s var(--ease-out), visibility 0.8s; }
.ha-pane.is-on { opacity: 1; visibility: visible; }
.ha-pane picture, .ha-pane > picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ha-pane > picture img { object-fit: cover; transform: scale(1.04); transition: transform 6s var(--ease-out); }
.ha-pane.is-on > picture img { transform: scale(1); }
.ha-pane .page-width { position: relative; height: 100%; }
.ha-pcard { position: absolute; left: var(--gutter); bottom: 48px; width: min(420px, calc(100% - 2 * var(--gutter))); padding: 28px 30px 30px; background: rgb(255 255 255 / 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: var(--radius-card); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(16px); transition: opacity 0.7s 0.2s, transform 0.7s 0.2s var(--ease-out); }
.ha-pane.is-on .ha-pcard { opacity: 1; transform: none; }
.ha-pcard h3 { margin: 8px 0 18px; font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; font-weight: var(--font-weight-medium); }
.ha-specs { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; padding: 0; border-block: 1px solid var(--color-border); }
.ha-specs li { padding: 14px 0 14px 14px; border-left: 1px solid var(--color-border); }
.ha-specs li:first-child { padding-left: 0; border-left: 0; }
.ha-specs b { display: block; font-size: 20px; line-height: 1.15; letter-spacing: -0.01em; font-weight: var(--font-weight-medium); white-space: nowrap; }
.ha-specs li > span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; color: var(--color-muted); }
.ha-pcard__kit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; margin-top: 14px; }
.ha-pcard__kit p { font-size: 13px; color: var(--color-muted); }
.ha-pcard__kit ul { display: flex; flex-wrap: wrap; gap: 0 14px; padding: 0; list-style: none; }
.ha-pcard__kit a { display: inline-flex; align-items: center; min-height: 32px; font-size: 14px; font-weight: var(--font-weight-semibold); color: var(--color-link); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color var(--duration-fast); }
.ha-pcard__kit a:hover { text-decoration-color: currentColor; }
.ha-pcard__f { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- product rail (shared <product-card>) ---------- */
.ha-rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * var(--grid-gap)) / 4); gap: var(--grid-gap); margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 24px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; list-style: none; }
.ha-rail::-webkit-scrollbar { display: none; }
.ha-rail > li { scroll-snap-align: start; }
.ha-rail product-card { height: 100%; }

/* ---------- assistenza tecnica diretta (image with text) ---------- */
/* the photo column takes exactly the text column's height (eyebrow top → buttons bottom): the image is absolute,
   so only the text sizes the row */
.ha-svc { align-items: stretch; }
.ha-svc__img { position: relative; grid-column: 1 / 7; border-radius: var(--radius-card); overflow: hidden; }
.ha-svc__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ha-svc__txt { grid-column: 8 / 13; }
.ha-svc__list { margin-top: 28px; padding: 0; border-top: 1px solid var(--color-border); list-style: none; }
.ha-svc__list li { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.ha-svc__list svg { width: 36px; height: 36px; fill: none; stroke: var(--color-primary); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ha-svc__list h3 { font-size: 17px; line-height: 1.35; font-weight: var(--font-weight-semibold); }
.ha-svc__list p { margin-top: 4px; font-size: 15px; color: var(--color-muted); }
.ha-svc__lead { margin-top: 16px; }
.ha-svc__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- per i negozi di elettronica: intro and actions left, the four services right (list of the services block) ---------- */
.ha-shop .grid { align-items: start; }
.ha-shop__intro { grid-column: 1 / 7; }
.ha-shop__intro .lead { margin-top: 16px; }
.ha-shop__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.ha-shop__list { grid-column: 8 / 13; margin-top: 0; }

/* ---------- newsletter ---------- */
.ha-news { padding-block: clamp(56px, 6vw, 88px); }
.ha-news .grid { align-items: center; }
.ha-news__t { grid-column: 1 / 6; }
.ha-news h2 { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.15; letter-spacing: -0.02em; font-weight: var(--font-weight-medium); }
.ha-news p { margin-top: 12px; color: rgb(255 255 255 / 0.82); }
.ha-news__f { grid-column: 7 / 13; }
.ha-field { display: flex; gap: 10px; padding: 6px; background: #fff; border-radius: var(--radius-pill); }
.ha-field input { flex: 1; min-width: 0; padding: 0 20px; border: 0; background: none; color: var(--color-foreground); font-size: 16px; outline: none; }
.ha-field:focus-within { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.ha-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13px; line-height: 1.5; color: rgb(255 255 255 / 0.82); }
.ha-consent input { flex: none; width: 16px; height: 16px; margin-top: 3px; accent-color: var(--color-primary); }
.ha-msg { min-height: 21px; margin-top: 14px; font-size: 15px; font-weight: var(--font-weight-medium); color: #fff !important; }

/* ---------- reveals: .is-in comes from Theme.reveal (core: IO + 1.5 s safety net) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js:not(.ha-still) .ha-rv:not(.is-in) { opacity: 0; transform: translateY(24px); }
  .js .ha-rv { transition: opacity var(--duration-reveal) var(--ease-out), transform var(--duration-reveal) var(--ease-out); }
  .js:not(.ha-still) .ha-rvg:not(.is-in) > * { opacity: 0; transform: translateY(24px); }
  .js .ha-rvg > * { transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
}
/* reduced motion: hero/tabs keep their slower crossfade (core caps crossfades at 200 ms) */
@media (prefers-reduced-motion: reduce) {
  .ha-slide, .ha-pane { transition: opacity 0.8s linear, visibility 0.8s !important; }
  .ha-slide img, .ha-pane > picture img, .ha-ln > span, .ha-slide__p, .ha-pcard { transform: none !important; }
  .ha-slide__p, .ha-slide__cta, .ha-pcard { opacity: 1; }
  .ha-cat:hover, .home-a .card:hover { translate: none; }
  .ha-cat:hover .ha-crop { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .ha-trust__intro, .ha-trust__list { grid-column: 1 / -1; }
  .ha-trust__list { margin-top: 32px; }
  .ha-rail { grid-auto-columns: calc((100% - 2 * var(--grid-gap)) / 3); }
  .ha-svc__img { grid-column: 1 / -1; min-height: 0; aspect-ratio: 16 / 10; }
  .ha-svc__txt { grid-column: 1 / -1; margin-top: 16px; }
  .ha-shop__intro, .ha-shop__list { grid-column: 1 / -1; }
  .ha-shop__list { margin-top: 36px; }
}
@media (max-width: 768px) {
  .ha-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .ha-hero { height: calc(84svh - var(--header-height)); min-height: 540px; }
  .ha-slide::after { background: linear-gradient(0deg, rgb(0 40 76 / 0.92) 0%, rgb(0 40 76 / 0.8) 38%, rgb(0 40 76 / 0.68) 62%, rgb(0 40 76 / 0.4) 78%, rgb(0 40 76 / 0) 92%); }
  .ha-slide__body { bottom: 104px; text-align: center; }
  .ha-slide__txt { grid-column: 1 / -1; }
  .ha-slide__h { margin: 12px 0; font-size: 34px; line-height: 1.08; }
  .ha-slide__p { margin: 0 auto; font-size: 16px; }
  .ha-slide__cta { flex-direction: column; align-items: stretch; width: min(100%, 320px); gap: 10px; margin: 22px auto 0; }
  .ha-slide__cta .button { min-height: 48px; }
  .ha-hero__ui { bottom: 22px; }
  .ha-dots { gap: 10px; }
  .ha-dot__l { font-size: 12px; text-align: center; }
  .ha-dot__l b { margin-right: 0; }
  .ha-rail-ctrl, [data-hero-prev], [data-hero-next] { display: none; } /* keep pause: the only way to stop the rotation on touch (fix-home §4) */
  /* pause on touch: a compact frosted control centred on the dots row, so it reads as part of the slide nav */
  .ha-hero__ui .page-width { align-items: center; gap: 16px; }
  .ha-ctrl [data-hero-play] { width: var(--touch-target); height: var(--touch-target); background: rgb(255 255 255 / 0.14); border-color: rgb(255 255 255 / 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .ha-ctrl [data-hero-play]:hover { background: #fff; color: var(--color-deep); }
  .ha-dot__n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* hidden, but still part of the dot's name */
  .ha-cats > li, .ha-cats > li.ha-cat-l { grid-column: span 6; }
  .ha-cats > li:first-child, .ha-cats > li:last-child { grid-column: 1 / -1; }
  .ha-fig__v { font-size: 26px; }
  .ha-cats > li:last-child .ha-cat p { display: block; }
  .ha-cats > li:last-child .ha-cat h3 { font-size: 22px; }
  .ha-cats > li:last-child .ha-cat__media { --mh: auto; height: auto; }
  .ha-trust__list { grid-template-columns: 1fr; gap: 0; }
  .ha-trust__list li { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 18px 0; }
  .ha-trust__list li svg { grid-row: span 2; }
  .ha-trust__list h3 { margin-top: 0; }
  .ha-cat { padding: 18px 16px 16px; }
  .ha-cat h3, .ha-cat-l .ha-cat h3 { font-size: 18px; }
  .ha-cat p { display: none; }
  .ha-cats > li:first-child .ha-cat p { display: block; }
  .ha-cats > li:first-child .ha-cat h3 { font-size: 24px; }
  .ha-cat__media, .ha-cat-l .ha-cat__media { --mh: 128px; margin: 18px 0 14px; }
  .ha-cats > li:first-child .ha-cat__media { --mh: 150px; }
  .tabs__list { display: flex; width: 100%; border-radius: 26px; }
  .tabs__tab { flex: 1 1 0; min-width: 0; padding: 6px 10px; font-size: 13px; line-height: 1.25; white-space: normal; border-radius: 22px; }
  .ha-band { height: auto; min-height: 0; overflow: visible; background: none; }
  .ha-pane { position: relative; display: none; }
  .ha-pane.is-on { display: block; }
  .ha-pane picture { position: relative; display: block; }
  .ha-pane > picture img { position: relative; height: auto; aspect-ratio: 4 / 5; }
  .ha-pane .page-width { height: auto; }
  .ha-pcard { position: relative; left: auto; bottom: auto; width: auto; margin-top: -64px; padding: 22px; }
  .ha-pcard h3 { font-size: 22px; }
  .ha-pcard__f .button { flex: 1 1 0; padding: 0 12px; } /* both actions on one row */
  .ha-rail { grid-auto-columns: 84%; }
  .ha-shop__cta .button { flex: 1 1 100%; min-height: 52px; padding: 12px 24px; white-space: normal; text-align: center; line-height: 1.25; }
  .ha-svc__cta .button { flex: 1 1 100%; }
  .ha-news__t, .ha-news__f { grid-column: 1 / -1; }
  .ha-news__f { margin-top: 20px; }
  .ha-field { flex-direction: column; padding: 8px; border-radius: 20px; }
  .ha-field input { min-height: 48px; padding: 0 14px; }
  .footer { padding-bottom: 80px; }
}
/* 1101–1280: one more column for the text, so title and buttons keep their lines */
@media (min-width: 1101px) and (max-width: 1280px) { .ha-svc__img { grid-column: 1 / 6; } .ha-svc__txt { grid-column: 7 / 13; } }
