/* Wind Pirates — WP Calendar widget (stile isolato, prefisso .wpcal-)
   Palette allineata a excursiones-card.css: primary #009fe3, dark #2c3e50,
   border #e1e8ed. Nessun selettore fuori da .wpcal: il widget non tocca la pagina. */

.wpcal {
  --wpcal-primary: #009fe3;
  --wpcal-dark: #2c3e50;
  --wpcal-border: #e1e8ed;
  background: #fff;
  border: 1px solid var(--wpcal-border);
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
  font-size: 14px;
}
.wpcal-loading { font-size: 0.8em; color: #888; text-align: center; padding: 18px 0; }
.wpcal-msg { grid-column: 1 / -1; font-size: 0.75em; color: #888; text-align: center; padding: 14px 0; }
.wpcal-msg-err { color: #c04747; }

.wpcal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wpcal-title { font-family: 'Titillium Web', sans-serif; color: var(--wpcal-dark); font-size: 0.95em; text-transform: capitalize; }
.wpcal-prev, .wpcal-next {
  width: 26px; height: 26px; border: 1px solid var(--wpcal-border); background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--wpcal-primary); font-weight: 700;
  font-family: inherit; line-height: 1;
}
.wpcal-prev:hover, .wpcal-next:hover { border-color: var(--wpcal-primary); }

.wpcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.wpcal-dow { font-size: 0.6em; font-weight: 700; color: #99a; text-align: center; text-transform: uppercase; padding: 2px 0; }
.wpcal-day {
  position: relative; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 0.72em; font-weight: 600; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; background: #f1f5f7; color: #c2ccd3; user-select: none;
}
.wpcal-day.av   { background: #e6f7ee; color: #1a7f4e; border-color: #bfe8d2; }
.wpcal-day.few  { background: #fdf3dc; color: #9a6b00; border-color: #f0dfae; }
.wpcal-day.full { background: #fdeaea; color: #c04747; border-color: #f3c9c9; text-decoration: line-through; cursor: not-allowed; }
.wpcal-day.off  { cursor: not-allowed; }
.wpcal-day.av:hover, .wpcal-day.few:hover { box-shadow: 0 2px 8px rgba(0,159,227,0.25); }
.wpcal-day.sel {
  background: var(--wpcal-primary) !important; color: #fff !important;
  border-color: var(--wpcal-primary); box-shadow: 0 3px 10px rgba(0,159,227,0.4);
  text-decoration: none;
}
.wpcal-day.inrange { background: #d4effc; color: #0b6f9e; border-color: #a8dff5; }
.wpcal-dot { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.55; }

.wpcal-legend { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.wpcal-legend span { font-size: 0.6em; color: #778; display: flex; align-items: center; gap: 4px; }
.wpcal-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.wpcal-lg-av   { background: #e6f7ee; border: 1px solid #bfe8d2; }
.wpcal-lg-few  { background: #fdf3dc; border: 1px solid #f0dfae; }
.wpcal-lg-full { background: #fdeaea; border: 1px solid #f3c9c9; }
.wpcal-lg-off  { background: #f1f5f7; border: 1px solid var(--wpcal-border); }

.wpcal-panel { margin-top: 10px; border-top: 1px dashed var(--wpcal-border); padding-top: 10px; display: none; }
.wpcal-panel.open { display: block; }
.wpcal-lbl { font-size: 0.68em; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.wpcal-lbl b { color: var(--wpcal-dark); }

.wpcal-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.wpcal-slot {
  border: 1.5px solid var(--wpcal-border); background: #fff; border-radius: 20px;
  padding: 6px 12px; font-size: 0.75em; font-weight: 700; color: var(--wpcal-dark);
  cursor: pointer; font-family: inherit; line-height: 1.2; text-align: center;
}
.wpcal-slot small { display: block; font-size: 0.82em; font-weight: 600; color: #1a7f4e; }
.wpcal-slot.few small { color: #9a6b00; }
.wpcal-slot.full { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }
.wpcal-slot.full small { color: #c04747; text-decoration: none; }
.wpcal-slot:not(.full):hover { border-color: var(--wpcal-primary); }
.wpcal-slot.sel { background: var(--wpcal-primary); border-color: var(--wpcal-primary); color: #fff; }
.wpcal-slot.sel small { color: #e0f4ff; }
/* Sola lettura: chip informativo (non prenotabile) */
.wpcal-slot--ro { cursor: default; }
.wpcal-slot--ro:hover { border-color: var(--wpcal-border); }
.wpcal--readonly .wpcal-summary { display: none; }

.wpcal-time-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wpcal-time {
  padding: 7px 10px; border: 1px solid var(--wpcal-border); border-radius: 6px;
  font-family: inherit; font-size: 0.85em; outline: none;
}
.wpcal-time:focus { border-color: var(--wpcal-primary); box-shadow: 0 0 0 2px rgba(0,159,227,0.15); }
.wpcal-hint { font-size: 0.65em; color: #888; }

.wpcal-units-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.wpcal-units-row button {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--wpcal-border);
  background: #fff; color: var(--wpcal-primary); font-weight: 800; cursor: pointer; font-family: inherit;
}
.wpcal-un { min-width: 16px; text-align: center; color: var(--wpcal-dark); }

.wpcal-summary {
  margin-top: 10px; background: #f8fbfb; border-radius: 8px; padding: 8px 12px;
  font-size: 0.78em; color: var(--wpcal-dark); display: none;
}
.wpcal-summary.open { display: block; }
.wpcal-summary b { color: var(--wpcal-primary); }

/* Variante compatta (pannello vendite / order-create) */
.wpcal--compact { padding: 8px; font-size: 12px; margin-top: 8px; }
.wpcal--compact .wpcal-legend { display: none; }
.wpcal--compact .wpcal-day { height: 25px; border-radius: 5px; }

@media (max-width: 480px) {
  .wpcal { padding: 8px; }
  .wpcal-slot { padding: 5px 10px; }
}
