/* ===== COLORES ===== */
:root {
  --dark: #0b1315;
  --text: #000000;
  --bg: #171717;
  --dark: #0b1315;
  --white: #FFFFFF;
  --negro: #000000;
  --sand: #C8B89A;
  --gray: #6b7280;
  --gray-light: #e5e7eb;
  --green: #059669;
  --green-bg: #d1fae5;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --red-bg: #fee2e2;
  --cream: #FDFAF3;
  --gold: #E3A93B;
  --gold-bg: #F5DFA6;
  --text: #000000;
  --whatsapp: #25D366;
  --giallo: #FDEE09; /* colorbase tienda */
  --verde: #398f3d; /* colorbase takeaway */
  --green:#0e4f0e; /* colorbase restaurante */
  --burdeos: #911916; /* colorbase mercato */
  --chianti: #8B1A1A; /* colorbase newsletter */
}

/* ===== Breadcrumb ===== */
/* Valori allineati a quelli che le pagine ridichiaravano localmente (e che quindi vincevano
   nella cascata): 10px/0.07em, non 11px/0.03em come prima in questo file. Non cambiare senza
   verificare che nessuna pagina abbia ancora una ridichiarazione locale divergente. */
.breadcrumb-bar { display:flex; align-items:center; background:var(--dark); padding:5px 14px; gap:3px; flex-shrink:0; }
.bc-crumb { font-size:10px; font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:white;
background:none; border:none; cursor:pointer; padding:2px 5px; border-radius:4px; transition:opacity 0.15s; opacity:0.85; font-family:inherit; }
.bc-crumb:hover { opacity:1; }
.bc-sep { font-size:10px; color:rgba(255,255,255,0.4); pointer-events:none; }

/* ===== FONTS ===== */
@font-face { font-family: 'Mercato'; src: url('./mercato.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'MercatoScript'; src: url('./mercatoscript.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'MercatoCursiva'; src: url('./mercatocursiva.ttf') format('truetype'); font-display: swap; }

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== APP SHELL (pagine "carta digitale": tienda, tiendago, dispensa, carta, merchandising,
   takeaway, restaurante, italiano; reservar ne usa solo un sottoinsieme) ===== */
html { scroll-behavior: smooth; }
body {
  font-family: 'Manrope', 'Roboto Condensed', sans-serif;
  /* Fondo fuera del "device" (las franjas laterales): siempre oscuro, fijo, independiente
     de --bg — algunas páginas (ej. mercato_restaurante.html) sobreescriben --bg a un tono
     claro solo para su .device/.view interno, y el fondo exterior no debe seguirlo. */
  background: #171717;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font-family: inherit; }

.device {
  width: 100%;
  max-width: 448px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.view { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.view.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.view.active { animation: fadeIn 0.22s ease; }

/* ================= TOP BAR ================= */
/* .topbar-left NON è qui: il gap varia da pagina a pagina (4px la maggior parte, 14px
   carta/merchandising per via di .search-input) e resta una dichiarazione locale. */
.topbar {
  background: var(--dark);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 40;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topbar-center { flex: 2; display: flex; justify-content: center; }
.topbar-right { flex: 1; display: flex; justify-content: flex-end; position: relative; }
.tb-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.15s, transform 0.1s;
}
.tb-btn:active { transform: scale(0.92); color: #d98a88; }
.tb-btn svg { width: 20px; height: 20px; fill: currentColor; }
.tb-title {
  font-family: 'Mercato', sans-serif;
  color: white;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  padding-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= MENU LINGUA ================= */
.lang-btn {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s;
}
.lang-btn:active { border-color: var(--colorbase); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 132px;
  background: white;
  border-radius: 13px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.22);
  border: 1px solid #f0f0f0;
  overflow: hidden;
  display: none;
  z-index: 90;
}
.lang-menu.open { display: block; animation: fadeIn 0.15s ease; }
.lang-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  text-align: left;
}
.lang-opt:active { background: #f3f4f6; }
.lang-opt.sel { color: var(--colorbase); font-weight: 800; }

/* ================= TOAST (solo pagine app sopra — mercato_dashboard.html ha un
   .toast diverso: fixed, con varianti .success/.error, NON tocca queste regole) ================= */
@keyframes toastIn {
  0% { transform: translate(-50%, 14px); opacity: 0; }
  12% { transform: translate(-50%, 0); opacity: 1; }
  85% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -8px); opacity: 0; }
}
.toast {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17,24,39,0.95);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 30px;
  z-index: 95;
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  animation: toastIn 1.6s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}

/* ================= FLOATING ACTION BUTTON (carrito) =================
   .fab { color: ... } resta una dichiarazione locale per pagina: bianco sulle pagine con
   colorbase scuro (burdeos/verde/green), #1A1A1A su quelle con colorbase chiaro (giallo). */
.fab {
  position: absolute;
  bottom: 22px;
  left: 16px;
  right: 16px;
  z-index: 50;
  background: var(--colorbase);
  border: none;
  padding: 15px;
  border-radius: 16px;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(145,26,22,0.4);
  transition: transform 0.12s ease;
  animation: slideUp 0.3s ease;
}
.fab.visible { display: flex; }
.fab:active { transform: scale(0.96); }
.fab-inner { display: flex; align-items: center; gap: 13px; }
.fab-icon { position: relative; display: flex; }
.fab-icon svg { width: 24px; height: 24px; fill: white; }
.fab-count {
  position: absolute;
  top: -8px; right: -9px;
  background: var(--dark);
  color: white;
  font-size: 0.64rem;
  font-weight: 800;
  min-width: 19px; height: 19px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.fab-label {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  padding-top: 3px;
}

