/* ==========================================================================
   Shop Page Stylesheet (ATOSA catalogue)
   Inherits design variables and reset from style.css. Mirrors the language
   of projects.css (hero, sticky pill filter) with a product-grid tuned for
   catalogue cut-outs on light tiles.
   ========================================================================== */

/* Force navbar visibility on the shop pages (no preloader reveal here).
   Matches the homepage lockup: logo mark + "GLOBAL CONTRACT" wordmark. */
.main-header { opacity: 1 !important; }
.nav-logo-img { opacity: 1 !important; }
.logo-text { opacity: 1 !important; }

/* ==========================================================================
   PREMIUM CURTAIN INTRO (shop)
   Two panels split to reveal the catalogue; centered logo, "Shop" wordmark,
   subtitle, animated magenta hairline. GSAP timeline lives in shop.js.
   ========================================================================== */
.shop-intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  overflow: hidden;
}

.shop-intro-panel {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50.5%;
  background: var(--color-bg-dark);
  will-change: transform;
}
.shop-intro-panel-top {
  top: 0;
  border-bottom: 1px solid rgba(230, 35, 106, 0.12);
}
.shop-intro-panel-bottom {
  bottom: 0;
  border-top: 1px solid rgba(230, 35, 106, 0.12);
}

.shop-intro-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  text-align: center;
  padding: 0 1.5rem;
  will-change: transform, opacity;
}

.shop-intro-logo {
  width: 64px;
  height: auto;
  opacity: 0;
  transform: translateY(14px);
  filter: drop-shadow(0 0 22px rgba(230, 35, 106, 0.25));
  will-change: transform, opacity;
}

.shop-intro-word {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-white);
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
}

.shop-intro-sub {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--color-magenta-glow);
  opacity: 0;
  transform: translateY(12px);
  will-change: transform, opacity;
}

.shop-intro-line {
  position: relative;
  width: 180px;
  max-width: 60vw;
  height: 1px;
  margin-top: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.shop-intro-line-fill {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--color-magenta-deep), var(--color-magenta-glow));
  box-shadow: 0 0 12px rgba(230, 35, 106, 0.6);
  will-change: transform;
}

.shop-intro.intro-done { display: none; }

@media (max-width: 860px) {
  .shop-intro-logo { width: 52px; }
  .shop-intro-sub { font-size: 0.6rem; letter-spacing: 0.26em; text-indent: 0.26em; }
  .shop-intro-line { width: 130px; }
}

/* ---------- Floating Cart Button (circle, beside the navbar) ---------- */
.cart-fab {
  position: fixed;
  /* Vertically centered on the navbar pill (top 1.5rem + ~4px) */
  top: calc(1.5rem + 4px);
  /* Sit immediately to the right of the centered navbar pill
     (pill = max-width 800px, so its right edge is 50% + 400px), clamped
     so it never runs off the viewport on narrower desktops. */
  left: min(calc(50% + 400px + 0.7rem), calc(100% - 0.9rem - 46px));
  z-index: var(--z-header);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--color-white);
  background: linear-gradient(180deg, rgba(12, 12, 16, 0.72) 0%, rgba(12, 12, 16, 0.45) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
  /* transform-origin toward the navbar so the "birth" scale reads as
     emerging from the pill; JS drives the intro pop. */
  transform-origin: left center;
  transition: color 0.3s ease, transform 0.3s ease,
              background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease,
              top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-fab:hover {
  color: var(--color-magenta-glow);
  transform: translateY(-2px);
  border-color: rgba(230, 35, 106, 0.3);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
/* Match the navbar's scrolled shift so they move together */
.main-header.scrolled ~ .cart-fab {
  top: calc(1rem + 4px);
  background-color: rgba(12, 12, 16, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Hidden until the intro "births" it from the navbar (shop page) */
.cart-fab.fab-birth-pending {
  opacity: 0;
  transform: scale(0);
}
.cart-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--color-magenta-glow);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(230, 35, 106, 0.5);
}
.cart-badge.is-empty { display: none; }

/* ---------- variant count chip on the tile ---------- */
.product-variants {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3;
  padding: 0.3rem 0.62rem;
  border-radius: 100px;
  /* No backdrop-filter: this badge repeats on EVERY card in the catalogue, so
     on a 24-family grid the blur was two dozen separate backdrop resamples,
     all live while the reader scrolls. It sits on the card's own dark tile, so
     a solid fill at the same visual density is indistinguishable. */
  background: rgb(16, 16, 21);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-offwhite);
  font-family: var(--font-sans);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.35s ease, border-color 0.35s ease;
}
.product-card:hover .product-variants {
  color: #fff;
  border-color: rgba(230, 35, 106, 0.35);
}

/* ==========================================================================
   CATALOGUE LAYOUT — left sidebar filters + product grid (desktop)
   ========================================================================== */
.shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4.5rem;
  width: 92%;
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 11rem; /* clear fixed header (hero removed) */
}

