/* ═══════════════════════════════════════════════════════════
   A.L. Forniture - Cataloghi & Preventivi - Frontend CSS
   Versione 1.2.0 - Layout 100vh, 2 colonne, select dropdowns
═══════════════════════════════════════════════════════════ */

#alf.alf-cataloghi-widget {
  --alf-blue:    #1b4f8a;
  --alf-blue-dk: #123568;
  --alf-blue-lt: #e8eef8;
  --alf-blue-md: #2d6bb5;
  --alf-bg:      #f0eff0;
  --alf-surf:    #ffffff;
  --alf-border:  #dddbd4;
  --alf-txt:     #1a1a1a;
  --alf-muted:   #787570;
  --alf-red:     #c0392b;
  --alf-mono:    'JetBrains Mono', 'Consolas', monospace;
  --alf-sans:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --alf-topbar-h: 60px;

  font-family: var(--alf-sans);
  color: var(--alf-txt);
  background: var(--alf-bg);
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  /* height impostato inline da PHP — default 100vh */
  overflow: hidden;
}

#alf.alf-cataloghi-widget *,
#alf.alf-cataloghi-widget *::before,
#alf.alf-cataloghi-widget *::after { box-sizing: border-box; margin: 0; padding: 0; }

#alf.alf-cataloghi-widget input,
#alf.alf-cataloghi-widget textarea,
#alf.alf-cataloghi-widget select,
#alf.alf-cataloghi-widget button { font-family: inherit; font-size: 100%; margin: 0; }

/* ─── Empty state ─── */
.alf-no-cataloghi {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 30px; text-align: center;
  color: var(--alf-muted);
}
.alf-no-cataloghi .alf-empty-icon { font-size: 60px; opacity: .3; margin-bottom: 18px; }
.alf-no-cataloghi h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--alf-txt); }
.alf-no-cataloghi p { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════
   TOPBAR — torna al sito + select + preventivo
═══════════════════════════════════════════════════════════ */
#alf #alf-topbar {
  height: var(--alf-topbar-h);
  background: var(--alf-blue);
  border-bottom: 2px solid var(--alf-blue-dk);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex-shrink: 0;
}

/* Pulsante "Torna al sito" */
#alf .alf-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.22);
  border-radius: 8px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
#alf .alf-back-btn:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
#alf .alf-back-btn svg { stroke-width: 2.5; }

/* Select group */
#alf .alf-selectors {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex: 1;
  min-width: 0;
}
#alf .alf-sel-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#alf .alf-sel-group:nth-child(1) { flex: 0 1 230px; }
#alf .alf-sel-group:nth-child(2) { flex: 1 1 280px; max-width: 360px; }

#alf .alf-sel-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  padding-left: 2px;
  user-select: none;
}

#alf .alf-sel {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 11px;
  background: rgba(255,255,255,.95);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 7px;
  color: var(--alf-txt);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background .15s, border-color .15s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23123568' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  text-overflow: ellipsis;
}
#alf .alf-sel:hover:not(:disabled) {
  background-color: #fff;
  border-color: rgba(255,255,255,.6);
}
#alf .alf-sel:focus {
  background-color: #fff;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}
#alf .alf-sel:disabled {
  opacity: .5;
  cursor: not-allowed;
  background-color: rgba(255,255,255,.6);
}

/* Pill preventivo */
#alf #alf-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  background: rgba(255,255,255,.18);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 8px;
  color: #fff;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
#alf #alf-pill:hover { background: rgba(255,255,255,.28); }
#alf #alf-pill svg { stroke-width: 2.2; }
#alf #alf-pill-n {
  background: #fff;
  color: var(--alf-blue);
  border-radius: 9px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  transition: transform .2s;
}

/* ═══════════════════════════════════════════════════════════
   BODY — 2 colonne: viewer (flex) + sidebar dx (380px)
═══════════════════════════════════════════════════════════ */
#alf #alf-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   VIEWER — colonna sinistra
═══════════════════════════════════════════════════════════ */
#alf #alf-viewer {
  display: flex;
  flex-direction: column;
  background: #2a2a2a;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

#alf #alf-vtb {
  background: #1e1e1e;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border-bottom: 1px solid #111;
}
#alf .vtb-name {
  color: rgba(255,255,255,.75);
  font-size: 12.5px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#alf .vtb-a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.75);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
#alf .vtb-a:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Bottone "Tutti i cataloghi" nella toolbar viewer */
#alf #alf-allcats-btn {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  font-family: inherit;
}
#alf #alf-allcats-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
#alf #alf-allcats-btn.visible { display: inline-flex; }

#alf #alf-frame-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
#alf #alf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  background: #fff;
}

