/* =========================================================
   AC UI — stile condiviso per le pagine del configuratore
   Tutto è racchiuso in .ac-app per non interferire col sito.
   ========================================================= */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

.ac-app {
  --ac-pink: #f20050;
  --ac-pink-dark: #d1004a;
  --ac-pink-soft: #fdeef3;
  --ac-ink: #3c3c3c;
  --ac-grey: #8a8a8a;
  --ac-grey-2: #6f6f6f;
  --ac-grey-light: #c9c9c9;
  --ac-line: #e6e6e6;
  --ac-surface: #fdfdfd;
  --ac-sand: #ede9e8;
  --ac-nav: #cbc5c3;
  --ac-logo: #31647a;
  --ac-amber: #fbae09;
  --ac-amber-soft: #fdf5e4;
  --ac-radius-l: 20px;
  --ac-radius-m: 12px;
  --ac-radius-s: 6px;
  --ac-right: 403px;

  box-sizing: border-box;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ac-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.35;
  min-height: 100vh;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.ac-app *, .ac-app *::before, .ac-app *::after { box-sizing: border-box; }
:where(.ac-app) a { color: inherit; text-decoration: none; }
:where(.ac-app) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.ac-app) img { display: block; max-width: 100%; }
:where(.ac-app) :where(h1, h2, h3, p) { margin: 0; }
.ac-app :focus-visible { outline: 2px solid var(--ac-pink); outline-offset: 2px; }

/* ---------- Header ---------- */
.ac-top { display: flex; align-items: center; gap: 20px; height: 74px; flex: none; }
.ac-logo {
  width: 74px; height: 74px; flex: none; border-radius: 15px;
  background: var(--ac-logo); color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 27px; letter-spacing: .2px;
  transition: filter .15s;
}
.ac-logo:hover { filter: brightness(1.08); }
.ac-nav {
  flex: 1; height: 74px; display: flex; gap: 10px; padding: 10px;
  background: var(--ac-nav); border: 1px solid #bfb8b7; border-radius: 22px;
}
.ac-tab {
  height: 100%; display: flex; align-items: center; padding: 0 20px;
  background: var(--ac-surface); border: 1px solid #e4e2e1; border-radius: 12px;
  font-weight: 600; font-size: 15px; color: var(--ac-ink); white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
  transition: background .15s, color .15s, transform .1s;
}
.ac-tab:hover { background: #fff; color: var(--ac-pink); }
.ac-tab:active { transform: scale(.99); }
.ac-tab.is-active { flex: 1; color: var(--ac-pink); }
.ac-nav--dark { background: var(--ac-ink); border-color: var(--ac-ink); }
.ac-nav--dark .ac-tab.is-active { background: var(--ac-sand); border-color: var(--ac-sand); }
.ac-demo {
  flex: none; height: 36px; padding: 0 12px; display: inline-flex; align-items: center;
  border-radius: 12px; background: #ffd7d8; color: #ea3340; font-weight: 600; font-size: 15px;
  margin-left: 0;
}
.ac-avatar { width: 74px; height: 74px; flex: none; border-radius: 15px; overflow: hidden; background: #eee; margin-left: 0; }
.ac-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Layout ---------- */
.ac-main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) var(--ac-right);
  gap: 22px; padding-top: 20px; min-height: 0;
}
.ac-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ac-col--right { gap: 0; }
.ac-push { margin-top: auto; }

/* ---------- Testata di prodotto ---------- */
.ac-code {
  align-self: flex-start; margin-left: 10px;
  font-size: 11.5px; font-weight: 600; color: #6f6f6f; letter-spacing: .1px;
  padding: 2px 5px; border: 1px solid #e3e3e3; border-radius: 6px; background: #fafafa;
  line-height: 15px;
}
.ac-title { font-size: 36.5px; font-weight: 600; letter-spacing: -.2px; line-height: 1.1; margin: 14px 0 0 10px; }
.ac-sub { font-size: 20px; font-weight: 400; color: var(--ac-grey); margin: 15px 0 0 10px; }