/* ---------- Left sidebar filters (vertical, luxury) ---------- */
.shop-filter-container {
  position: sticky;
  top: 8.5rem;
  align-self: start;
  z-index: 90;
  display: flex;
  flex-direction: column;
}

/* ---------- Search ----------
   Sta sopra le categorie e non dentro la griglia: il catalogo ha 24 famiglie e
   oltre 200 codici modello, e chi arriva dal listino cerca "MBF8507", non
   "Armadi refrigerati". L'ago comprende i codici, vedi HAY in shop.js. */
.shop-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}
.shop-search-icon {
  position: absolute;
  left: 0.8rem;
  color: var(--color-gray-text);
  opacity: 0.7;
  pointer-events: none;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.shop-search-input {
  width: 100%;
  padding: 0.72rem 2.2rem 0.72rem 2.25rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 100px;
  color: var(--color-offwhite);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}
.shop-search-input::placeholder { color: var(--color-gray-text); opacity: 0.6; }
.shop-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(230, 35, 106, 0.45);
}
.shop-search:focus-within .shop-search-icon { color: var(--color-offwhite); opacity: 1; }
/* la X nativa di Safari duplicherebbe .shop-search-clear */
.shop-search-input::-webkit-search-decoration,
.shop-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.shop-search-clear {
  position: absolute;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-offwhite);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.shop-search-clear:hover { background: rgba(230, 35, 106, 0.35); color: #fff; }
/* display:inline-flex batte [hidden]{display:none} del reset: senza questa
   riga la X resta visibile a campo vuoto. */
.shop-search-clear[hidden] { display: none; }

/* ---------- Intestazione della griglia ---------- */
.shop-main-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.shop-count {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-gray-text);
}

.shop-filter-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-gray-text);
  padding-bottom: 1.5rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shop-filter-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

/* Vertical filter items — quiet, with a magenta marker on the active one */
.filter-btn {
  background: none;
  border: none;
  color: var(--color-offwhite);
  opacity: 0.5;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  /* Room for the marker is reserved permanently, and the resting state is
     pulled back over it by the transform below. Animating padding-left (which
     is what this did) relayouts the button and everything after it in the
     filter column for the length of the ease. The button is bare text here —
     no background, no border — so shifting it by a transform is the same
     picture. The mobile block turns these into bordered pills, but there the
     padding is static and unanimated, so this does not apply. */
  padding: 0.1rem 0 0.1rem 1.1rem;
  position: relative;
  text-align: left;
  transform: translateX(-1.1rem);
  transition: opacity 0.35s ease, color 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.filter-btn:hover { opacity: 0.85; color: var(--color-white); }
.filter-btn.active {
  color: var(--color-white);
  opacity: 1;
  transform: translateX(0);
}
/* Magenta marker slides in on the active item */
.filter-btn::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.55rem;
  height: 1px;
  background: linear-gradient(90deg, var(--color-magenta-deep), var(--color-magenta-glow));
  box-shadow: 0 0 8px rgba(230, 35, 106, 0.6);
  transform: translateY(-50%) scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.filter-btn.active::after { transform: translateY(-50%) scaleX(1); }

/* ---------- Product grid (right column) ---------- */
.shop-main {
  min-width: 0; /* allow grid to shrink within the layout track */
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2rem;
  width: 100%;
  margin: 0 0 4rem 0;
}

.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(24px);
  /* will-change ONLY while the card is still waiting to animate in. It used to
     be declared unconditionally, which on a 24-family catalogue meant two
     dozen permanent compositor layers — held for the whole session, long after
     the one-shot entrance had finished, on the devices with the least GPU
     memory to spare. Once .is-in has settled the card is static content and
     wants no layer of its own. */
  will-change: transform, opacity;
}
.product-card.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
/* Set by js/shop.js on transitionend — see the note on .product-card. The
   class, not .is-in, is what drops the layer: .is-in is added to START the
   transition, so clearing will-change there would drop the promotion for the
   0.7s that actually needs it. */
