:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --accent: #38bdf8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bar: #6b7280;
  --ok: #16a34a;
  --danger: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); background: #e8f1f8; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
body.has-hero { background: #cfe3f3 var(--hero, none) center top / cover fixed no-repeat; }
body.no-hero { background: linear-gradient(180deg, #bae0f7 0%, #e8f4fc 45%, #ffffff 100%) fixed; }

.topbar { background: #fff; box-shadow: 0 1px 6px rgba(15,23,42,.12); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.brand img { max-height: 48px; max-width: 200px; object-fit: contain; }
.brand span { font-weight: 800; font-size: 16px; }
.tools { display: flex; align-items: center; gap: 8px; }
.langs { display: flex; gap: 4px; padding: 3px; background: #f1f5f9; border-radius: 8px; }
.langs button { border: 2px solid transparent; background: none; font-size: 20px; cursor: pointer; border-radius: 6px; padding: 2px 5px; line-height: 1; }
.langs button.active { border-color: var(--primary); background: #fff; }
.tbtn { width: 44px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 18px; color: #334155; position: relative; display: grid; place-items: center; }
.tbtn:hover { background: #f1f5f9; }
.tbtn .cnt { position: absolute; top: -8px; right: -8px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 800; border-radius: 10px; padding: 1px 7px; }

main { flex: 1; width: 100%; max-width: 1120px; margin: 24px auto 40px; padding: 0 14px; }
.panel { background: rgba(255,255,255,.97); box-shadow: 0 8px 30px rgba(15,23,42,.18); border-radius: 4px; overflow: hidden; }
.panel-head { background: var(--primary); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.panel-head i { font-size: 28px; opacity: .95; }
.panel-head h1 { font-size: 24px; font-weight: 700; line-height: 1.1; }
.panel-head p { font-size: 14px; opacity: .92; margin-top: 2px; }
.panel-body { padding: 18px; }
.bar { background: var(--bar); color: #fff; text-align: center; font-weight: 700; font-size: 20px; padding: 14px; margin: 4px 0 14px; }

.home-btns { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding: 6px 0 10px; }
.big-btn { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 16px 26px; font-size: 18px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: inherit; box-shadow: 0 4px 12px rgba(2,132,199,.35); }
.big-btn:hover { background: var(--primary-dark); }
.big-btn.alt { background: #7c3aed; box-shadow: 0 4px 12px rgba(124,58,237,.3); }
.big-btn.green { background: #0d9488; box-shadow: 0 4px 12px rgba(13,148,136,.3); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(15,23,42,.08); display: flex; flex-direction: column; }
.card .ph { height: 190px; background: linear-gradient(135deg, #7dd3fc, #0284c7 70%, #0c4a6e); background-size: cover; background-position: center; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 54px; }
.card .cb { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card h3 { font-size: 15px; font-weight: 700; text-transform: uppercase; }
.card .meta { font-size: 13px; color: #475569; line-height: 1.5; }
.card .foot { padding: 0 14px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.price { font-size: 18px; font-weight: 800; color: var(--primary-dark); }
.btn { border: none; border-radius: 4px; background: var(--primary); color: #fff; padding: 11px 22px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.btn.secondary:hover { background: #f1f5f9; }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; padding: 6px 10px; font-size: 13px; }
.btn.green { background: var(--ok); }
.btn.lg { padding: 14px 30px; font-size: 16px; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; background: #dcfce7; color: #15803d; }
.pill.warn { background: #fef3c7; color: #b45309; }
.pill.out { background: #fee2e2; color: #b91c1c; }

.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } .panel-head h1 { font-size: 20px; } .topbar { padding: 8px 12px; } .brand span { display: none; } }
.hero-img { width: 100%; aspect-ratio: 16/10; background: linear-gradient(135deg, #7dd3fc, #0284c7 70%, #0c4a6e); background-size: cover; background-position: center; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 70px; }
.desc { font-size: 15px; line-height: 1.6; color: #334155; margin: 12px 0; white-space: pre-line; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 10px 0; }
.kv b { color: #475569; }
.sched { font-size: 14px; line-height: 1.8; color: #334155; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; color: #1e293b; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 15px; font-family: inherit; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(2,132,199,.35); border-color: var(--primary); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; padding: 9px 14px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.level { flex: 1; min-width: 90px; border: 1px solid #cbd5e1; background: #fff; border-radius: 4px; padding: 10px 6px; text-align: center; cursor: pointer; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #475569; font-family: inherit; }
.level i { display: block; font-size: 22px; margin-bottom: 4px; color: #64748b; }
.level.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; color: var(--primary-dark); }
.level.active i { color: var(--primary); }
.stu { border: 1px solid var(--line); padding: 14px; margin-bottom: 12px; background: #fafcfe; }
.stu h4 { font-size: 16px; margin-bottom: 10px; }

.totalbox { border: 1px solid var(--line); padding: 14px; background: #fff; margin: 14px 0; }
.totalbox .l { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.totalbox .l.big { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.totalbox .l.disc { color: var(--ok); }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.cart-item .t { font-weight: 700; }
.cart-item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.alert { padding: 12px 14px; border-radius: 4px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.alert.err { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert.ok { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert.info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.note { font-size: 13px; color: var(--muted); }

footer { background: var(--primary-dark); border-top: 3px solid var(--accent); color: #fff; text-align: center; padding: 18px 14px 60px; font-size: 13px; line-height: 1.7; }
footer img { max-height: 40px; margin-bottom: 8px; }
.cookie { position: fixed; left: 0; right: 0; bottom: 0; background: #333; color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; font-size: 14px; z-index: 50; }
.cookie button { background: #facc15; border: none; padding: 7px 14px; font-weight: 700; cursor: pointer; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Telefono: logo sopra (centrato), sotto lingue e pulsanti, senza sovrapposizioni */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; justify-content: center; row-gap: 8px; padding: 8px 12px; }
  .brand { flex: 1 1 100%; justify-content: center; }
  .brand img { max-height: 44px; max-width: 70%; }
  .tools { width: 100%; justify-content: space-between; gap: 8px; }
  .langs { flex-shrink: 0; }
  .langs button { font-size: 16px; padding: 4px 8px; }
}

/* Lingue e pulsanti della testata colorati */
.langs { background: transparent; gap: 6px; padding: 0; }
.langs button { font-size: 13px; font-weight: 800; letter-spacing: .03em; padding: 7px 11px; border-radius: 10px; border: 2px solid var(--lc, #0284c7); color: var(--lc, #0284c7); background: #fff; }
.langs button:nth-child(1) { --lc: #0284c7; }
.langs button:nth-child(2) { --lc: #7c3aed; }
.langs button:nth-child(3) { --lc: #0d9488; }
.langs button:nth-child(4) { --lc: #db2777; }
.langs button:nth-child(5) { --lc: #ea580c; }
.langs button:hover { background: color-mix(in srgb, var(--lc) 12%, #fff); }
.langs button.active { background: var(--lc); color: #fff; border-color: var(--lc); }
.tbtn.tb-home { color: #0284c7; border: 2px solid #0284c7; background: #fff; }
.tbtn.tb-home:hover { background: #e0f2fe; }
.tbtn.tb-cart { color: #ea580c; border: 2px solid #ea580c; background: #fff; }
.tbtn.tb-cart:hover { background: #ffedd5; }
@media (max-width: 600px) { .langs button { font-size: 13px; padding: 7px 10px; } }
@media (max-width: 600px) { .tbtn.tb-home { margin-left: auto; } }