/* ---------- Campi misura ---------- */
.ac-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 47px; }
.ac-metric {
  position: relative; height: 110px; border-radius: 14px; overflow: hidden;
  background: #fbfbfb; border: 1px solid #dcdcdc; cursor: ew-resize; user-select: none;
  padding: 18px 20px 0; touch-action: pan-y;
  transition: border-color .2s, box-shadow .2s;
}
.ac-metric:hover { border-color: #c8c8c8; }
.ac-metric__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 70%;
  background: linear-gradient(90deg, rgba(240,240,240,0) 0%, rgba(240,240,240,0) 45%, #f1f1f1 100%);
  pointer-events: none; transition: width .12s ease-out;
}
.ac-metric__label { position: relative; display: block; font-size: 20px; font-weight: 500; color: #c9c9c9; line-height: 1; }
.ac-metric__value { position: relative; display: flex; align-items: baseline; margin-top: 16px; line-height: 1; }
.ac-metric__value input {
  font: inherit; font-size: 36px; font-weight: 600; color: var(--ac-ink); letter-spacing: -.3px;
  border: 0; background: transparent; padding: 0; margin: 0; width: 4ch; outline: none; cursor: text; line-height: 1; height: 1em;
  -moz-appearance: textfield;
}
.ac-metric__value input::-webkit-outer-spin-button, .ac-metric__value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ac-metric__unit { font-size: 24px; font-weight: 500; color: #c9c9c9; margin-left: -1px; }
.ac-metric.is-warn { border: 2px solid var(--ac-amber); padding: 17px 19px 0; }
.ac-metric.is-warn .ac-metric__fill { background: linear-gradient(90deg, rgba(252,242,220,0) 0%, rgba(252,242,220,0) 40%, #fbefd6 100%); }
.ac-metric.is-focus { box-shadow: 0 0 0 3px rgba(242,0,80,.12); }
.ac-metrics--readonly { gap: 26px; padding-right: 12px; }
.ac-metrics--readonly .ac-metric { cursor: default; box-shadow: 3px 0 0 0 #e2e2e2, 12px 0 14px -6px rgba(0,0,0,.06); }
.ac-metrics--readonly .ac-metric.is-warn { box-shadow: 3px 0 0 0 var(--ac-amber), 12px 0 14px -6px rgba(0,0,0,.06); }
.ac-metrics--readonly .ac-metric__value input { cursor: default; pointer-events: none; }

.ac-warn {
  margin-top: 10px; min-height: 49px; border-radius: 12px; background: var(--ac-amber-soft);
  display: flex; align-items: center; padding: 0 20px;
  font-size: 15px; font-weight: 600; color: var(--ac-ink);
  transition: opacity .2s, max-height .25s, margin .25s;
}
.ac-warn[hidden] { display: flex; opacity: 0; max-height: 0; min-height: 0; margin-top: 0; overflow: hidden; }

/* ---------- Finiture ---------- */
.ac-swatches { display: flex; gap: 11px; margin-top: 43px; }
.ac-swatch {
  height: 52px; display: flex; align-items: center; gap: 11px; padding: 0 12px;
  background: var(--ac-surface); border: 1px solid #e8e8e8; border-radius: 12px;
  font-weight: 600; font-size: 15px; white-space: nowrap; flex: 0 0 auto;
  transition: flex-grow .35s cubic-bezier(.2,.8,.2,1), border-color .15s, color .15s;
}
.ac-swatch:hover { border-color: #cfcfcf; }
.ac-swatch__pill { width: 9px; height: 27px; border-radius: 5px; background: var(--ac-pink); display: none; }
.ac-swatch__chip { width: 28px; height: 28px; border-radius: 3px; flex: none; }
.ac-swatch.is-active { flex-grow: 1; border: 2px solid var(--ac-pink); color: var(--ac-pink); padding: 0 11px; }
.ac-swatch.is-active .ac-swatch__pill { display: block; }

.ac-chips { display: flex; gap: 10px; margin-top: 41px; }
.ac-chip {
  height: 22px; padding: 0 5px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 22px;
  background: #d8d8d8; color: #f4f4f4; transition: background .15s, color .15s;
}
.ac-chip:hover { background: #cbcbcb; }
.ac-chip.is-on { background: var(--ac-pink); color: #fff; }
.ac-chip.is-on:hover { background: #dd0049; }

/* ---------- Pannelli a destra ---------- */
.ac-panel {
  background: var(--ac-sand); border: 1px solid #dcd8d7; border-radius: var(--ac-radius-l);
  padding: 10px;
}
.ac-panel--price { padding: 14px 10px 10px; }
.ac-price__title { font-size: 20px; font-weight: 600; padding: 0 10px; }
.ac-price__rows { padding: 0 10px; margin-top: 12px; }
.ac-price__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--ac-grey); height: 30px; }
.ac-price__row b { font-weight: 600; }
.ac-price__total { display: flex; justify-content: space-between; align-items: baseline; padding: 0 10px; margin-top: 6px; color: var(--ac-grey); font-size: 15px; }
.ac-price__total strong { font-size: 25px; font-weight: 600; color: var(--ac-ink); letter-spacing: -.2px; }
.ac-panel--price .ac-btns { margin-top: 22px; }
.ac-btns { display: flex; flex-direction: column; gap: 11px; }

.ac-btn {
  height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 13px 0 12px; font-weight: 600; font-size: 15px; color: #fff !important; width: 100%; text-align: left;
  background: var(--ac-pink); border: 1px solid rgba(0,0,0,.08);
  transition: filter .15s, transform .08s, box-shadow .15s;
}
.ac-btn:hover { filter: brightness(1.07); box-shadow: 0 4px 14px -6px rgba(242,0,80,.6); }
.ac-btn:active { transform: translateY(1px); }
.ac-btn--dark { background: var(--ac-ink); }
.ac-btn--dark:hover { box-shadow: 0 4px 14px -6px rgba(0,0,0,.5); filter: brightness(1.15); }
.ac-btn--back { flex-direction: row-reverse; }
.ac-btn--back .ac-ico-arrow { transform: scaleX(-1); }
.ac-btn .ac-ico-arrow { width: 14px; height: 14px; flex: none; transition: transform .15s; }
.ac-btn:hover .ac-ico-arrow { transform: translateX(2px); }
.ac-btn--back:hover .ac-ico-arrow { transform: scaleX(-1) translateX(2px); }
.ac-btn.is-loading { pointer-events: none; opacity: .8; }

/* ---------- Tabella distinta ---------- */
.ac-card {
  background: var(--ac-surface); border: 1px solid #e9e9e9; border-radius: var(--ac-radius-l); overflow: hidden;
}
.ac-card__title { font-size: 15.5px; font-weight: 600; padding: 17px 20px 0; height: 51px; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ac-table th { text-align: left; font-weight: 600; color: var(--ac-ink); background: var(--ac-sand); height: 28px; padding: 0 0 0 20px; }
.ac-table td { height: 28px; padding: 0 0 0 20px; font-weight: 500; color: var(--ac-grey-2); }
.ac-table tbody tr:nth-child(odd) td { background: #fdfdfd; }
.ac-table tbody tr:nth-child(even) td { background: #f6f5f4; }
.ac-table tbody tr { transition: background .1s; }
.ac-table tbody tr[data-module] { cursor: pointer; }
.ac-table tbody tr:hover td, .ac-table tbody tr.is-hl td { background: var(--ac-pink-soft); color: var(--ac-ink); }
.ac-table .col-1 { width: 34.2%; }
.ac-table .col-2 { width: 36.3%; }
.ac-table .col-3 { width: 14.8%; }
.ac-code-pill {
  display: inline-block; font-size: 12.5px; font-weight: 500; color: var(--ac-grey-2); background: #fff;
  border: 1px solid #e2e2e2; border-radius: 5px; padding: 1px 4px; line-height: 16px;
}
.ac-auto {
  display: inline-block; font-size: 11px; font-weight: 500; background: #fdd8e3; color: var(--ac-pink);
  border-radius: 5px; padding: 0 5px; line-height: 17px; margin-right: 8px;
}

/* ---------- Tab vista (3D / Pianta) ---------- */
.ac-viewtabs { display: flex; gap: 11px; height: 52px; flex: none; }
.ac-viewtab {
  display: flex; align-items: center; gap: 11px; padding: 0 19px;
  background: var(--ac-surface); border: 1px solid #e9e9e9; border-radius: 12px;
  font-weight: 600; font-size: 15.5px; transition: border-color .15s, color .15s, flex-grow .3s;
}
.ac-viewtab:hover { border-color: #cfcfcf; }
.ac-viewtab__pill { width: 9px; height: 27px; border-radius: 5px; background: var(--ac-pink); display: none; }
.ac-viewtab.is-active { flex: 1; border: 2px solid var(--ac-pink); color: var(--ac-pink); padding: 0 10px; }
.ac-viewtab.is-active .ac-viewtab__pill { display: block; }

/* ---------- Liste (moduli / fonti) ---------- */
.ac-listhead { display: flex; justify-content: space-between; align-items: center; height: 24px; padding: 0 4px 0 4px; font-weight: 600; font-size: 15.5px; position: relative; }
.ac-dots { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; margin-right: -4px; }
.ac-dots:hover { background: #f1f1f1; }
.ac-list { display: flex; flex-direction: column; gap: 11px; margin-top: 11px; }
.ac-item {
  height: 57px; display: flex; align-items: center; gap: 10px; padding: 0 23px 0 2px; width: 100%; text-align: left;
  background: var(--ac-surface); border: 1px solid #e5e5e5; border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.ac-item:hover { border-color: #cfcfcf; box-shadow: 0 4px 12px -8px rgba(0,0,0,.25); }
.ac-item.is-active { border-color: var(--ac-pink); box-shadow: 0 0 0 1px var(--ac-pink); }
.ac-item__thumb { width: 51px; height: 51px; border-radius: 6px; flex: none; background: #efefef center/cover no-repeat; overflow: hidden; }
.ac-item__icon { width: 51px; height: 51px; flex: none; display: grid; place-items: center; color: var(--ac-ink); }
.ac-item__body { display: block; flex: 1; min-width: 0; padding-left: 0; }
.ac-item__title { display: block; font-weight: 600; font-size: 15.5px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item__sub { display: block; font-size: 12px; color: var(--ac-grey); line-height: 16px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item__count { font-weight: 600; font-size: 15.5px; min-width: 16px; text-align: right; }
.ac-item .ac-auto { margin-right: 17px; font-size: 12px; line-height: 20px; }

.ac-ref {
  display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 5px;
  background: var(--ac-pink-soft); color: var(--ac-pink); font-weight: 600; font-size: 14px; line-height: 1;
  vertical-align: middle; transition: background .15s, color .15s, box-shadow .15s; cursor: pointer;
}
.ac-ref.is-hl, .ac-ref:hover { background: var(--ac-pink); color: #fff; }

/* ---------- Menu contestuale ---------- */
.ac-menu {
  position: absolute; right: 0; top: 28px; z-index: 30; min-width: 190px; padding: 6px;
  background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.25);
  display: none;
}
.ac-menu.is-open { display: block; }
.ac-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.ac-menu button:hover { background: var(--ac-pink-soft); color: var(--ac-pink); }

/* ---------- Toast ---------- */
.ac-toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.ac-toast {
  font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 14px; font-weight: 500; color: #fff;
  background: var(--ac-ink, #3c3c3c); padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
  display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.ac-toast.is-in { opacity: 1; transform: none; }
.ac-toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f20050; flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ac-main { grid-template-columns: 1fr; }
  .ac-col--right { min-height: 0; }
}
@media (max-width: 720px) {
  .ac-top { gap: 10px; height: auto; flex-wrap: wrap; }
  .ac-nav { order: 3; flex-basis: 100%; height: 64px; }
  .ac-metrics { grid-template-columns: 1fr; }
  .ac-swatches { flex-wrap: wrap; }
}
