/* =========================================================
   ECS – Blocco "Mappa Tavoli" — v2
   Restyle basato sul mockup "Osservatorio Food Online 2027"
   (stesso linguaggio grafico: Montserrat, palette verde/
   arancio/giallo su fondo verde scuro, angoli smussati in
   modo asimmetrico, pillole arrotondate per CTA e badge).
 
   Le classi HTML sono IDENTICHE a quelle già generate dallo
   shortcode PHP: non serve cambiare nulla in functions/plugin
   né nel custom-tavoli.js, cambia solo l'aspetto.
 
   Font: se Montserrat è già caricato globalmente dal tema
   (molto probabile, è il font del sito), lascia pure la riga
   @import qui sotto commentata per non caricarlo due volte e
   non rallentare la pagina. Se invece questo blocco è l'unico
   punto del sito che usa Montserrat, decommenta l'@import.
   ========================================================= */
 
/* @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap'); */
 
.ecs-tavoli-wrap {
  /* palette — esattamente i colori forniti */
  --ecs-green: #3fa367;
  --ecs-orange: #f0531c;
  --ecs-orange-hover: #c04216;
  --ecs-yellow: #ffa74e;
  --ecs-white: #f5f7f6;
  --ecs-bg-green: #09332c;
  --ecs-bg-green-deep: #072823;
  --ecs-text-green: #051e1a;
  --ecs-green-hover: #328252;
  --ecs-yellow-hover: #cc853e;
 
  /* toni neutri derivati dalla palette, per testi/bordi attenuati */
  --ecs-white-60: rgba(245, 247, 246, 0.62);
  --ecs-white-35: rgba(245, 247, 246, 0.35);
  --ecs-white-14: rgba(245, 247, 246, 0.14);
  --ecs-green-40: rgba(63, 163, 103, 0.4);
  --ecs-green-14: rgba(63, 163, 103, 0.14);
  --ecs-yellow-14: rgba(255, 167, 78, 0.14);
  --ecs-neutral-pill: color-mix(in srgb, var(--ecs-text-green) 14%, white);
 
  font-family: 'Montserrat', sans-serif;
  color: var(--ecs-white);
  background: var(--ecs-bg-green);
  border-radius: 0 64px 0 32px;
  padding: 48px;
  box-sizing: border-box;
  max-width: 1180px;
  margin-inline: auto;
 
  display: grid;
  grid-template-columns: minmax(0, 480px) 1fr;
  gap: 36px;
  align-items: start;
}
 
.ecs-tavoli-wrap * {
  box-sizing: border-box;
}
 
/* ---------- colonna sinistra: la mappa ---------- */
.ecs-tavoli-map {
  background: var(--ecs-bg-green-deep);
  box-shadow: inset 0 0 0 1px var(--ecs-green-40);
  border-radius: 0 48px 0 24px;
  padding: 28px 18px;
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 14px;
  align-items: stretch;
}
 
/* fasce laterali tratteggiate ("welcome coffee" / "area pranzo") */
.ecs-tavoli-side {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed var(--ecs-yellow);
  background: var(--ecs-yellow-14);
  padding: 14px 4px;
  min-height: 100%;
}
 
.ecs-tavoli-side:last-of-type {
  border-color: var(--ecs-green);
  background: var(--ecs-green-14);
}
 
.ecs-tavoli-side span {
  writing-mode: vertical-rl;
  color: var(--ecs-yellow);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
}
 
.ecs-tavoli-side:last-of-type span {
  color: var(--ecs-green);
  transform: rotate(180deg);
}
 
