/* ============================================================
   3DZ Partner Portal — foglio di stile
   Linguaggio visivo preso dalla landing 3DZ × Unitree (landing-page-robots):
   Roboto Condensed per titoli, Roboto 300 per il testo, Tiffany #5acac5,
   pulsanti a pillola, card con raggio ampio e bordo sottile.
   Arancione #FF7520 solo per avvisi critici.
   ============================================================ */

:root {
  --accent: #5acac5;
  --accent-soft: #e9f8f7;
  --ink: #121218;
  --black: #000;
  --paper: #f7f8f9;
  --white: #fff;
  --border: #dde0e3;
  --copy: #62666b;
  --muted: #43474b;
  --critical: #FF7520;

  --font-display: 'Roboto Condensed', 'Arial Narrow', sans-serif;
  --font-body: Roboto, Arial, sans-serif;

  --nav-height: 5rem;
  --page-inline: clamp(1.25rem, 4vw, 5rem);
  --page-max: 118rem;
  --radius-card: clamp(1.25rem, 1.6vw, 1.75rem);
  --radius-md: 1rem;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --order-cols: 7rem 11rem minmax(10rem, 1fr) 10rem 8rem 1.5rem;
}

/* ---- Reset e base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---- Pulsanti (pillola, come la landing) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  border: 2px solid transparent;
  border-radius: 50rem;
  padding: .7rem 1.5rem;
  background: var(--accent);
  color: var(--white);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); background: var(--black); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.btn[aria-disabled="true"] { pointer-events: none; }   /* era uno style inline: la CSP non lo ammette (T79) */
.btn-primary { background: var(--accent); color: var(--white); }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn-block { width: 100%; }
.btn-add-to-cart { padding: .6rem 1.1rem; font-size: .78rem; letter-spacing: .06em; white-space: nowrap; width: 100%; }

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--nav-height);
  padding: 0 var(--page-inline);
  background: var(--white);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.navbar-brand { display: flex; align-items: center; gap: .9rem; }
.navbar-brand:hover { text-decoration: none; }
.navbar-logo { height: 3rem; width: auto; }
.navbar-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  padding-left: .9rem;
  border-left: 1px solid var(--border);
}

.navbar-actions { display: flex; align-items: center; gap: clamp(.5rem, 1.6vw, 1.75rem); }

.nav-link {
  border: 2px solid transparent;
  border-radius: 50rem;
  padding: .35rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .09em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s, background .2s;
}
.nav-link:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--paper); color: var(--ink); }

/* Carrello: riquadrato e in evidenza */
.cart-link {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  border: 2px solid var(--accent);
  border-radius: 50rem;
  padding: .35rem .45rem .35rem 1rem;
  line-height: 1.6;
  color: var(--ink);
  transition: background .25s, color .25s;
}
.cart-link svg { width: 1.3rem; height: 1.3rem; flex: none; }
.cart-link:hover { background: var(--paper); }
.cart-link.active { background: var(--paper); border-color: transparent; }
.cart-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 .45rem;
  border-radius: 50rem;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  line-height: 1;
  transition: background .3s;
}
.cart-badge.flash { background: var(--critical); }

/* Avatar con nome azienda e menu */
.user-menu { position: relative; }
.user-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  max-width: 9.5rem;
  border: 0;
  border-radius: var(--radius-md);
  padding: .2rem .5rem;
  background: none;
}
.user-trigger:hover .avatar, .user-trigger[aria-expanded="true"] .avatar { border-color: var(--accent); }
.avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--paper);
  color: var(--copy);
  transition: border-color .2s;
}
.avatar svg { width: 1.45rem; height: 1.45rem; }
.user-company {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .72rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--muted);
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .6rem);
  z-index: 110;
  min-width: 14rem;
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: 0 1.2rem 3rem rgba(18, 18, 24, .14);
}
.user-dropdown-head { padding: .6rem .75rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .4rem; }
.user-dropdown-head strong { display: block; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; line-height: 1.2; }
.user-dropdown-head span { font-size: .8rem; color: var(--copy); }
.dropdown-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: .7rem;
  padding: .6rem .75rem;
  background: none;
  text-align: left;
  font-size: .92rem;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--paper); text-decoration: none; }
.dropdown-logout {
  margin-top: .4rem;
  background: var(--ink);
  color: var(--white);
  font-weight: 500;
  text-align: center;
}
.dropdown-logout:hover { background: var(--critical); }