.product-card.is-settled {
  will-change: auto;
}

/* ---------- Tile prodotto ----------
   Scura come il resto del sito, possibile solo da quando le immagini sono
   scontornate (scripts/gcshop_cutout.py): i PNG del catalogo avevano il fondo
   bianco pieno e su tile scura si sarebbero visti come rettangoli.

   Il fondo NON è piatto. Metà di questi prodotti sono acciaio chiaro, ma i
   forni multifunzione e le vetrine da terra sono neri lucidi: su un nero
   uniforme sparirebbero. Il gradiente radiale in alto fa da luce di studio e
   stacca i corpi scuri, l'ellisse chiara in basso (::before) è la pozza di luce
   su cui il prodotto appoggia — le immagini sono allineate tutte sulla stessa
   baseline, quindi la pozza cade sotto il prodotto in ogni card.

   Nessun padding sull'img: il margine di sicurezza è già cotto dentro la tela
   900x1125 generata dallo script, ed è lo stesso per tutti. Aggiungerne altro
   qui rimpicciolirebbe i prodotti in modo diverso da card a card. */
.product-image-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(116% 74% at 50% 24%,
      rgba(255, 255, 255, 0.085) 0%,
      rgba(255, 255, 255, 0.022) 44%,
      rgba(255, 255, 255, 0) 74%),
    linear-gradient(180deg, #17171d 0%, #0e0e13 60%, #0a0a0e 100%);
  transition: border-color 0.45s ease,
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.55s ease;
}
/* pozza di luce alla base */
.product-image-tile::before {
  content: '';
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 6%;
  width: 60%;
  height: 8.5%;
  transform: translateX(-50%) scaleX(1);
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%,
    rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 72%);
  opacity: 0.7;
  /* scaleX, not width. The hover widened this from 60% to 68%, which is a
     layout property: 24 tiles in the grid, each one triggering layout+paint
     for the length of a 0.55s ease every time a finger or cursor passes over
     it. The element is centred by translateX(-50%) and its fill is a radial
     gradient with no border, so scaling it horizontally by 68/60 is visually
     the same thing, on the compositor. */
  transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-image-tile img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 88%;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

/* Skeleton finché l'immagine non ha finito di decodificare. Serve alle card
   sotto la piega: quelle sopra il cancello in shop.js le tiene nascoste finché
   l'immagine non è pronta, quindi lì lo shimmer non fa quasi mai in tempo. */
.product-image-tile.is-loading img { opacity: 0; }
.product-image-tile.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 36%,
    rgba(255, 255, 255, 0.045) 50%,
    rgba(255, 255, 255, 0) 64%);
  background-size: 220% 100%;
  animation: gc-shop-shimmer 1.3s linear infinite;
}
@keyframes gc-shop-shimmer {
  from { background-position: 140% 0; }
  to   { background-position: -40% 0; }
}

.product-card:hover .product-image-tile {
  transform: translateY(-3px);
  border-color: rgba(230, 35, 106, 0.28);
  box-shadow: 0 20px 46px -24px rgba(0, 0, 0, 0.95);
}
.product-card:hover .product-image-tile img { transform: scale(1.045); }
/* 68/60 = 1.1333 — the same widening the old `width: 68%` produced. */
.product-card:hover .product-image-tile::before { opacity: 1; transform: translateX(-50%) scaleX(1.1333); }
.product-card:focus-visible { outline: none; }
.product-card:focus-visible .product-image-tile {
  outline: 2px solid var(--color-magenta-glow);
  outline-offset: 3px;
}