/* schermata di partenza con griglia copertine */
#alf #alf-start {
  position: absolute; inset: 0;
  background: linear-gradient(150deg, #1a1a1a, #2a2a2a);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

#alf .alf-start-header {
  flex-shrink: 0;
  padding: 22px 28px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
#alf .st-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
#alf .st-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,.5);
  line-height: 1.5;
}

#alf #alf-cover-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 11px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
#alf #alf-cover-grid::-webkit-scrollbar { width: 6px; }
#alf #alf-cover-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

#alf .alf-cover-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #2e2e2e;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  text-align: left;
  padding: 0;
  font-family: inherit;
  color: inherit;
  animation: alfCardIn .3s ease both;
}
@keyframes alfCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
#alf .alf-cover-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
#alf .alf-cover-card:active { transform: translateY(-2px); }

#alf .alf-cover-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: #1e1e1e;
  background-size: cover;
  background-position: center top;
  display: block;
  position: relative;
  min-height: 80px;
}
#alf .alf-cover-badge {
  position: absolute;
  top: 5px; right: 5px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
}
#alf .alf-cover-info {
  padding: 6px 9px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #2a2a2a;
}
#alf .alf-cover-cat {
  font-size: 9px;
  color: rgba(255,255,255,.5);
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 3px;
}
#alf .alf-cover-name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* messaggio empty se non ci sono cataloghi (improbabile) */
#alf .alf-cover-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,.35);
  font-size: 13px;
}

/* fallback bloccato */
#alf #alf-blocked {
  display: none;
  position: absolute; inset: 0;
  background: linear-gradient(150deg, #181818, #232323);
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 32px;
}
#alf #alf-blocked.show { display: flex; }
#alf .bl-ic { font-size: 44px; opacity: .3; }
#alf .bl-title { font-size: 16px; font-weight: 700; color: #fff; }
#alf .bl-sub { font-size: 12.5px; color: rgba(255,255,255,.45); line-height: 1.6; max-width: 360px; }
#alf .bl-btn {
  background: var(--alf-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity .15s;
}
#alf .bl-btn:hover { opacity: .85; color: #fff; }
#alf .bl-hint {
  font-size: 11.5px;
  color: rgba(255,255,255,.32);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 380px;
  line-height: 1.6;
  text-align: left;
}

/* toast */
#alf #alf-toast {
  position: absolute; bottom: 14px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(10,10,10,.95);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 18px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 500;
  max-width: 80%;
}
#alf #alf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════════════
   SIDEBAR DX — form aggiunta + lista + dati
═══════════════════════════════════════════════════════════ */
#alf #alf-quote {
  display: flex;
  flex-direction: column;
  background: var(--alf-surf);
  border-left: 1px solid var(--alf-border);
  min-height: 0;
  overflow: hidden;
}

/* Section titles (riutilizzabili) */
#alf .alf-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--alf-blue);
  padding: 11px 15px;
  flex-shrink: 0;
}
#alf .alf-section-title svg { opacity: .9; }

#alf .alf-section-title-light {
  background: #fafaf8;
  color: var(--alf-muted);
  border-top: 2px solid var(--alf-border);
  padding: 11px 14px;
}

/* ── Sezione AGGIUNGI ARTICOLO (in alto a dx) ── */
#alf #alf-add-section {
  flex-shrink: 0;
  background: #fafaf8;
  border-bottom: 2px solid var(--alf-border);
}

#alf #af-src-indicator {
  margin: 10px 14px 0;
  background: var(--alf-blue-lt);
  border: 1px solid #c5d6ed;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: #4a5e7a;
  display: flex;
  align-items: center;
  gap: 7px;
}
#alf #af-src-indicator strong { color: var(--alf-blue-dk); font-weight: 700; }
#alf .af-src-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--alf-blue-md);
  flex-shrink: 0;
}

#alf .af-fields {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#alf .af-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 8px;
}
#alf .af-field { display: flex; flex-direction: column; gap: 3px; }

#alf .af-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--alf-muted);
}
#alf .af-in {
  width: 100%;
  height: 36px;
  font-size: 13px;
  border: 1.5px solid var(--alf-border);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--alf-txt);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#alf .af-in.error { border-color: var(--alf-red); }
#alf .af-in:focus {
  border-color: var(--alf-blue);
  box-shadow: 0 0 0 3px rgba(27,79,138,.12);
}
#alf .af-in.af-qty { text-align: center; font-family: var(--alf-mono); font-weight: 600; }