/* ---------- colonna centrale: palco + griglia tavoli ---------- */
.ecs-tavoli-center {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
 
.ecs-tavoli-palco {
  align-self: center;
  width: 60%;
  min-width: 140px;
  text-align: center;
  background: var(--ecs-orange);
  color: var(--ecs-white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 0 0 18px 18px;
}
 
/* ---------- griglia dei 17 tavoli ---------- */
.ecs-tavoli-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 10px 4px;
  justify-items: center;
}
 
.ecs-tavoli-btn {
  position: relative;
  width: 56px!important;
  height: 56px;
  border-radius: 50%!important;
  border: none!important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px!important;
  color: var(--ecs-white);
  background: var(--ecs-green);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ecs-tavoli-btn.ecs-color-green:hover:not(.ecs-status-complete),
.ecs-tavoli-btn.ecs-color-green:focus:not(.ecs-status-complete),
.ecs-tavoli-btn.ecs-color-green:focus-visible:not(.ecs-status-complete) {
  background-color: var(--ecs-green-hover) !important;
  color: var(--ecs-white) !important;
  text-decoration: none !important;
}

.ecs-tavoli-btn.ecs-color-red:hover:not(.ecs-status-complete),
.ecs-tavoli-btn.ecs-color-red:focus:not(.ecs-status-complete),
.ecs-tavoli-btn.ecs-color-red:focus-visible:not(.ecs-status-complete) {
  background-color: var(--ecs-orange-hover) !important;
  color: var(--ecs-white) !important;
  text-decoration: none !important;
}

.ecs-tavoli-btn.ecs-color-tan:hover:not(.ecs-status-complete),
.ecs-tavoli-btn.ecs-color-tan:focus:not(.ecs-status-complete),
.ecs-tavoli-btn.ecs-color-tan:focus-visible:not(.ecs-status-complete) {
  background-color: var(--ecs-yellow-hover) !important;
  color: var(--ecs-white) !important;
  text-decoration: none !important;
}

.ecs-tavoli-btn.ecs-status-complete:hover,
.ecs-tavoli-btn.ecs-status-complete:focus,
.ecs-tavoli-btn.ecs-status-complete:focus-visible {
  background-color: rgba(245, 247, 246, 0.16) !important;
  color: var(--ecs-white-60) !important;
  text-decoration: none !important;
}
 
/* anello tratteggiato: appare solo al passaggio del mouse / selezione,
   per segnalare che il tavolo è interattivo senza appesantire la vista
   d'insieme della mappa */
.ecs-tavoli-btn::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px dashed currentColor;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
 
.ecs-tavoli-btn svg {
  width: 30px;
  height: 100%;
  position: relative;
  z-index: 1;
}
 
.ecs-tavoli-btn:hover,
.ecs-tavoli-btn:focus-visible,
.ecs-tavoli-btn.is-active {
  box-shadow: 0 0 0 4px var(--ecs-white-35);
  transform: translateY(-1px);
}
 
.ecs-tavoli-btn:hover::before,
.ecs-tavoli-btn:focus-visible::before,
.ecs-tavoli-btn.is-active::before {
  opacity: 0.6;
}
 
.ecs-tavoli-btn:focus-visible {
  outline: none;
}
 
.ecs-tavoli-btn.ecs-color-green { background: var(--ecs-green); color: var(--ecs-green); }
.ecs-tavoli-btn.ecs-color-red   { background: var(--ecs-orange); color: var(--ecs-orange); }
.ecs-tavoli-btn.ecs-color-tan   { background: var(--ecs-yellow); color: var(--ecs-yellow); }
 
/* i colori sopra sono ripetuti anche come "color" perché il bordo
   tratteggiato (::before) usa currentColor: così l'anello prende
   automaticamente la tinta del tavolo. L'icona invece resta bianca: */
.ecs-tavoli-btn svg {
  color: var(--ecs-white);
  stroke: var(--ecs-white);
}
 
.ecs-tavoli-btn.ecs-status-complete {
  background: rgba(245, 247, 246, 0.16);
  color: var(--ecs-white-35);
}
 
.ecs-tavoli-btn.ecs-status-complete svg {
  color: var(--ecs-white-60);
  stroke: var(--ecs-white-60);
}
 
.ecs-tavoli-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ffeddb!important;
  color: var(--ecs-text-green);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--ecs-bg-green-deep);
}
 