.product-series {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-magenta-glow);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--color-white);
  line-height: 1.2;
  margin-bottom: 0.6rem;
  word-break: break-word;
  transition: color 0.35s ease;
}
.product-card:hover .product-name { color: var(--color-offwhite); }

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-bottom: 0.9rem;
}
.product-spec {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--color-gray-text);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.product-spec b {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.product-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.product-price {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: 0.01em;
}
.product-price .cur { color: var(--color-gray-text); font-weight: 400; font-size: 0.85rem; margin-right: 0.12rem; }
.product-vat {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gray-text);
  opacity: 0.7;
}

/* ---------- Empty + note ---------- */
.shop-empty {
  text-align: center;
  font-family: var(--font-sans);
  color: var(--color-gray-text);
  padding: 4rem 2rem 6rem;
}
.shop-note {
  width: 92%;
  max-width: 1360px;
  margin: 0 auto 6rem auto;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--color-gray-text);
  opacity: 0.6;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ==========================================================================
   PRODUCT DETAIL PAGE
   ========================================================================== */
.product-detail {
  width: 92%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 9.5rem 0 5rem;
}
.product-notfound {
  width: 92%; max-width: 700px; margin: 0 auto;
  padding: 11rem 0 8rem; text-align: center;
  font-family: var(--font-sans); color: var(--color-gray-text);
}
.product-notfound h1 { font-family: var(--font-serif); color: var(--color-white); font-weight: 300; font-size: 2.2rem; margin-bottom: 1rem; }
.product-notfound a { color: var(--color-magenta-glow); }

.product-back {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gray-text);
  text-decoration: none;
  margin-bottom: 2.4rem;
  transition: color 0.3s ease;
}
.product-back:hover { color: var(--color-white); }

.product-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 4rem;
  align-items: start;
}

/* Stessa luce della tile in griglia, così passando dalla card alla scheda il
   prodotto non cambia ambiente. Qui la tela è quadrata e l'immagine è 4:5,
   quindi il padding orizzontale se lo prende object-fit da solo. */
.product-gallery-tile {
  position: sticky;
  top: 7.5rem;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(112% 72% at 50% 24%,
      rgba(255, 255, 255, 0.09) 0%,
      rgba(255, 255, 255, 0.024) 44%,
      rgba(255, 255, 255, 0) 74%),
    linear-gradient(180deg, #17171d 0%, #0e0e13 60%, #0a0a0e 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-gallery-tile img { width: 100%; height: 100%; object-fit: contain; padding: 1.2rem; }

.product-cat-tag {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-magenta-glow);
}
.product-h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 1.12;
  color: var(--color-white);
  margin: 0.8rem 0 1.4rem;
}
.product-priceblock { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 2rem; }
.product-bigprice {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 2rem;
  color: var(--color-white);
  transition: opacity 0.2s ease;
}
.product-bigprice .cur { color: var(--color-gray-text); font-weight: 400; font-size: 1.2rem; }
.product-priceblock .product-vat {
  font-family: var(--font-sans); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-gray-text);
}

/* variant selector */
.variant-group { margin-bottom: 2rem; }
.variant-title {
  display: block;
  font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-offwhite);
  margin-bottom: 0.9rem;
}
.variant-title em { color: var(--color-gray-text); font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; }
.variant-list { display: flex; flex-direction: column; gap: 0.6rem; }
.variant-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--color-bg-dark-alt);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.variant-btn:hover { border-color: rgba(255, 255, 255, 0.25); }
.variant-btn.active { border-color: var(--color-magenta-glow); background: rgba(230, 35, 106, 0.08); }
.variant-label { font-family: var(--font-sans); font-size: 0.82rem; font-weight: 400; color: var(--color-offwhite); }
.variant-price { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; color: var(--color-white); white-space: nowrap; }

/* quantity */
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; max-width: 260px; }
.qty-label { font-family: var(--font-sans); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-gray-text); }
.qty-stepper { display: flex; align-items: center; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 100px; overflow: hidden; }
.qty-btn {
  width: 38px; height: 38px; background: none; border: none; color: var(--color-white);
  font-size: 1.15rem; cursor: pointer; transition: background 0.2s ease;
}
.qty-btn:hover { background: rgba(255, 255, 255, 0.06); }
.qty-value { min-width: 34px; text-align: center; font-family: var(--font-sans); font-size: 0.9rem; color: var(--color-white); }