/* ---- Contenitore e titoli di pagina ---- */
.container {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 3rem) var(--page-inline) clamp(2.5rem, 5vw, 5rem);
}
.page-head { margin-bottom: clamp(1.25rem, 2.5vw, 2.25rem); }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.06vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1;
}
.page-lede { max-width: 60ch; margin-top: .75rem; color: var(--copy); font-size: 1.05rem; font-weight: 300; }
.card-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
  padding: clamp(1.25rem, 2vw, 2rem);
}

/* ---- Form base ---- */
.form-group { margin-bottom: 1.25rem; }
.form-group label, .field-label {
  display: block;
  margin-bottom: .4rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink);
}
.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 50rem;
  padding: .75rem 1.2rem;
  background: var(--white);
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.form-control::placeholder { color: #9a9ea3; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(90, 202, 197, .25); }
.required { color: var(--critical); }
.field-note { display: block; margin-top: .4rem; font-size: .8rem; font-weight: 300; color: var(--copy); }

/* ---- Avvisi ---- */
.alert { padding: .8rem 1.1rem; border-radius: var(--radius-md); font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: #fff4ec; color: #b64300; border: 1px solid var(--critical); }
.notice { padding: .85rem 1.2rem; border-radius: var(--radius-md); font-size: .92rem; margin: 1rem 0; }
.notice-critical { border: 1px solid var(--critical); color: #b64300; background: #fff8f3; }
.notice p { margin: 0 0 .25rem; }

/* ---- Login ---- */
.login-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  overflow: hidden;
  background: var(--black);
}
.login-page::before {
  content: '';
  position: absolute;
  width: 34rem;
  aspect-ratio: 1;
  top: -14rem;
  right: -10rem;
  border-radius: 50%;
  background: var(--accent);
  opacity: .12;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 26rem;
  padding: clamp(2rem, 4vw, 2.75rem);
  border-radius: var(--radius-card);
  background: var(--white);
}
.login-logo { margin-bottom: 1.5rem; }
.login-logo img { display: block; height: 3.2rem; width: auto; }
.login-title {
  font-family: var(--font-display);
  font-size: 2.05rem;
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1;
  margin-bottom: .4rem;
}
.login-subtitle { color: var(--copy); font-weight: 300; margin-bottom: 1.75rem; }
.login-card .btn { margin-top: .5rem; }

/* ---- Prodotti: toolbar di ricerca e filtro ---- */
.catalog-toolbar {
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  display: grid;
  gap: 1rem;
  margin: 0 calc(var(--page-inline) * -1) 1.25rem;
  padding: 1rem var(--page-inline);
  background: rgba(247, 248, 249, .94);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 -1px 0 transparent;
  transition: box-shadow .2s;
}
.catalog-toolbar.stuck { box-shadow: inset 0 -1px 0 var(--border); }
.search-wrap { position: relative; width: 41%; min-width: 20rem; }
.search-wrap svg {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  width: 1.1rem;
  height: 1.1rem;
  transform: translateY(-50%);
  color: var(--copy);
  pointer-events: none;
}
.search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 50rem;
  padding: .6rem 1.6rem .6rem 2.7rem;
  background: var(--white);
  font-size: .95rem;
  font-weight: 300;
  transition: border-color .2s, box-shadow .2s;
}
.search-input::placeholder { color: #9a9ea3; }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(90, 202, 197, .25); }

.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; }
.brand-filter { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.brand-filter-title { font-family: var(--font-display); font-size: .95rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.brand-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.brand-tab {
  border: 1px solid var(--border);
  border-radius: 50rem;
  padding: .5rem 1.15rem .55rem;
  background: var(--white);
  font-size: .9rem;
  font-weight: 400;
  color: var(--muted);
  transition: background .2s, border-color .2s, color .2s;
}
.brand-tab:hover { border-color: var(--accent); color: var(--ink); }
.brand-tab.active { background: var(--accent); border-color: var(--accent); color: var(--white); font-weight: 500; }
.result-meta { display: flex; align-items: center; gap: .6rem; font-size: .88rem; font-weight: 300; color: var(--copy); }
.result-meta .sep { color: var(--border); }
.result-meta #resultCount { font-weight: 500; color: var(--ink); }

/* ---- Prodotti: griglia fluida ---- */
.products-grid {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
}
.grid-header, .grid-row {
  display: grid;
  grid-template-columns:
    minmax(7rem, 1fr)       /* SKU */
    minmax(14rem, 4fr)      /* nome */
    minmax(6rem, 1.2fr)     /* brand */
    minmax(6rem, .9fr)      /* prezzo */
    minmax(7.5rem, 1fr)     /* disponibilità */
    minmax(9.5rem, 1fr)     /* quantità */
    minmax(8.5rem, 1fr);    /* azione */
  align-items: center;
  gap: clamp(.75rem, 1.4vw, 1.75rem);
  padding: .85rem clamp(1rem, 1.8vw, 2rem);
}
.grid-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.grid-row { border-bottom: 1px solid #eceef0; transition: background .15s; }
.grid-row:last-child { border-bottom: 0; }
.grid-row:hover { background: #f5fbfb; }
.grid-row.hidden { display: none; }

.col-sku { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; letter-spacing: .01em; overflow-wrap: anywhere; }
.col-name { font-size: 1rem; font-weight: 400; line-height: 1.35; }
.col-brand { font-size: .9rem; font-weight: 300; color: var(--copy); }
.price-net { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; white-space: nowrap; }
.price-na { color: #9a9ea3; font-size: .9rem; }

.avail-badge {
  display: inline-block;
  border-radius: 50rem;
  padding: .25rem .8rem .3rem;
  font-size: .82rem;
  font-weight: 500;
  white-space: nowrap;
}
.avail-in { background: var(--accent-soft); color: #14615d; }
.avail-out { background: #eceef0; color: var(--copy); }
.avail-error { border: 1px solid var(--critical); color: #b64300; background: #fff8f3; }

/* ---- Controllo quantità ---- */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 50rem;
  padding: .15rem;
  background: var(--white);
}
.qty-btn {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  font-size: 1.2rem;
  line-height: 1;
  transition: background .2s, color .2s;
}
.qty-btn:hover { background: var(--accent); color: var(--white); }
.qty-input {
  width: 3.4rem;
  height: 2.1rem;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  -moz-appearance: textfield;
}
.qty-input:focus { outline: none; }
.qty-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90, 202, 197, .25); }
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- Toast ---- */
.cart-toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  z-index: 200;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: .85rem 1.6rem;
  border-radius: 50rem;
  border-left: 0;
  border-bottom: 3px solid var(--accent);
  background: var(--ink);
  color: var(--white);
  text-align: center;
  font-size: .95rem;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.cart-toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- Carrello ---- */
.cart-table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
}
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  padding: .9rem clamp(1rem, 1.6vw, 1.75rem);
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
}
.cart-table td {
  padding: .9rem clamp(1rem, 1.6vw, 1.75rem);
  border-bottom: 1px solid #eceef0;
  font-size: 1rem;
  vertical-align: middle;
}
.cart-table td:first-child { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.cart-table tbody tr:last-child td { border-bottom: 0; }
.cart-table tfoot td { padding: 1.1rem clamp(1rem, 1.6vw, 1.75rem); border-top: 1px solid var(--border); background: var(--paper); }
.total-label { text-align: right; font-size: .95rem; font-weight: 300; color: var(--copy); }
.total-value { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; white-space: nowrap; }
.line-total { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }

.btn-remove {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: none;
  color: var(--copy);
  font-size: 1.3rem;
  line-height: 1;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-remove:hover { background: var(--critical); border-color: var(--critical); color: var(--white); }

.cart-actions { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  background: var(--white);
  color: var(--copy);
  font-size: 1.1rem;
  font-weight: 300;
  text-align: center;
}

/* ---- Checkout: due colonne (riepilogo a sinistra, dettagli a destra) ---- */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(1rem, 2vw, 2rem);
  align-items: start;
}
.checkout-summary { padding: 0; overflow: hidden; }
.checkout-summary-head { padding: clamp(1.25rem, 2vw, 2rem) clamp(1.25rem, 2vw, 2rem) 1rem; }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th {
  padding: .7rem clamp(1.25rem, 2vw, 2rem);
  background: var(--paper);
  border-block: 1px solid var(--border);
  text-align: left;
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
}
.summary-table th:not(:first-child), .summary-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.summary-table td { padding: .8rem clamp(1.25rem, 2vw, 2rem); border-bottom: 1px solid #eceef0; vertical-align: top; }
.item-sku { display: block; font-family: var(--font-display); font-weight: 600; }
.item-desc { display: block; font-weight: 300; font-size: .92rem; color: var(--muted); }
.summary-table tfoot td { border: 0; padding-block: .45rem; }
.summary-table tfoot tr:first-child td { padding-top: 1.1rem; }
.summary-table tfoot .total-label { color: var(--copy); font-weight: 300; }
.summary-table tfoot .total-value { font-size: 1.15rem; }
.summary-table tfoot tr:last-child td { padding-block: 1rem; border-top: 2px solid var(--accent); }
.summary-table tfoot tr:last-child .total-label { color: var(--ink); font-weight: 500; }
.summary-table tfoot tr:last-child .total-value { font-size: 1.6rem; }
.checkout-summary .field-note, .checkout-summary .notice { margin: 0; padding: .85rem clamp(1.25rem, 2vw, 2rem); }
.checkout-summary .notice { border-radius: 0; border-inline: 0; }

.order-box { display: grid; gap: 1.5rem; }
.order-box .form-group { margin-bottom: 0; }
.order-box .form-group > label, .order-box .field-label { font-size: .88rem; color: var(--muted); }
.order-ref-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Tipo di evasione: controllo segmentato */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .2rem;
  padding: .2rem;
  border: 1px solid var(--border);
  border-radius: 50rem;
  background: var(--paper);
}
.segmented label { margin: 0 !important; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label > span {
  display: block;
  border-radius: 50rem;
  padding: .55rem .9rem;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
  transition: background .2s, color .2s;
}
.segmented input:checked + span { background: var(--white); color: var(--ink); font-weight: 500; box-shadow: 0 1px 4px rgba(18, 18, 24, .15); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.evasion-hint { margin-top: .5rem; }
.segmented label.is-disabled { cursor: not-allowed; }
.segmented label.is-disabled span { opacity: .4; }
.home-icon { display: inline-block; width: 1.05em; height: 1.05em; margin-right: .35em; vertical-align: -.12em; color: var(--accent); }

/* Fatturazione: sola lettura */
.invoice-to { font-style: normal; border-radius: var(--radius-md); padding: .9rem 1.1rem; background: var(--paper); font-weight: 300; line-height: 1.45; }
.invoice-to strong { display: block; font-weight: 500; }

textarea.form-control { border-radius: var(--radius-md); resize: vertical; min-height: 5.5rem; line-height: 1.4; }

/* Delivery Address: indirizzo scelto sempre visibile, elenco apribile */
.address-chosen {
  display: flex;
  align-items: center;
  gap: .9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: .8rem 1rem;
  background: var(--white);
}
.address-check { flex: none; width: 1.7rem; height: 1.7rem; color: var(--accent); }
.address-chosen-text { flex: 1; min-width: 0; line-height: 1.35; }
.address-chosen-text strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.address-chosen-text > span { font-size: .9rem; font-weight: 300; color: var(--copy); overflow-wrap: anywhere; }
.btn-small { padding: .4rem 1rem; font-size: .75rem; }
.address-picker { margin-top: .6rem; display: grid; gap: .6rem; }
.address-list {
  height: auto;
  border-radius: var(--radius-md);
  padding: .4rem;
  background: var(--white);
  font-size: 1rem;
}
.address-list option { padding: .55rem .8rem; border-radius: .6rem; }
.address-list option:checked { background: var(--accent) linear-gradient(0deg, var(--accent), var(--accent)); color: var(--white); }

.checkout-buttons { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.checkout-buttons .btn-submit-order { min-width: 14rem; padding-block: .95rem; }

/* ---- Modale ---- */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .6);
}
.modal-box {
  width: 100%;
  max-width: 28rem;
  padding: 2.25rem 2rem 2rem;
  border-radius: var(--radius-card);
  border-top: 6px solid var(--accent);
  background: var(--white);
  text-align: center;
}
.modal-error .modal-box { border-top-color: var(--critical); }
.modal-box h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; margin-bottom: .75rem; }
.modal-box p { color: var(--copy); font-weight: 300; margin-bottom: 1.5rem; }

/* ---- Storico ordini ---- */
.orders-note { color: var(--copy); font-weight: 300; margin-top: .5rem; }
.order-head {
  display: grid;
  grid-template-columns: var(--order-cols);
  gap: 1rem;
  padding: 0 calc(clamp(1rem, 2vw, 2rem) + 1px) .5rem;
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
}
.order-card { margin-bottom: .75rem; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--white); overflow: hidden; }
.order-card[open] { border-color: var(--accent); }
.order-card summary {
  display: grid;
  grid-template-columns: var(--order-cols);
  gap: 1rem;
  align-items: center;
  padding: 1.1rem clamp(1rem, 2vw, 2rem);
  cursor: pointer;
  list-style: none;
}
.order-card summary::-webkit-details-marker { display: none; }
.order-card summary:hover { background: #f5fbfb; }
.order-ref { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.order-total { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; text-align: right; }
.order-chevron { width: 1.5rem; height: 1.5rem; color: var(--copy); transition: transform .3s var(--ease-out), color .2s; }
.order-card summary:hover .order-chevron { color: var(--ink); }
.order-card[open] .order-chevron { transform: rotate(180deg); color: var(--accent); }
.order-docref { padding: 0 clamp(1rem, 2vw, 2rem) .5rem; font-weight: 300; color: var(--muted); }
.order-card .cart-table-wrapper { margin: .5rem clamp(1rem, 2vw, 2rem) 1.25rem; }

/* ---- Profilo ---- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.25rem; }
.profile-list { display: grid; gap: 1rem; margin-top: 1.25rem; }
.profile-list dt { font-size: .82rem; font-weight: 300; color: var(--copy); }
.profile-list dd { font-size: 1.05rem; font-weight: 400; }

/* ---- Conferma / errore ---- */
.confirmation-page, .error-page {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem;
  text-align: center;
}
.confirmation-icon {
  display: grid; place-items: center;
  width: 4rem; height: 4rem; border-radius: 50%;
  background: var(--accent); color: var(--white); font-size: 2rem; font-weight: 700;
}
.confirmation-page h1, .error-page h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.55rem); font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.error-page h1 { color: var(--ink); }
.confirmation-text, .error-message { max-width: 34rem; font-weight: 300; font-size: 1.1rem; color: var(--muted); }
.confirmation-ref { padding: .45rem 1rem; border-radius: 50rem; background: var(--accent-soft); font-size: .9rem; }
.confirmation-sub { max-width: 34rem; font-size: .9rem; font-weight: 300; color: var(--copy); }

.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--copy); font-weight: 300; }

/* ---- Footer (come il copyright della landing) ---- */
.footer {
  margin-top: auto;
  padding: 1.5rem var(--page-inline);
  background: #121219;
  color: #8d9094;
  text-align: center;
  font-size: .8rem;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .grid-header { display: none; }
  .grid-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'sku avail'
      'name name'
      'brand price'
      'qty action';
    gap: .5rem 1rem;
    padding: 1.1rem 1.25rem;
  }
  .col-sku { grid-area: sku; }
  .col-availability { grid-area: avail; justify-self: end; }
  .col-name { grid-area: name; }
  .col-brand { grid-area: brand; }
  .col-price { grid-area: price; justify-self: end; }
  .col-qty { grid-area: qty; margin-top: .4rem; }
  .col-action { grid-area: action; margin-top: .4rem; }
  .checkout-layout { grid-template-columns: 1fr; }
  .order-head { display: none; }
  .order-card summary { grid-template-columns: 1fr 1fr 1.5rem; }
  .order-total { text-align: left; }
}
@media (max-width: 760px) {
  :root { --nav-height: 4.25rem; }
  .navbar-title { display: none; }
  .navbar-logo { height: 2.4rem; }
  .nav-link { font-size: .85rem; }
  .cart-link .cart-label { display: none; }
  .cart-link { padding: .35rem .4rem .35rem .7rem; }
  .user-company { display: none; }
  .order-ref-row { grid-template-columns: 1fr; }
  .cart-actions .btn, .checkout-buttons .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

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

/* Profile: form email aggiuntive */
.profile-form { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.profile-form .btn { margin-top: .25rem; }
.profile-saved { margin-bottom: .75rem; font-size: .92rem; font-weight: 500; color: #14615d; }

/* ---------- Pannello admin (T70) ---------- */
.inline-form { display: inline; margin: 0; }
.nav-button { background: none; border: 0; cursor: pointer; font: inherit; }
.admin-section { margin-bottom: 1.5rem; }
.admin-muted { color: var(--muted); }
.admin-ok { color: var(--copy); }
.admin-saved { color: var(--ink); font-weight: 500; margin-bottom: 1rem; }
.admin-table td, .admin-table th { white-space: nowrap; }
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-small { padding: .45rem .9rem; font-size: .75rem; }
.admin-form { max-width: 28rem; }
.admin-log { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; font-size: .9rem; }
.admin-credentials { border: 2px solid var(--accent); margin-bottom: 1.5rem; }
.admin-password { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.3rem; letter-spacing: .06em; user-select: all; }
.status-pill { display: inline-block; padding: .15rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 500; background: var(--paper); border: 1px solid var(--border); }
.status-imported { background: #e8f7f6; border-color: var(--accent); color: var(--ink); }
.status-pending, .status-demo, .status-admin { background: var(--paper); color: var(--copy); }
.status-stuck, .status-failed { background: #fff4ec; border-color: var(--critical); color: #b64300; }
.admin-section .card-title { margin-bottom: 1rem; }
.admin-error-row { background: #fff4ec; color: #b64300; font-size: .85rem; white-space: normal !important; }