#alf .af-add {
  width: calc(100% - 28px);
  margin: 0 14px 12px;
  height: 40px;
  background: var(--alf-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: opacity .15s, transform .1s;
}
#alf .af-add:hover { opacity: .88; }
#alf .af-add:active { transform: scale(.98); }

/* ── Lista articoli aggiunti ── */
#alf #alf-qhead { flex-shrink: 0; }
#alf #alf-qhead h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--alf-blue);
  padding: 11px 15px;
}
#alf #alf-qcount {
  background: rgba(255,255,255,.22);
  color: #fff;
  border-radius: 9px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
}

#alf #alf-qlist {
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #e0ddd6 transparent;
  background: #fff;
}
#alf #alf-qlist::-webkit-scrollbar { width: 4px; }
#alf #alf-qlist::-webkit-scrollbar-thumb { background: #e0ddd6; border-radius: 2px; }

#alf .ql-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--alf-muted);
  font-size: 12.5px;
  line-height: 1.7;
}
#alf .ql-empty-ic {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  opacity: .35;
}

#alf .ql-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--alf-border);
  animation: alfQlIn .18s ease both;
}
@keyframes alfQlIn { from{opacity:0;transform:translateX(8px)} to{opacity:1;transform:translateX(0)} }
#alf .ql-row:last-child { border-bottom: none; }
#alf .ql-info { flex: 1; min-width: 0; }
#alf .ql-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.4;
}
#alf .ql-code {
  font-family: var(--alf-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--alf-blue);
}
#alf .ql-sep {
  font-size: 10px;
  color: var(--alf-muted);
  padding: 0 2px;
}
#alf .ql-cat {
  font-size: 10px;
  color: var(--alf-muted);
}

#alf .ql-ctrl { display: flex; flex-direction: row; align-items: center; gap: 4px; flex-shrink: 0; }
#alf .ql-qw { display: flex; align-items: center; gap: 2px; }
#alf .ql-qb {
  width: 19px; height: 19px;
  border-radius: 4px;
  background: var(--alf-bg);
  border: 1.5px solid var(--alf-border);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--alf-txt);
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
#alf .ql-qb:hover { background: var(--alf-blue-lt); border-color: var(--alf-blue); }
#alf .ql-qv {
  font-family: var(--alf-mono);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
#alf .ql-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  padding: 1px;
  font-size: 11px;
  transition: color .15s;
}
#alf .ql-del:hover { color: var(--alf-red); }

/* ── Form dati cliente (in fondo) ── */
#alf #alf-form {
  background: #fafaf8;
  padding: 0 14px 14px;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 50%;
}
#alf #alf-form .alf-section-title-light { margin: 0 -14px 10px; padding: 11px 14px; }

#alf .ff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 7px; }
#alf .ff-full { margin-bottom: 7px; }
#alf .ff-lbl {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--alf-muted);
  margin-bottom: 3px;
}
#alf .ff-in, #alf .ff-sel, #alf .ff-ta {
  width: 100%;
  font-size: 12.5px;
  border: 1.5px solid var(--alf-border);
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  color: var(--alf-txt);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#alf .ff-in.error { border-color: var(--alf-red); }
#alf .ff-in:focus, #alf .ff-sel:focus, #alf .ff-ta:focus {
  border-color: var(--alf-blue);
  box-shadow: 0 0 0 3px rgba(27,79,138,.12);
}
#alf .ff-ta { resize: vertical; min-height: 50px; font-family: inherit; }

#alf .ff-gdpr {
  background: #fff;
  padding: 9px 11px;
  border: 1px solid var(--alf-border);
  border-radius: 7px;
}
#alf .ff-gdpr label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--alf-muted);
  cursor: pointer;
}
#alf .ff-gdpr input[type="checkbox"] { margin-top: 2px; cursor: pointer; flex-shrink: 0; }
#alf .ff-gdpr a { color: var(--alf-blue); }

#alf .ff-send {
  width: 100%;
  padding: 12px;
  background: var(--alf-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: opacity .15s, transform .1s;
}
#alf .ff-send:hover:not(:disabled) { opacity: .88; }
#alf .ff-send:active:not(:disabled) { transform: scale(.98); }
#alf .ff-send:disabled { opacity: .4; cursor: not-allowed; }
#alf .ff-send.loading { opacity: .7; cursor: wait; }

#alf .ff-clear {
  width: 100%;
  padding: 8px;
  background: none;
  border: 1.5px solid var(--alf-border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--alf-muted);
  cursor: pointer;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
}
#alf .ff-clear:hover { border-color: var(--alf-red); color: var(--alf-red); }

