.ccc-app {
  color: #17211d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1320px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.ccc-app * {
  box-sizing: border-box;
}

.ccc-app button,
.ccc-app input,
.ccc-app select {
  font: inherit;
}

.ccc-shell {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(320px, 380px);
  gap: 20px;
  align-items: start;
}

.ccc-workspace,
.ccc-panel,
.ccc-modal-card {
  border: 1px solid #d8dfda;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(25, 39, 34, 0.12);
}

.ccc-topbar,
.ccc-selection,
.ccc-panel {
  padding: 20px;
}

.ccc-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #d8dfda;
}

.ccc-eyebrow {
  margin: 0 0 6px;
  color: #104b5f;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ccc-app h2,
.ccc-app h3 {
  margin: 0;
  color: #17211d;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.ccc-app h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.ccc-app h3 {
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.15;
}

.ccc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #607069;
  font-size: 0.9rem;
  font-weight: 700;
}

.ccc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ccc-dot {
  width: 22px;
  height: 14px;
  border: 2px solid #111;
  border-radius: 3px;
}

.ccc-dot.available { background: #fff; }
.ccc-dot.pending { background: #f4c430; }
.ccc-dot.sold { background: #c62828; }
.ccc-dot.unavailable { background: #111; }

.ccc-selection {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid #d8dfda;
  background: #f9fbf7;
}

.ccc-selection p {
  margin: 0;
  color: #607069;
  font-weight: 800;
}

.ccc-window-notice {
  padding: 10px 12px;
  border: 1px solid #bfd1c7;
  border-radius: 8px;
  background: #f4faf6;
  color: #17211d !important;
}

.ccc-window-notice:empty {
  display: none;
}

.ccc-app a {
  color: #176b87;
  text-decoration: underline;
}

.ccc-controls,
.ccc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ccc-app label,
.ccc-checks legend {
  display: grid;
  gap: 7px;
  color: #607069;
  font-size: 0.9rem;
  font-weight: 800;
}

.ccc-app input,
.ccc-app select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8dfda;
  border-radius: 8px;
  padding: 0 12px;
}

.ccc-checks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #d8dfda;
  border-radius: 8px;
}

.ccc-checks.compact {
  grid-template-columns: repeat(3, minmax(118px, 1fr));
}

.ccc-checks legend,
.ccc-wide {
  grid-column: 1 / -1;
}

.ccc-checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #17211d;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.ccc-checks input {
  width: 18px;
  min-height: 18px;
}

.ccc-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.ccc-map {
  position: relative;
  aspect-ratio: 1338 / 2048;
  overflow: hidden;
  background: #fdfbf6;
}

.ccc-map img {
  display: block;
  width: 100%;
  height: auto;
}

.ccc-booth-layer {
  position: absolute;
  inset: 0;
}

.ccc-map-landmark {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: max-content;
  max-width: 150px;
  padding: 4px 7px;
  border: 1px solid rgba(23, 33, 29, .45);
  border-radius: 6px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 12px rgba(18, 29, 25, .2);
  color: #17211d;
  font-size: clamp(.58rem, .78vw, .74rem);
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  transform: translate(-50%, calc(-100% - 17px));
  pointer-events: none;
}

.ccc-map-landmark-entrance {
  transform: translate(14px, -50%);
}

.ccc-booth {
  position: absolute;
  display: grid;
  width: clamp(26px, 4.2%, 44px);
  aspect-ratio: 1.3 / 1;
  place-content: center;
  border: 2px solid #111;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(18, 29, 25, .25);
  color: #111;
  font-size: clamp(0.68rem, 1.8%, 0.86rem);
  font-weight: 800;
  translate: -50% -50%;
}

.ccc-booth.pending_wire {
  border-color: #6b5200;
  background: #f4c430;
  color: #111;
  cursor: not-allowed;
}

.ccc-booth.sold {
  border-color: #741313;
  background: #c62828;
  color: #fff;
  cursor: not-allowed;
}

.ccc-booth.unavailable {
  border-color: #000;
  background: #111;
  color: #fff;
  cursor: not-allowed;
}

.ccc-booth.selected {
  outline: 3px solid #176b87;
  outline-offset: 2px;
  box-shadow: 0 10px 24px rgba(23, 107, 135, .35);
}

.ccc-product-label {
  position: absolute;
  z-index: 3;
  width: max-content;
  max-width: 156px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .99);
  box-shadow: 0 7px 18px rgba(18, 29, 25, .28);
  color: #111a17;
  font-size: clamp(.62rem, .82vw, .78rem);
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
  pointer-events: none;
  text-align: center;
  translate: -50% calc(-100% - 10px);
}