.add-cart-btn {
  width: 100%;
  padding: 1.05rem 2rem;
  background: var(--color-magenta-deep);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.add-cart-btn:hover { background: var(--color-magenta-glow); transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(230, 35, 106, 0.6); }
.add-cart-btn:active { transform: translateY(0); }

.ask-quote {
  display: block; text-align: center; margin-top: 1rem;
  font-family: var(--font-sans); font-size: 0.74rem; letter-spacing: 0.03em;
  color: var(--color-gray-text); text-decoration: none; transition: color 0.3s ease;
}
.ask-quote:hover { color: var(--color-white); }

/* spec table */
.product-specs-block { margin-top: 2.8rem; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 1.8rem; }
.specs-title { font-family: var(--font-serif); font-weight: 400; font-size: 1.3rem; color: var(--color-white); margin-bottom: 1rem; }
.specs-table { display: flex; flex-direction: column; }
.spec-row { display: flex; justify-content: space-between; gap: 1.5rem; padding: 0.7rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.spec-key { font-family: var(--font-sans); font-size: 0.78rem; color: var(--color-gray-text); }
.spec-val { font-family: var(--font-sans); font-size: 0.78rem; color: var(--color-offwhite); text-align: right; font-weight: 500; }

/* toast */
.cart-toast {
  position: fixed;
  bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 1000;
  padding: 0.9rem 1.6rem;
  background: var(--color-bg-dark-alt);
  border: 1px solid rgba(230, 35, 106, 0.4);
  border-radius: 100px;
  color: #fff;
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 500;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cart-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   CART PAGE
   ========================================================================== */
.cart-page { width: 92%; max-width: 1000px; margin: 0 auto; padding: 9.5rem 0 5rem; min-height: 60vh; }
.cart-title { font-family: var(--font-serif); font-weight: 300; font-size: 2.8rem; color: var(--color-white); margin-bottom: 2.5rem; }
.cart-empty { font-family: var(--font-sans); color: var(--color-gray-text); padding: 2rem 0 5rem; }
.cart-empty a { color: var(--color-magenta-glow); text-decoration: none; }
.cart-list { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 2.5rem; }
.cart-item {
  display: grid;
  grid-template-columns: 90px 1fr auto auto;
  gap: 1.3rem; align-items: center;
  padding: 1rem 1.2rem;
  background: var(--color-bg-dark-alt);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.cart-item-img { width: 90px; height: 90px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); background: radial-gradient(110% 70% at 50% 26%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 72%), linear-gradient(180deg,#17171d,#0b0b0f); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-title { font-family: var(--font-serif); font-size: 1.05rem; color: var(--color-white); line-height: 1.25; }
.cart-item-model { font-family: var(--font-sans); font-size: 0.68rem; letter-spacing: 0.05em; color: var(--color-gray-text); text-transform: uppercase; margin-top: 0.25rem; }
.cart-item-price { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; color: var(--color-white); white-space: nowrap; }
.cart-item-remove { background: none; border: none; color: var(--color-gray-text); cursor: pointer; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; transition: color 0.25s ease; margin-top: 0.4rem; }
.cart-item-remove:hover { color: var(--color-magenta-glow); }
.cart-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 1.2rem; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.8rem; }
.cart-subtotal { font-family: var(--font-sans); font-size: 1.15rem; color: var(--color-white); }
.cart-subtotal b { font-weight: 600; }
.cart-subtotal .vat { font-size: 0.7rem; color: var(--color-gray-text); text-transform: uppercase; letter-spacing: 0.06em; margin-left: 0.6rem; }
.cart-actions { display: flex; gap: 1rem; align-items: center; }
.cart-clear { background: none; border: 1px solid rgba(255,255,255,0.15); color: var(--color-offwhite); border-radius: 100px; padding: 0.9rem 1.6rem; font-family: var(--font-sans); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; transition: border-color 0.25s ease; }
.cart-clear:hover { border-color: rgba(255,255,255,0.4); }
.cart-checkout { background: var(--color-magenta-deep); color: #fff; border: none; border-radius: 100px; padding: 1rem 2.2rem; font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; text-decoration: none; transition: background 0.3s ease; }
.cart-checkout:hover { background: var(--color-magenta-glow); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .shop-layout { grid-template-columns: 190px 1fr; gap: 3rem; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .product-gallery-tile { position: static; aspect-ratio: 4/3; }
  .product-h1 { font-size: 2rem; }
  .cart-item { grid-template-columns: 70px 1fr auto; grid-template-areas: "img title price" "img model remove"; row-gap: 0.3rem; }
  .cart-item-img { width: 70px; height: 70px; grid-area: img; }
}
@media (max-width: 860px) {
  /* On mobile the navbar fills the width, so float the cart bottom-right
     instead of beside the pill (avoids colliding with the hamburger). */
  .cart-fab,
  .main-header.scrolled ~ .cart-fab {
    top: auto;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 52px;
    height: 52px;
    background-color: rgba(12, 12, 16, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }

  /* ---------- Mobile: ricerca + pill di categoria, appiccicate in alto ----
     La barra resta sticky sotto la navbar perché con 24 famiglie in due
     colonne si scorre parecchio, e tornare su per cambiare categoria è la cosa
     che si fa più spesso. Ha un fondo pieno che sfuma verso il basso: senza,
     le card le passavano sotto e si leggevano attraverso le pill. */
  .shop-layout {
    display: block;
    width: 92%;
    padding-top: 8.5rem;
  }
  .shop-filter-container {
    position: sticky;
    top: 4.1rem;
    z-index: 90;
    margin: 0 -4% 1.6rem;
    padding: 0.9rem 4% 0;
    flex-direction: column;
    background: linear-gradient(180deg,
      var(--color-bg-dark) 0%,
      var(--color-bg-dark) 68%,
      rgba(6, 6, 8, 0) 100%);
  }
  .shop-search { margin-bottom: 0.85rem; }
  .shop-search-input { padding-top: 0.62rem; padding-bottom: 0.62rem; font-size: 0.82rem; }
  /* "Categorie" costa una riga intera su uno schermo da 390px e le pill si
     spiegano da sole: resta solo per i lettori di schermo. */
  .shop-filter-label {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }
  .shop-filter-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.15rem 0 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding-inline: 1rem;
    /* la sfumatura ai bordi dice che lo strip continua oltre il taglio */
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px,
                        #000 calc(100% - 26px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 10px,
                        #000 calc(100% - 26px), transparent 100%);
  }
  .shop-filter-nav::-webkit-scrollbar { display: none; }
  .filter-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    opacity: 1;
    padding: 0.5rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-gray-text);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    /* Desktop parks the button at translateX(-1.1rem) to hide the marker gutter.
       There is no marker here (::after is display:none) and these are bordered
       pills, so the offset must be cleared or every pill sits 1.1rem left of
       its own box. */
    transform: none;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  }
  .filter-btn:hover { opacity: 1; color: var(--color-offwhite); }
  .filter-btn.active {
    padding-left: 0.95rem; /* niente marcatore laterale: non c'è spazio */
    color: #fff;
    background: var(--color-magenta-deep);
    border-color: var(--color-magenta-deep);
  }
  .filter-btn.active::after { display: none; }

  .shop-main-head { padding-bottom: 0.8rem; margin-bottom: 1.3rem; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 2.2rem 1.2rem; width: 100%; }
  .product-name { font-size: 1.12rem; }
}
@media (max-width: 520px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 1.9rem 0.9rem; }
  .product-image-tile { border-radius: 10px; margin-bottom: 0.9rem; }
  .product-series { font-size: 0.56rem; letter-spacing: 0.09em; }
  .product-name { font-size: 1rem; }
  .product-footer { padding-top: 0.7rem; }
  .product-price { font-size: 0.95rem; }
  .product-vat { font-size: 0.55rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .product-card { transition: none; }
  .product-card.is-in { transition: none; transform: none; }
  .product-image-tile,
  .product-image-tile img,
  .product-image-tile::before { transition: none; }
  .product-image-tile.is-loading::after { animation: none; }
  .product-card:hover .product-image-tile { transform: none; }
  .product-card:hover .product-image-tile img { transform: none; }
}