.ecs-tavoli-btn.ecs-status-complete .ecs-tavoli-badge {
  background: var(--ecs-white-35);
  color: var(--ecs-text-green);
}
 
/* fascia tratteggiata inferiore ("pannelli e corner partner") */
.ecs-tavoli-corner {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ecs-white-60);
  border: 1px dashed var(--ecs-white-35);
  background: var(--ecs-white-14);
  border-radius: 10px;
  padding: 9px;
}
 
/* ---------- colonna destra: pannelli informativi ---------- */
.ecs-tavoli-panels {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
 
.ecs-tavoli-card {
  background: var(--ecs-white);
  color: var(--ecs-text-green);
  border-radius: 0 32px 0 14px;
  padding: 26px 28px;
  min-height: 190px;
}
 
.ecs-tavoli-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ecs-text-green) 55%, transparent);
}
 
.ecs-tavoli-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
 
.ecs-tavoli-title-row h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}
 
.ecs-tavoli-pill,
.ecs-tavoli-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--ecs-text-green);
}
 
.ecs-status-available { background: var(--ecs-green-14); }
.ecs-status-low        { background: var(--ecs-yellow); }
.ecs-status-complete    { background: var(--ecs-neutral-pill); }
 
.ecs-tavoli-subhead {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ecs-text-green) 55%, transparent);
}
 
.ecs-tavoli-empty {
  font-size: 14px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--ecs-text-green) 65%, transparent);
}
 
.ecs-tavoli-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
}
 
.ecs-tavoli-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}
 
.ecs-tavoli-list li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ecs-green);
}
 
.ecs-tavoli-list .ecs-azienda {
  color: color-mix(in srgb, var(--ecs-text-green) 55%, transparent);
}
 
.ecs-tavoli-more {
  margin: 10px 0 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--ecs-text-green) 55%, transparent);
}
 
.ecs-tavoli-selected-name {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
 
.ecs-tavoli-selected-name.ecs-color-green { color: var(--ecs-green); }
.ecs-tavoli-selected-name.ecs-color-red   { color: var(--ecs-orange); }
.ecs-tavoli-selected-name.ecs-color-tan   { color: #c8862f; } /* variante scura del giallo, per leggibilità su bianco */
 
.ecs-tavoli-desc {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
}
 
.ecs-tavoli-meta {
  margin: 0 0 18px;
  font-size: 13px;
  color: color-mix(in srgb, var(--ecs-text-green) 55%, transparent);
}
 
.ecs-tavoli-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ecs-orange);
  color: var(--ecs-white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 41px;
  margin-right: 12px;
  transition: background-color 0.15s ease;
}

@media screen and (max-width:768px) {
  .ecs-tavoli-cta {
    margin-right: 0px;
    margin-bottom: 12px;
    
  }
}
 
.ecs-tavoli-cta:hover,
.ecs-tavoli-cta:focus-visible {
  background: var(--ecs-orange-hover);
  color: var(--ecs-white);
}
 
.ecs-tavoli-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.55;
  font-style: italic;
  color: color-mix(in srgb, var(--ecs-text-green) 55%, transparent);
}
 
/* ---------- responsive ----------
   Un unico blocco in fondo al file: le media query non aumentano la
   "specificità" di una regola, quindi se una regola senza media query
   viene scritta DOPO una con media query, quella dopo vince comunque
   e la versione mobile rischia di non applicarsi mai. Tenerle tutte
   qui, per ultime, evita il problema alla radice. */
@media (max-width: 900px) {
  .ecs-tavoli-wrap {
    grid-template-columns: 1fr;
    padding: 28px 20px;
    border-radius: 0 40px 0 20px;
  }
}
 
@media (max-width: 560px) {
  .ecs-tavoli-map {
    grid-template-columns: 1fr;
  }
  .ecs-tavoli-side {
    display: none;
  }
}
 