.ccc-product-label.paired {
  translate: -50% -50%;
}

.ccc-product-label.pending_wire {
  border: 3px solid #f4c430;
}

.ccc-product-label.sold {
  border: 3px solid #c62828;
}

.ccc-consent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.ccc-regulation-link {
  font-weight: 900;
}

.ccc-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ccc-muted,
.ccc-message {
  color: #607069;
  line-height: 1.5;
}

.ccc-details dl,
.ccc-wire-box dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ccc-details div,
.ccc-wire-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #d8dfda;
}

.ccc-actions,
.ccc-modal-actions,
.ccc-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ccc-app button {
  min-height: 44px;
  border: 1px solid #d8dfda;
  border-radius: 8px;
  background: #fff;
  color: #17211d;
  font-weight: 800;
  cursor: pointer;
}

.ccc-app button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ccc-app .ccc-booth:disabled {
  opacity: 1;
}

/*
 * I temi WordPress possono applicare ai pulsanti dimensioni minime, padding e
 * trasformazioni pensate per i normali pulsanti della pagina. Queste regole
 * mantengono i segnaposto della mappa compatti e allineati anche su iPhone.
 */
.ccc-app .ccc-map button.ccc-booth {
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  position: absolute !important;
  display: grid !important;
  place-content: center !important;
  width: clamp(24px, 3.8%, 42px) !important;
  height: clamp(19px, 2.45%, 32px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 2px solid #111 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: 0 3px 10px rgba(18, 29, 25, .25) !important;
  color: #111 !important;
  font-family: inherit !important;
  font-size: clamp(10px, 1.2vw, 14px) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
  white-space: nowrap !important;
  transform: translate(-50%, -50%) !important;
  translate: none !important;
  opacity: 1 !important;
  touch-action: manipulation;
}

.ccc-app .ccc-map button.ccc-booth.pending_wire {
  border-color: #6b5200 !important;
  background: #f4c430 !important;
  color: #111 !important;
}

.ccc-app .ccc-map button.ccc-booth.sold {
  border-color: #741313 !important;
  background: #c62828 !important;
  color: #fff !important;
}

.ccc-app .ccc-map button.ccc-booth.unavailable {
  border-color: #000 !important;
  background: #111 !important;
  color: #fff !important;
}

.ccc-app .ccc-map button.ccc-booth.selected {
  outline: 3px solid #176b87 !important;
  outline-offset: 2px !important;
  box-shadow: 0 10px 24px rgba(23, 107, 135, .35) !important;
}

.ccc-app .ccc-map button.ccc-booth:disabled {
  opacity: 1 !important;
}

.ccc-primary {
  border-color: #176b87 !important;
  background: #176b87 !important;
  color: #fff !important;
}

.ccc-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(16, 27, 23, .45);
}

.ccc-modal-card {
  position: relative !important;
  top: auto !important;
  transform: none !important;
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: 0 auto !important;
  overflow-y: auto;
  padding: 22px;
}

.ccc-modal-host {
  max-width: none;
  margin: 0;
}

.ccc-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.ccc-wire-box,
.ccc-summary {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #bfd1c7;
  border-radius: 8px;
  background: #f4faf6;
}

.ccc-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #17211d;
  font-weight: 800;
}

.ccc-hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .ccc-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ccc-modal {
    padding: 10px;
  }

  .ccc-modal-card {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 16px;
  }

  .ccc-controls,
  .ccc-form-grid,
  .ccc-checks.compact {
    grid-template-columns: 1fr;
  }

  .ccc-topbar {
    display: grid;
  }

  .ccc-app h2 {
    font-size: 2rem;
  }

  .ccc-app .ccc-map button.ccc-booth {
    width: clamp(22px, 6.4vw, 30px) !important;
    height: clamp(17px, 4.9vw, 23px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-width: 2px !important;
    border-radius: 4px !important;
    font-size: clamp(10px, 3vw, 13px) !important;
    line-height: 1 !important;
  }

  .ccc-product-label {
    max-width: 104px;
    padding: 3px 5px;
    font-size: 10px;
  }

  .ccc-map-landmark {
    max-width: 92px;
    padding: 3px 4px;
    font-size: 9px;
    transform: translate(-50%, calc(-100% - 12px));
  }

  .ccc-map-landmark-entrance {
    max-width: 88px;
    transform: translate(8px, -50%);
  }
}