/* ═══════════════════════════════════════════════════════════
   SUCCESS OVERLAY
═══════════════════════════════════════════════════════════ */
#alf #alf-suc {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#alf #alf-suc.show { display: flex; }
#alf .suc-box {
  background: #fff;
  border-radius: 14px;
  padding: 36px 28px;
  max-width: 380px;
  width: 92%;
  text-align: center;
  animation: alfSbIn .3s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
@keyframes alfSbIn { from{transform:scale(.85);opacity:0} to{transform:scale(1);opacity:1} }
#alf .suc-ic { font-size: 48px; margin-bottom: 12px; }
#alf .suc-box h2 { font-size: 19px; font-weight: 700; margin-bottom: 8px; color: var(--alf-txt); }
#alf .suc-box p { font-size: 13px; color: var(--alf-muted); line-height: 1.6; }
#alf .suc-ok {
  margin-top: 18px;
  padding: 10px 28px;
  background: var(--alf-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE TAB BAR (< 760px)
═══════════════════════════════════════════════════════════ */
#alf #alf-mobile-tabs {
  display: none;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--alf-border);
  height: 56px;
}
#alf .alf-mtab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--alf-muted);
  font-size: 11px;
  font-weight: 600;
  position: relative;
  transition: color .15s;
  padding: 6px 0;
}
#alf .alf-mtab svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}
#alf .alf-mtab.on {
  color: var(--alf-blue);
}
#alf .alf-mtab.on::after {
  content: '';
  position: absolute;
  top: 0; left: 25%; right: 25%;
  height: 3px;
  background: var(--alf-blue);
  border-radius: 0 0 3px 3px;
}
#alf .alf-mtab-n {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  background: var(--alf-blue);
  color: #fff;
  border-radius: 9px;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
#alf .alf-mtab-n[data-zero="1"] { display: none; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  #alf #alf-body { grid-template-columns: 1fr 340px; }
}

@media (max-width: 900px) and (min-width: 761px) {
  #alf {
    --alf-topbar-h: auto;
  }
  #alf #alf-topbar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }
  #alf .alf-back-btn { order: 1; }
  #alf #alf-pill { order: 2; margin-left: auto; }
  #alf .alf-selectors { order: 3; flex-basis: 100%; gap: 8px; }
  #alf .alf-sel-group:nth-child(1),
  #alf .alf-sel-group:nth-child(2) { flex: 1 1 0; max-width: none; }
}

@media (max-width: 760px) {
  /* Topbar compatta su mobile */
  #alf {
    --alf-topbar-h: auto;
  }
  #alf #alf-topbar {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 7px;
    align-items: stretch;
  }
  #alf .alf-back-btn {
    order: 1;
    padding: 8px 11px;
    font-size: 12px;
  }
  #alf .alf-back-btn span { display: none; }
  #alf #alf-pill {
    order: 2;
    margin-left: auto;
    padding: 8px 12px;
    font-size: 12px;
  }
  #alf #alf-pill span:not(#alf-pill-n) { display: none; }
  #alf .alf-selectors {
    order: 3;
    flex-basis: 100%;
    gap: 7px;
  }
  #alf .alf-sel-group:nth-child(1),
  #alf .alf-sel-group:nth-child(2) { flex: 1 1 0; max-width: none; }
  #alf .alf-sel-lbl {
    font-size: 9px;
  }
  #alf .alf-sel { font-size: 12.5px; height: 34px; }

  /* Body: una sezione alla volta (vista a tab) */
  #alf #alf-body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
  }
  #alf #alf-viewer,
  #alf #alf-quote {
    grid-column: 1;
    grid-row: 1;
  }
  #alf #alf-viewer { display: flex; }
  #alf #alf-quote {
    display: none;
    border-left: none;
    overflow-y: auto;
  }
  #alf[data-mview="quote"] #alf-viewer { display: none; }
  #alf[data-mview="quote"] #alf-quote  { display: flex; }

  /* Mobile tab bar visibile */
  #alf #alf-mobile-tabs { display: flex; }

  #alf #alf-form { max-height: none; }
  #alf .ff-row { grid-template-columns: 1fr 1fr; }

  /* Cover grid: 2 colonne strette */
  #alf #alf-cover-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 9px;
    padding: 12px 12px 16px;
  }
  #alf .alf-start-header {
    padding: 16px 18px 12px;
  }
  #alf .st-title { font-size: 16px; }
  #alf .st-sub { font-size: 12px; }
}

@media (max-width: 480px) {
  #alf .ff-row { grid-template-columns: 1fr; }
  #alf .af-row { grid-template-columns: 1fr 60px; }
  #alf #alf-cover-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 10px 14px;
  }
  #alf .alf-cover-name { font-size: 10.5px; }
  #alf .alf-cover-cat { font-size: 9px; }
}
