/* Shared styles for ITALOMIX sub-pages (product center, product detail). Tokens mirror the homepage. */
:root {
  --black: #050607;
  --ink: #171719;
  --paper: #f5f5f7;
  --warm: #f2eee6;
  --white: #ffffff;
  --muted: #6f6f73;
  --blue: #0a84ff;
  --blue-dark: #0066cc;
  --line: rgba(23, 23, 25, 0.12);
  --whatsapp: #25d366;
  --max: min(1320px, calc(100% - 48px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "SF Pro Display", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.inner { width: var(--max); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 6, 7, 0.92);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.nav {
  width: var(--max);
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { width: 124px; }

.nav-links {
  display: flex;
  gap: 26px;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--white); }

.nav-actions { display: flex; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn.white { background: var(--white); color: var(--black); }
.btn.ghost { border-color: rgba(255, 255, 255, 0.4); color: var(--white); }
.btn.outline { border-color: var(--line); background: var(--white); color: var(--ink); }
.btn.primary { background: var(--blue); color: var(--white); }
.btn.primary:hover { background: var(--blue-dark); }
.btn.whatsapp { background: var(--whatsapp); color: var(--white); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle .icon-close,
.menu-open .menu-toggle .icon-open { display: none; }
.menu-open .menu-toggle .icon-close { display: block; }
.mobile-menu { display: none; }

/* ---------- Page hero ---------- */
.page-hero {
  background: var(--black);
  color: var(--white);
  padding: 72px 0 56px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.breadcrumb a:hover { color: var(--white); }

.page-hero h1 {
  margin-top: 18px;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.page-hero p {
  margin-top: 18px;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Browse bar: mode switch + dropdown ---------- */
.browse-bar {
  position: sticky;
  top: 64px;
  z-index: 30;
  /* solid, no backdrop-filter: that would trap the fixed mobile picker sheet inside the bar */
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.browse-bar .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 0;
}

.mode-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.mode-switch button {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.mode-switch button[aria-selected="true"] { background: var(--ink); color: var(--white); }

/* ---------- Picker: trigger + panel of set / type tiles ---------- */
.picker { position: relative; }

.picker-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 360px;
  height: 52px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.picker-trigger:hover,
.picker-trigger[aria-expanded="true"] { border-color: var(--ink); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); }

.picker-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.picker-value { flex: 1; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.picker-count {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.picker-trigger svg { width: 18px; height: 18px; flex: 0 0 auto; transition: transform 200ms ease; }
.picker-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }

.picker-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  width: min(880px, calc(100vw - 48px));
  max-height: min(72vh, 660px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
}

.picker-all {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.picker-all span { color: var(--muted); font-size: 13px; font-weight: 600; }

.picker-section { margin-top: 18px; }

.picker-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 14px;
}

.picker-link {
  border: 0;
  background: none;
  color: var(--blue-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.picker-grid.types { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.picker-tile {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.picker-tile img { width: 54px; height: 54px; object-fit: contain; margin-bottom: 4px; }

.picker-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.picker-tile.wide { gap: 4px; padding: 18px 10px 16px; }

.tile-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  transition: background 150ms ease, color 150ms ease;
}

.tile-icon svg { width: 40px; height: 40px; }
.picker-tile.wide .tile-count { color: var(--blue-dark); font-weight: 600; }
.picker-tile.wide:hover .tile-icon,
.picker-tile.wide[aria-pressed="true"] .tile-icon { background: var(--ink); color: var(--white); }
.tile-code { font-size: 14px; font-weight: 750; letter-spacing: 0.02em; }
.tile-count { color: var(--muted); font-size: 12px; }

.picker-tile:hover { border-color: var(--blue); transform: translateY(-1px); }

.picker-tile[aria-pressed="true"],
.picker-all[aria-pressed="true"],
.picker-link[aria-pressed="true"] { border-color: var(--blue); background: #eef6ff; }

/* ---------- Product center ---------- */
.browse { padding-bottom: 8px; }
.browse-group { padding-top: 56px; scroll-margin-top: 140px; }
.category-head .count { color: var(--muted); font-size: 0.5em; font-weight: 600; vertical-align: middle; }

.set-block { margin-top: 30px; scroll-margin-top: 140px; }

.set-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* a set is one catalog page: keep it on a single row on desktop */
.set-block .product-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.set-block .product-card .body { padding: 10px 14px 14px; }
.set-block .product-card .code { font-size: 16px; }
.set-block .product-card .type { font-size: 13px; }

.set-head h3 { font-size: 19px; }
.set-head span { color: var(--muted); font-size: 14px; }

.category-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 12px 32px;
  margin-bottom: 26px;
}

.category-head h2 {
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.category-head p { max-width: 560px; color: var(--muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1); }

/* fixed square stage: every product is centred and fitted to the same box,
   so names sit on one line across a row */
.product-card .media {
  position: relative;
  aspect-ratio: 1;
  background: var(--white);
}

.product-card .media img {
  position: absolute;
  inset: 12%;
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.product-card .body { padding: 14px 18px 18px; border-top: 1px solid rgba(23, 23, 25, 0.06); }
.product-card .code,
.product-card .type { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .code { font-size: 18px; font-weight: 750; letter-spacing: 0.01em; }
.product-card .type { margin-top: 2px; color: var(--muted); font-size: 14px; }

/* ---------- Product detail ---------- */
.product-detail { padding: 48px 0 24px; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: start;
}

.detail-media {
  position: sticky;
  top: 88px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.detail-media img { width: 100%; height: 100%; object-fit: contain; }

.detail-info .eyebrow {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-info h1 {
  margin-top: 10px;
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.detail-info .lead { margin-top: 18px; color: #3c3c40; font-size: 17px; }

.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.spec-table {
  width: 100%;
  margin-top: 34px;
  border-collapse: collapse;
  font-size: 15px;
}

.spec-table th,
.spec-table td { padding: 13px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec-table th { width: 42%; color: var(--muted); font-weight: 600; }

.detail-note { margin-top: 18px; color: var(--muted); font-size: 14px; }

.quote-card {
  margin-top: 34px;
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.quote-card h2 { font-size: 22px; }
.quote-card > p { margin-top: 6px; color: var(--muted); font-size: 14px; }

.quote-form { display: grid; gap: 12px; margin-top: 18px; }

.quote-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; color: #3c3c40; }

.quote-form input,
.quote-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
}

.quote-form textarea { min-height: 92px; resize: vertical; }

.quote-form input:focus,
.quote-form textarea:focus { outline: 2px solid rgba(10, 132, 255, 0.4); border-color: var(--blue); }

.form-status { min-height: 20px; font-size: 14px; font-weight: 600; }
.form-status.ok { color: #1a8f4c; }
.form-status.error { color: #c2412d; }

.related { padding: 56px 0 24px; }
.related h2 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 22px; }

/* ---------- CTA band + footer ---------- */
.cta-band {
  margin: 72px 0 0;
  padding: 64px 0;
  background: var(--warm);
}

.cta-band .inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.cta-band h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.05; max-width: 720px; }
.cta-band p { margin-top: 10px; color: var(--muted); }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 10px; }

footer {
  background: var(--black);
  color: rgba(255, 255, 255, 0.72);
  padding: 56px 0 32px;
  font-size: 14px;
}

.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr; gap: 36px; }
.footer-grid img { width: 170px; }
.footer-grid h3 { margin-bottom: 12px; color: var(--white); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-grid a,
.footer-grid span { display: block; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; }

.floating-wa {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  height: 48px;
  border-radius: 999px;
  background: var(--whatsapp);
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.floating-wa svg { width: 22px; height: 22px; }
.picker-open .floating-wa { display: none; }

/* ---------- Responsive ---------- */
/* narrower screens: each set becomes one swipeable row */
@media (max-width: 1180px) {
  .set-block .product-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }

  .set-block .product-card { scroll-snap-align: start; }
}

@media (max-width: 1020px) {
  .nav-links, .nav-actions { display: none; }
  .menu-toggle { display: inline-flex; }

  .menu-open .mobile-menu {
    display: grid;
    gap: 2px;
    width: var(--max);
    margin: 0 auto;
    padding: 4px 0 20px;
  }

  .mobile-menu a {
    padding: 13px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
    font-size: 15px;
    font-weight: 760;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .detail-media { position: static; padding: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  :root { --max: calc(100% - 24px); }
  .page-hero { padding: 48px 0 40px; }
  .page-hero p { font-size: 16px; }
  .browse-bar .inner { gap: 10px; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; padding: 8px 10px; }
  .picker { width: 100%; }
  .picker-trigger { width: 100%; min-width: 0; }

  /* picker opens as a bottom sheet; the huge spread shadow dims the page behind it */
  .picker-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 78vh;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4);
  }

  .picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .picker-grid.types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browse-group { padding-top: 40px; }
  .set-head h3 { font-size: 17px; }
  .set-block .product-grid { grid-auto-columns: 42%; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card { border-radius: 14px; }
  .product-card .body { padding: 10px 12px 14px; }
  .product-card .code { font-size: 15px; }
  .product-card .type { font-size: 13px; }
  .detail-actions .btn { flex: 1 1 100%; }
  .quote-card { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .floating-wa { right: 12px; bottom: 12px; }
  .floating-wa span { display: none; }
  .floating-wa { width: 52px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product-card, .btn { transition: none; }
}