/* 0.4.15: long exhibitor product descriptions live below the map rather than
 * covering free booking targets. */
.ccc-products-guide {
  margin: 12px 18px 20px;
  padding: 10px 14px;
  border: 1px solid #d8dfda;
  border-radius: 7px;
  background: #f8faf8;
  font-size: 0.9rem;
}
.ccc-products-guide summary {
  cursor: pointer;
  font-weight: 750;
}
.ccc-products-guide-list ul {
  margin: 10px 0 0 20px;
  padding: 0;
}
.ccc-products-guide-list li { margin: 5px 0; }
.ccc-products-guide-list p { margin: 10px 0 2px; }

/* Città della Castagna 1.1.1: l'intera mappa rimane sempre dentro la pagina.
 * Mai larghezze minime né scorrimento orizzontale, su telefono o su desktop. */
.ccc-app { width: 100%; min-width: 0; max-width: 1320px; }
.ccc-shell { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ccc-workspace, .ccc-selection, .ccc-map-scroll, .ccc-panel { width: 100%; min-width: 0; }
.ccc-map-scroll { max-width: 100%; overflow: visible; }
.ccc-map {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 1907 / 825;
  height: auto;
  container-type: inline-size;
  container-name: castagna-map;
}
.ccc-map img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.ccc-app .ccc-map button.ccc-booth,
.ccc-app .ccc-map button.ccc-booth:disabled {
  width: 1.76% !important;
  height: 4.02% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  border-width: 1px !important;
  border-radius: 2px !important;
  font-size: clamp(5px, .78cqw, 13px) !important;
  letter-spacing: -.02em !important;
  line-height: 1 !important;
  z-index: 3;
}
.ccc-map-help {
  margin: 12px 18px;
  font-size: 13px;
  color: #526158;
  line-height: 1.45;
}
/* Selettore con aree tattili reali, separato dai micro-punti della mappa. */
.ccc-stand-selector { margin: 14px 18px 20px; min-width: 0; }
.ccc-stand-selector-heading { margin-bottom: 12px; }
.ccc-app .ccc-stand-selector-heading h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
.ccc-stand-selector-heading p { margin: 4px 0 0; color: #526158; font-size: 13px; line-height: 1.4; }
.ccc-stand-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 9px;
}
.ccc-app button.ccc-stand-choice {
  min-width: 0;
  min-height: 60px;
  padding: 9px 5px;
  border: 2px solid #222;
  border-radius: 7px;
  background: #fff;
  color: #17211d;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  line-height: 1.15;
  text-align: center;
  text-transform: none;
  box-shadow: none;
}
.ccc-stand-choice strong { font-size: 15px; font-weight: 850; }
.ccc-stand-choice small { font-size: 11px; font-weight: 650; }
.ccc-app button.ccc-stand-choice.pending_wire { background: #f4c430; border-color: #6b5200; color: #151515; }
.ccc-app button.ccc-stand-choice.sold { background: #c62828; border-color: #741313; color: #fff; }
.ccc-app button.ccc-stand-choice.unavailable { background: #242424; border-color: #000; color: #fff; }
.ccc-app button.ccc-stand-choice.ccc-no-pair { background: #e8ece9; border-color: #adb9af; color: #43534a; }
.ccc-app button.ccc-stand-choice.selected {
  outline: 3px solid #176b87;
  outline-offset: 2px;
  box-shadow: 0 3px 12px rgba(23, 107, 135, .3);
}
.ccc-app button.ccc-stand-choice:disabled { opacity: 1; cursor: not-allowed; }
@container castagna-map (max-width: 740px) {
  /* I punti rimangono visibili sulla piantina senza sovrapporsi.
   * Per scegliere uno stand su piccoli schermi si usano i pulsanti qui sotto. */
  .ccc-app .ccc-map button.ccc-booth { pointer-events: none !important; font-size: 0 !important; }
}
@media (max-width: 760px) {
  .ccc-stand-selector { margin-inline: 12px; }
  .ccc-map-help { margin-inline: 12px; }
  .ccc-stand-buttons { grid-template-columns: repeat(auto-fit, minmax(min(100%, 75px), 1fr)); gap: 7px; }
  .ccc-app button.ccc-stand-choice { min-height: 56px; padding: 6px 3px; }
  .ccc-stand-choice strong { font-size: 13px; }
  .ccc-stand-choice small { font-size: 10px; }
}
