/* ═══════════════════════════════════════════════════════════
   ARIAGAS – bottom_nav.css  (icona + etichetta, globale)
   ═══════════════════════════════════════════════════════════ */

/* ── BOTTOM NAV ──────────────────────────────────────────── */
.gbn-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1.5px solid #e8e8e8;
  display: flex;
  align-items: stretch;
  z-index: 900;
  padding: 0 2px;
  gap: 0;
}

/* Item base — colonna: icona sopra, etichetta sotto */
.gbn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #888;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 6px 2px 4px;
  transition: color .18s, background .18s;
  text-align: center;
  font-family: inherit;
  position: relative;
}
.gbn-item:hover  { color: #2aa3d3; background: #f0f8fd; }
.gbn-item.attivo { color: #2aa3d3; }

/* Icona (emoji grande) */
.gbn-ico {
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Etichetta (testo sotto l'icona) */
.gbn-lbl {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

/* Tasto + centrale circolare */
.gbn-nuovo {
  background: #2aa3d3;
  color: #fff !important;
  border-radius: 14px;
  flex: 1;
  padding: 0;
}
.gbn-nuovo:hover { background: #1a7fa8; }
.gbn-nuovo .gbn-ico {
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}

/* Badge notifiche (su .gbn-ico) */
.gbn-badge {
  position: absolute;
  top: -5px; right: -8px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  min-width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
  border: 1.5px solid #fff;
}

/* ── OVERLAY MENU ────────────────────────────────────────── */
.gbn-overlay {
  display: none;          /* IMPORTANTE: display:none, non visibility:hidden */
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
}

/* ── SIDE MENU ───────────────────────────────────────────── */
.gbn-menu {
  position: fixed;
  top: 0; right: -100%;
  width: min(320px, 90vw);
  height: 100%;
  background: #fff;
  z-index: 1100;
  overflow-y: auto;
  transition: right .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
  padding-bottom: 80px;
}
.gbn-menu.open { right: 0; }

.gbn-menu-header {
  background: #2aa3d3;
  color: #fff;
  padding: 24px 16px 18px;
}
.gbn-menu-logo { font-size: 19px; font-weight: 900; letter-spacing: 1px; }
.gbn-menu-sub  { font-size: 13px; opacity: .85; margin-top: 4px; }

.gbn-sec-label {
  display: block;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: #aaa;
  padding: 18px 16px 6px;
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
}
.gbn-sec-label:first-child { border-top: none; margin-top: 0; }

.gbn-menu-body a {
  display: flex; align-items: center;
  padding: 13px 16px;
  text-decoration: none;
  color: #222;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid #f5f5f5;
  transition: background .1s;
}
.gbn-menu-body a:hover { background: #f0f8fd; color: #2aa3d3; }

/* ── CALENDARIO MINI ─────────────────────────────────────── */
#gbnCalPanel {
  position: fixed;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  left: 0; right: 0;
  background: #fff;
  border-top: 2px solid #2aa3d3;
  z-index: 895;
  padding: 12px 16px 14px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  display: none;
  max-width: 420px;
  margin: 0 auto;
}
#gbnCalPanel .gcal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
#gbnCalPanel .gcal-btn {
  background: none;
  border: 1.5px solid #d0dae8;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 18px;
  cursor: pointer;
  color: #2aa3d3;
}
#gbnCalPanel .gcal-titolo {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}
#gbnCalGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}
.gcal-head {
  font-size: 10px;
  font-weight: 800;
  color: #888;
  padding: 2px 0;
}
.gcal-head.we { color: #e74c3c; }
.gcal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #222;
  border-radius: 50%;
  transition: background .15s;
}
.gcal-day:hover { background: #eaf7ff; }
.gcal-day.we    { color: #e74c3c; }
.gcal-day.oggi  { background: #2aa3d3; color: #fff; font-weight: 900; }
.gcal-day.past  { color: #bbb; }
#gbnCalClose {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  padding: 4px 0;
}
#gbnCalOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 890;
}

/* Padding corpo per non coprire contenuto con la barra */
body { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }

/* Desktop: bottom nav VISIBILE — centrato con bordi arrotondati */
@media (min-width: 900px) {
  .gbn-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(860px, 94vw);
    border-radius: 18px 18px 0 0;
    border: 1.5px solid #e0e0e0;
    border-bottom: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,.1);
    height: 68px;
  }
  .gbn-ico { font-size: 24px; }
  .gbn-lbl { font-size: 10px; }
  #gbnCalPanel  { display: none !important; }
  #gbnCalOverlay{ display: none !important; }
  body { padding-bottom: 78px; }
}

/* ── POPUP AGGIUNGI (sopra il tasto +) ───────────────────── */
#gbnAggPopup {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.22);
  z-index: 1200;   /* sopra overlay (1000) e side menu (1100) */
  min-width: 220px;
  overflow: hidden;
  display: none;
}
#gbnAggPopup a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  text-decoration: none;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid #f0f0f0;
  transition: background .12s;
}
#gbnAggPopup a:last-child { border-bottom: none; }
#gbnAggPopup a:hover { background: #f0f8fd; color: #2aa3d3; }
#gbnAggPopup.show { display: block; }

/* ── PULSANTI C / W nei link menu ────────────────────────── */
.gbn-cw-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f5f5f5;
}
.gbn-cw-row > a {
  flex: 1;
  border-bottom: none !important;
}
.gbn-cw-btn {
  flex-shrink: 0;
  width: 34px;
  border: none;
  background: #f4f4f4;
  color: #555;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  border-left: 1px solid #eee;
  transition: background .12s, color .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.gbn-cw-btn:hover   { background: #e0f0ff; color: #2aa3d3; }
.gbn-cw-btn.gbn-wa  { background: #f0fff4; color: #25d366; }
.gbn-cw-btn.gbn-wa:hover { background: #25d366; color: #fff; }

/* Badge pulse quando arriva nuova richiesta */
@keyframes gbn-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.gbn-badge.pulse { animation: gbn-pulse .4s ease; }

/* ── BARRA CENSIMENTI (selettore sezioni) ────────────────── */
.cen-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 2px solid #d0dae8;
  position: sticky;
  top: 44px;   /* sotto il top nav */
  z-index: 80;
}
.cen-title {
  font-size: 13px;
  font-weight: 900;
  color: #1a7fa8;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 10px 4px 0;
  border-right: 1.5px solid #d0dae8;
  flex-shrink: 0;
}
.cen-title:hover { color: #2aa3d3; }
.cen-sel {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid #d0dae8;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}
.cen-sel:focus { border-color: #2aa3d3; }
