/* Paolucci Shop — stile "ferro e brace" */
:root {
  --ink: #16181a;
  --iron: #24282c;
  --iron-2: #31363b;
  --steel: #8a9298;
  --line: #d9d4cb;
  --paper: #f5f2ec;
  --white: #ffffff;
  --ember: #d9480f;
  --ember-dark: #b23a0a;
  --ember-soft: #fbe9df;
  --ok: #1f7a3d;
  --err: #b42318;
  --warn: #8a5a00;
  --radius: 4px;
  --font-display: "Bahnschrift", "DIN Alternate", "Franklin Gothic Medium", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: 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;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ember-dark); text-underline-offset: 2px; }
a:hover { color: var(--ember); }
h1, h2, h3 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 2rem); 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(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }
.muted { color: #5b6166; }
.hint { font-size: .875rem; color: #5b6166; }

/* Header */
.site-header { background: var(--iron); color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar { background: var(--ink); font-size: .8rem; color: #c9ced2; }
.topbar-in { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.topbar a { color: #fff; text-decoration: none; }
.nav-row { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; color: var(--ember); }
.brand-name { font-family: var(--font-display); font-size: 1.45rem; text-transform: uppercase; letter-spacing: .06em; }
.brand-name b { color: var(--ember); font-weight: 700; margin-left: .15em; }
.nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.nav-row { flex-wrap: nowrap; }
.nav a { color: #e6e8ea; text-decoration: none; font-size: .95rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: #fff; border-bottom-color: var(--ember); }
.nav-cat { display: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--steel); color: #fff; padding: .4rem .8rem; border-radius: var(--radius); font: inherit; }
.search input { background: var(--iron-2); border: 1px solid #4a5056; color: #fff; padding: .45rem .75rem; border-radius: var(--radius); width: 11rem; font: inherit; }
.search input::placeholder { color: #aab0b5; }
.cart-link { position: relative; color: #fff; display: grid; place-items: center; width: 42px; height: 42px; }
.cart-link svg { width: 26px; height: 26px; }
.badge { position: absolute; top: 0; right: 0; background: var(--ember); color: #fff; font-size: .72rem; font-weight: 700; min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 4px; }

@media (max-width: 860px) {
  .topbar { display: none; }
  .nav-toggle { display: block; }
  .nav-row { flex-wrap: wrap; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; order: 5; padding-bottom: .5rem; }
  .nav.is-open { display: flex; }
  .nav-cat { display: inline; }
  .nav-row { gap: .6rem; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-name { font-size: 1.15rem; letter-spacing: .04em; }
  .nav-toggle { order: 1; }
  .cart-link { order: 2; }
  .search { order: 6; width: 100%; }
  .search input { width: 100%; }
}

/* Bottoni */
.btn {
  display: inline-block; background: var(--ember); color: #fff; border: 2px solid var(--ember);
  padding: .7rem 1.4rem; border-radius: var(--radius); font: 600 1rem/1.2 var(--font-body);
  text-transform: uppercase; letter-spacing: .04em; text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--ember-dark); border-color: var(--ember-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost-light { background: transparent; border-color: #fff; color: #fff; }
.btn-ghost-light:hover { background: #fff; border-color: #fff; color: var(--ink); }
.btn-small { padding: .5rem .9rem; font-size: .8rem; }
.link-btn { background: none; border: 0; color: var(--ember-dark); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* Hero */
.hero {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px),
    linear-gradient(120deg, var(--ink), var(--iron-2));
  color: #fff; padding: clamp(3rem, 9vw, 6.5rem) 0; border-bottom: 6px solid var(--ember);
}
.hero-in { max-width: 52rem; }
.eyebrow { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .18em; color: var(--ember); font-size: .9rem; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.8rem); }
.lead { font-size: 1.15rem; color: #d6dadd; max-width: 40rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.trust { background: var(--ink); color: #fff; }
.trust-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 1.1rem 0; text-align: center; }
.trust strong { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--ember); }
.trust span { font-size: .85rem; color: #c9ced2; }

/* Sezioni */
.section { padding: 3rem 0; }
.section-tight { padding-top: 2.5rem; }
.section-alt { background: #ece7de; }
.section-title { margin-bottom: 1.2rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.page { padding: 1.5rem 0 3.5rem; }
.narrow { max-width: 46rem; }
.crumbs { font-size: .85rem; color: #5b6166; margin-bottom: 1rem; }
.crumbs a { color: inherit; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.cat-tile {
  display: flex; flex-direction: column; gap: .35rem; padding: 1.2rem; background: var(--white);
  border: 1px solid var(--line); border-left: 6px solid var(--ember); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.cat-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(22,24,26,.12); color: var(--ink); }
.cat-name { font-family: var(--font-display); text-transform: uppercase; font-size: 1.15rem; letter-spacing: .03em; }
.cat-blurb { font-size: .9rem; color: #4d5358; flex: 1; }
.cat-count { font-size: .85rem; font-weight: 600; color: var(--ember-dark); }

/* Catalogo */
.pills { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.pill { padding: .35rem .8rem; border: 1px solid var(--line); background: var(--white); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.pill small { color: #6b7177; }
.pill:hover { border-color: var(--ember); }
.pill.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill.is-on small { color: #c9ced2; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0 1.2rem; }
.toolbar p { margin: 0; }
select, input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number], textarea, .form input {
  font: inherit; color: var(--ink); background: var(--white); border: 1px solid #b9b3a8; border-radius: var(--radius); padding: .55rem .7rem; width: 100%;
}
select { width: auto; }
.empty { padding: 2rem; background: var(--white); border: 1px dashed var(--steel); border-radius: var(--radius); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 1.1rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 8px 22px rgba(22,24,26,.13); transform: translateY(-2px); }
.card-img { display: block; aspect-ratio: 1 / 1; background: #e9e5dc; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.chip { display: inline-block; align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ember-dark); background: var(--ember-soft); padding: .15rem .5rem; border-radius: 2px; margin: 0; }
.card-title { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: .98rem; font-weight: 600; line-height: 1.3; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--ember-dark); }
.price { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); margin: auto 0 .3rem; }
.card-form { display: flex; gap: .5rem; }
.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pager a { min-width: 2.4rem; text-align: center; padding: .45rem .6rem; background: var(--white); border: 1px solid var(--line); text-decoration: none; color: var(--ink); border-radius: var(--radius); }
.pager a.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Scheda prodotto */
.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.product-media { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; }
.product-media img { width: 100%; height: 100%; object-fit: contain; }
.price-xl { font-size: 2.1rem; margin: .4rem 0 1rem; }
.price-xl small { display: block; font-family: var(--font-body); font-size: .85rem; color: #5b6166; }
.buy { display: grid; gap: .5rem; margin: 1.2rem 0 .6rem; }
.buy label { font-weight: 600; font-size: .9rem; }
.buy-row { display: flex; gap: .7rem; }
.qty { width: 5rem !important; text-align: center; }
.alt-link { margin-top: 1.4rem; font-size: .92rem; }
@media (max-width: 800px) { .product { grid-template-columns: 1fr; gap: 1.4rem; } }

/* Carrello */
.cart { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
.cart th, .cart td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart th { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; background: #ece7de; }
.cart .r { text-align: right; }
.cart-item { display: flex; align-items: center; gap: .8rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 2px; background: #e9e5dc; }
.cart-item small, .summary small { display: block; font-weight: 400; color: #5b6166; }
.cart-foot { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-start; margin-top: 1.4rem; flex-wrap: wrap; }
.cart-total { margin-left: auto; text-align: right; }
.cart-total strong { font-family: var(--font-display); font-size: 1.7rem; margin-left: .5rem; }
@media (max-width: 700px) {
  .cart thead { display: none; }
  .cart, .cart tbody, .cart tr, .cart td { display: block; width: 100%; }
  .cart tr { border-bottom: 2px solid var(--line); padding: .5rem 0; }
  .cart td { border: 0; padding: .35rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
  .cart td[data-label]::before { content: attr(data-label); font-size: .8rem; text-transform: uppercase; color: #5b6166; }
  .cart-total { margin-left: 0; text-align: left; }
}

/* Form */
.form { display: grid; gap: 1rem; }
.form h2 { margin: .6rem 0 0; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
.form .check { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; }
.form .check input { width: auto; margin-top: .3rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.three { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .two, .three { grid-template-columns: 1fr; } }
.field-err { color: var(--err); font-weight: 600; font-size: .85rem; }
.hp { position: absolute; left: -9999px; }
.checkout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.summary { background: var(--white); border: 1px solid var(--line); border-top: 6px solid var(--ember); padding: 1.2rem; border-radius: var(--radius); position: sticky; top: 7rem; }
.summary ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.summary li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; }
.sum-total strong { font-family: var(--font-display); font-size: 1.5rem; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } .summary { position: static; order: -1; } }

/* Messaggi */
.notice { padding: .8rem 1rem; border-radius: var(--radius); border-left: 5px solid; margin: 1rem 0; background: var(--white); }
.notice-ok { border-color: var(--ok); }
.notice-err { border-color: var(--err); }
.notice-warn { border-color: var(--warn); background: #fff7e0; }
.prose p { max-width: 65ch; }

/* Footer */
.site-footer { background: var(--ink); color: #c9ced2; margin-top: 2rem; font-size: .92rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; padding: 2.6rem 0 1.6rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: .5rem; }
.footer-brand b { color: var(--ember); }
.footer-title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: .5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.footer-bottom { border-top: 1px solid #343a40; padding: 1rem 0 1.6rem; font-size: .82rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* Admin */
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .9rem; }
.admin-table th, .admin-table td { border: 1px solid var(--line); padding: .5rem; vertical-align: top; text-align: left; }
.admin-table img { width: 56px; height: 56px; object-fit: cover; }
.admin-table select, .admin-table textarea { width: 100%; font-size: .85rem; }
.admin-box { background: var(--white); border: 1px solid var(--line); padding: 1.2rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.log { background: var(--ink); color: #d6dadd; padding: 1rem; border-radius: var(--radius); font: .85rem/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; max-height: 20rem; overflow: auto; }

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