/* Catalogo ex Magento – stile comune. I colori del marchio sono in /assets/site/theme.css */
:root {
  --brand: #1f6fb2;
  --brand-dark: #154e7e;
  --ink: #16202a;
  --text: #2b3540;
  --muted: #66727f;
  --line: #dde3e9;
  --soft: #f3f6f9;
  --bg: #ffffff;
  --ok: #1d7a46;
  --ok-bg: #e8f6ee;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 46, .06), 0 4px 16px rgba(16, 32, 46, .06);
  --wrap: 1240px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0 0 .4rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .8rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* pulsanti */
.btn, .search button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: 600 1rem/1 var(--font);
  padding: .8rem 1.2rem; cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn:hover, .search button:hover { background: var(--brand-dark); color: #fff; }
.btn-small { padding: .55rem .8rem; font-size: .875rem; }
.btn-big { padding: 1rem 1.6rem; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--brand-dark); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }
.link-btn { background: none; border: 0; color: var(--err); cursor: pointer; font: inherit; font-size: .875rem; text-decoration: underline; padding: 0; }

/* barra superiore e testata */
.topbar { background: var(--ink); color: #cfd6dd; font-size: .85rem; }
.topbar a { color: #fff; text-decoration: none; }
.topbar-in { display: flex; justify-content: flex-end; gap: 1.5rem; padding-top: .4rem; padding-bottom: .4rem; flex-wrap: wrap; }
.header { background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.header-in { display: flex; align-items: center; gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.logo { flex: 0 0 auto; display: block; }
.logo img { display: block; height: var(--logo-h, 56px); width: auto; }
.search { display: flex; flex: 1 1 auto; max-width: 620px; }
.search input {
  flex: 1 1 auto; min-width: 0; border: 1.5px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px;
  padding: .7rem .9rem; font: inherit; background: #fff; color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--brand); }
.search button { border-radius: 0 8px 8px 0; }
.quote-link { margin-left: auto; display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.badge { background: var(--brand); color: #fff; border-radius: 999px; font-size: .75rem; min-width: 1.4rem; height: 1.4rem; display: inline-grid; place-items: center; padding: 0 .35rem; }

.nav { background: var(--brand-dark); }
.nav-in { display: flex; align-items: stretch; gap: .25rem; flex-wrap: wrap; position: relative; }
.nav-in > a, .menu > summary {
  color: #fff; text-decoration: none; font-weight: 600; padding: .8rem 1rem; display: block; cursor: pointer; list-style: none;
}
.nav-in > a:hover, .menu > summary:hover, .menu[open] > summary { background: rgba(255, 255, 255, .12); color: #fff; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; display: inline-block; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 0 .2rem .55rem; }
.mega {
  position: absolute; left: 16px; right: 16px; top: 100%; background: #fff; border: 1px solid var(--line); border-top: 0;
  box-shadow: var(--shadow); border-radius: 0 0 var(--radius) var(--radius); padding: 1.2rem 1.4rem 1.4rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .15rem 1.5rem; max-height: 75vh; overflow: auto;
}
.mega-tree { gap: 1.2rem 1.5rem; }
.mega-top { display: block; padding: .35rem 0; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.mega-tree .mega-top { border-bottom: 2px solid var(--brand); margin-bottom: .3rem; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega li a { display: block; padding: .2rem 0; color: var(--text); text-decoration: none; font-size: .9rem; }
.mega a:hover { color: var(--brand); }
.mega-all { grid-column: 1 / -1; margin-top: .8rem; font-weight: 600; text-decoration: none; }

/* home */
.hero { background: linear-gradient(135deg, var(--soft) 0%, #fff 60%); border-bottom: 1px solid var(--line); }
.hero-in { padding-top: 3rem; padding-bottom: 3rem; max-width: var(--wrap); }
.hero-in > div { max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--brand-dark); margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.lead { font-size: 1.15rem; color: var(--text); margin: .6rem 0 1.4rem; }
.search-big { max-width: 680px; }
.search-big input { padding: 1rem 1.1rem; font-size: 1.05rem; }
.search-big button { padding: 0 1.5rem; font-size: 1.05rem; }
.stats { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; list-style: none; padding: 0; margin: 1.8rem 0 0; color: var(--muted); }
.stats strong { display: block; font-size: 1.6rem; color: var(--ink); }

.section { padding: 2.8rem 0; }
.section-alt { background: var(--soft); }
.section-title { margin-top: 0; font-size: 1.45rem; }
.more { margin: 1.4rem 0 0; }

.brands { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.brands a { display: grid; place-items: center; height: 92px; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: box-shadow .15s, border-color .15s; }
.brands a:hover { box-shadow: var(--shadow); border-color: var(--brand); }
.brands img { max-height: 54px; width: auto; filter: grayscale(.2); }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.tiles a {
  display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--brand); border-radius: 8px; text-decoration: none; height: 100%; transition: box-shadow .15s;
}
.tiles a:hover { box-shadow: var(--shadow); }
.tile-name { color: var(--ink); font-weight: 600; }
.tile-count { color: var(--muted); font-size: .875rem; }

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.features li { display: flex; flex-direction: column; gap: .3rem; }
.features strong { color: var(--ink); font-size: 1.05rem; }
.feature-n { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: .3rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.steps { margin: 0; padding-left: 1.3rem; }
.steps li { margin-bottom: .6rem; }
.about-box { background: var(--soft); border-radius: var(--radius); padding: 1.5rem; }

/* schede prodotto in griglia */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); }
.card-img { display: grid; place-items: center; aspect-ratio: 1; background: #fff; padding: .8rem; border-bottom: 1px solid var(--line); }
.card-img img { max-height: 100%; width: auto; object-fit: contain; }
.card-body { padding: .8rem .9rem .4rem; flex: 1 1 auto; display: flex; flex-direction: column; gap: .25rem; }
.card-brand { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-dark); font-weight: 700; }
.card-title { margin: 0; font-size: .95rem; font-weight: 600; line-height: 1.35; }
.card-title a { color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--brand); }
.card-sku { font-size: .8rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.card-add { padding: .5rem .9rem .9rem; }
.card-add .btn { width: 100%; }

/* pagine interne */
.page { padding-top: 1.2rem; padding-bottom: 3rem; }
.page-narrow { max-width: 900px; }
.page-head { margin: .4rem 0 1.4rem; }
.page-head p { margin: 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .3rem; }
.crumbs a { color: var(--muted); }
.category-text { margin-bottom: 1.5rem; max-width: 900px; }
.chips { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a { display: inline-flex; gap: .4rem; align-items: center; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: #fff; font-size: .9rem; }
.chips a:hover { border-color: var(--brand); color: var(--brand-dark); }
.chips span { color: var(--muted); font-size: .8rem; }
.filter { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.2rem; flex-wrap: wrap; }
.filter label { font-weight: 600; }
.filter select { padding: .5rem .7rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; background: #fff; max-width: 100%; }
.pager { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 2rem 0 0; }
.pager a, .pager span { min-width: 2.4rem; padding: .5rem .7rem; border-radius: 8px; text-align: center; text-decoration: none; border: 1px solid var(--line); background: #fff; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.pager .gap { border: 0; background: none; }
.empty { background: var(--soft); border-radius: var(--radius); padding: 1.4rem 1.6rem; }
.notice { border-radius: 8px; padding: .9rem 1.1rem; margin: 0 0 1.2rem; }
.notice-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e3c8; }
.notice-error { background: var(--err-bg); color: var(--err); border: 1px solid #f5c2bc; }

/* scheda prodotto */
.product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2.5rem; margin-top: 1rem; }
.gallery-main { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: #fff; }
.gallery-main img { max-height: 100%; width: auto; object-fit: contain; }
.gallery-thumbs { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.gallery-thumbs a { display: grid; place-items: center; width: 80px; height: 80px; border: 1px solid var(--line); border-radius: 8px; padding: .3rem; background: #fff; }
.gallery-thumbs a.active, .gallery-thumbs a:hover { border-color: var(--brand); }
.gallery-thumbs img { max-height: 100%; width: auto; }
.product-brand { margin: 0 0 .6rem; font-weight: 700; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .05em; }
.product-brand img { height: 36px; width: auto; display: block; }
.product-info h1 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); }
.product-sku { color: var(--muted); margin: .2rem 0 1.2rem; }
.product-sku strong { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.05rem; }
.product-short { margin-bottom: 1rem; }
.add { display: flex; align-items: flex-end; gap: .7rem; flex-wrap: wrap; margin: 1.4rem 0 .8rem; padding: 1.1rem; background: var(--soft); border-radius: var(--radius); }
.add label { width: 100%; font-weight: 600; font-size: .9rem; }
.add input { width: 7rem; padding: .75rem .7rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }
.add .btn { flex: 1 1 auto; }
.specs { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0 0 1rem; }
.specs th, .specs td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { width: 42%; color: var(--muted); font-weight: 600; }
.specs tr:nth-child(odd) { background: var(--soft); }
.specs-wide { max-width: 760px; }
.product-details { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.section-inner { margin-top: 2.5rem; }
.rich { overflow-wrap: anywhere; }
.rich table { border-collapse: collapse; margin: 1rem 0; max-width: 100%; display: block; overflow-x: auto; }
.rich td, .rich th { border: 1px solid var(--line); padding: .4rem .6rem; }
.rich img { border-radius: 6px; }
.cta { margin-top: 2rem; }

/* moduli */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; margin-bottom: 1.2rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field input, .field textarea { padding: .75rem .8rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink); width: 100%; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.field-check label { font-weight: 400; display: flex; gap: .55rem; align-items: flex-start; }
.field-check input { width: auto; margin-top: .3rem; }
.has-error input, .has-error textarea { border-color: var(--err); }
.field-error { color: var(--err); font-size: .85rem; }
.quote-table { width: 100%; border-collapse: collapse; margin-bottom: .8rem; }
.quote-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .5rem; border-bottom: 2px solid var(--line); }
.quote-table td { padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.quote-item { display: flex; gap: .8rem; align-items: center; }
.quote-item img { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; flex: 0 0 auto; }
.quote-item a { color: var(--ink); font-weight: 600; text-decoration: none; }
.qty-col { width: 8rem; }
.qty-col input { width: 6.5rem; padding: .55rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }
.quote-update { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.split-contact { grid-template-columns: 3fr 2fr; }
.contact-card { background: var(--soft); border-radius: var(--radius); padding: 1.5rem; }
.contact-card h2 { margin-top: 0; }

.error-page { text-align: center; padding-top: 3rem; }
.error-page .search { margin: 1.5rem auto; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }

/* piè di pagina */
.footer { background: var(--ink); color: #c5ced6; margin-top: 2rem; font-size: .92rem; }
.footer a { color: #fff; }
.footer-in { display: grid; grid-template-columns: 2fr 2fr 1.5fr; gap: 2rem; padding-top: 2.5rem; padding-bottom: 1.5rem; }
.footer-name, .footer-title { color: #fff; font-weight: 700; margin: 0 0 .5rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .3rem; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 1rem; padding-bottom: 1.2rem; font-size: .82rem; color: #9aa6b1; }

@media (max-width: 960px) {
  .header-in { flex-wrap: wrap; gap: .8rem 1rem; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .logo img { height: calc(var(--logo-h, 56px) * .75); }
  .product, .split, .split-contact { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .topbar-in { justify-content: space-between; gap: .5rem; }
  .quote-link span:not(.badge) { display: none; }
  .nav-in > a, .menu > summary { padding: .7rem .7rem; font-size: .95rem; }
  .mega { left: 0; right: 0; grid-template-columns: 1fr; border-radius: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .card-body { padding: .6rem .6rem .3rem; }
  .card-add { padding: .4rem .6rem .7rem; }
  .card-add .btn { font-size: .8rem; padding: .5rem; }
  .fields { grid-template-columns: 1fr; }
  .footer-in { grid-template-columns: 1fr; }
  .qty-col { width: 5.5rem; }
  .qty-col input { width: 4.8rem; }
  .quote-item img { display: none; }
  .hero-in { padding-top: 2rem; padding-bottom: 2rem; }
}
