/* Listino REALITY – stile moderno, responsive, chiaro/scuro */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16202c;
  --muted: #5b6776;
  --line: #e2e6ec;
  --accent: #d4003a;          /* rosso del logo REALITY */
  --accent-ink: #ffffff;
  --accent-soft: #fdeaf0;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 4px 16px rgb(16 24 40 / .05);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --surface: #171e27;
    --text: #e8edf3;
    --muted: #9aa7b6;
    --line: #26303c;
    --accent: #ff5c85;
    --accent-ink: #1a0610;
    --accent-soft: #3a1823;
    --shadow: none;
  }
  .brand-name { filter: invert(1); }   /* la scritta nera diventa bianca */
}

*, *::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);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; padding-block: 8px 48px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; gap: 6px; }
.brand-name { display: block; height: 15px; width: auto; }
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1; letter-spacing: .04em; }
.search { flex: 1 1 320px; display: flex; gap: 8px; max-width: 640px; margin-inline: auto; }
.search input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.search button, .btn {
  height: 42px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  display: inline-flex; align-items: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.site-link { font-size: 14px; color: var(--muted); white-space: nowrap; }

/* Breadcrumb */
.crumbs { padding-block: 16px 4px; font-size: 14px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.crumbs [aria-current] { color: var(--muted); }

/* Hero / titoli */
.hero { padding-block: 20px 12px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); line-height: 1.15; letter-spacing: -.01em; }
.h1-sub { font-weight: 500; color: var(--muted); font-size: .62em; margin-left: .3em; }
.lead { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 70ch; }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; color: var(--accent); }
h2 { font-size: 1.2rem; margin: 0 0 12px; }

/* Home: schede categoria */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 8px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.card h3 { margin: 0; font-size: 1.1rem; }
.card h3 a { color: var(--text); }
.card p { margin: 2px 0 12px; font-size: 14px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px;
  background: var(--accent-soft); color: var(--accent);
}
.chips a:hover { text-decoration: none; filter: brightness(.96); }
.chips .more a { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

/* Elenchi sottocategorie / marche */
.tiles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tiles a {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.tiles a:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.tile-name { font-weight: 600; }
.tile-count { font-size: 13px; color: var(--muted); }

/* Tabella prodotti */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 8px; }
table.products { width: 100%; border-collapse: collapse; }
.products th, .products td { padding: 11px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.products thead th {
  border-top: 0; background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.products tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.products tbody th { font-weight: 600; }
.products .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.products .strong { font-weight: 700; }
.products .desc { color: var(--muted); font-size: 14px; }
.desc-inline { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); }
small { font-size: .8em; }

/* Scheda prodotto */
.product-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 860px) { .product-grid { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.specs { margin: 0; }
.specs > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.specs > div:first-child { border-top: 0; padding-top: 0; }
.specs dt { color: var(--muted); font-size: 14px; }
.specs dd { margin: 0; overflow-wrap: anywhere; }
.price-panel { background: var(--accent-soft); border-color: transparent; }
.price-main { margin: 0 0 8px; display: flex; flex-direction: column; gap: 2px; }
.price-main .label { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.price-main strong { font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.price-sub { margin: 0; color: var(--muted); font-size: 14px; }
.related { margin-top: 32px; }
.rel-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rel-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; }
.rel-list .muted { font-size: 13px; }

/* Paginazione */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 24px 0 0; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 10px; }
.pager a { background: var(--surface); border: 1px solid var(--line); }
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager .current { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pager .gap { color: var(--muted); }
.empty { padding: 24px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; padding-block: 20px; }
.site-footer p { margin: 0 0 6px; }

/* Mobile: le righe della tabella diventano schede */
@media (max-width: 720px) {
  .site-link { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .products thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .products, .products tbody, .products tr, .products th, .products td { display: block; width: 100%; }
  .products tr { padding: 12px 14px; border-top: 1px solid var(--line); }
  .products tbody tr:first-child { border-top: 0; }
  .products th, .products td { border: 0; padding: 2px 0; }
  .products td[data-label]::before {
    content: attr(data-label); display: inline-block; min-width: 122px; margin-right: 8px;
    font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  }
  .products tbody th { font-size: 1.05rem; padding-bottom: 4px; }
  .products .num { text-align: left; }
  .specs > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  .site-header, .search, .pager, .skip { display: none; }
  body { background: #fff; color: #000; }
  .table-wrap, .panel { box-shadow: none; }
}
