/* Studio Delta - widget di prenotazione incorporato (campo data/ora -> popup, form) */

.booking-widget{
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- campo "seleziona data e ora" ---------- */
.booking-datefield{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  padding: 0.85em 1em;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.booking-datefield:hover{ border-color: var(--rust); }
.booking-datefield.has-value{ color: var(--ink); font-weight: 500; background: var(--card); }
.booking-datefield .icon{
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--rust-deep);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.booking-datefield span{ flex: 1; text-transform: capitalize; }
.booking-datefield .chevron{
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- popup data/ora ---------- */
.booking-date-dialog{
  border: 1px solid var(--line);
  padding: 0;
  width: min(360px, 92vw);
  background: var(--card);
  box-shadow: 6px 6px 0 var(--rust);
}
.booking-date-dialog::backdrop{ background: rgba(33, 28, 23, 0.65); }
.booking-date-dialog-inner{
  padding: 1.2rem;
  max-height: 80vh;
  overflow-y: auto;
}
.booking-date-dialog-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.booking-dialog-back{
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.booking-dialog-back[hidden]{ display: none; }
#dialog-title{
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 560;
  text-transform: capitalize;
}
.booking-dialog-close{
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.booking-dialog-close:hover{ border-color: var(--rust); color: var(--rust-deep); }

/* ---------- calendario ---------- */
.booking-calendar{ min-width: 0; }

.booking-month-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.booking-month-label{
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 560;
  text-transform: capitalize;
}

.booking-month-nav{
  display: flex;
  gap: 0.35rem;
}

.booking-month-nav button{
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.booking-month-nav button:hover{
  border-color: var(--rust);
  color: var(--rust-deep);
}

.booking-month-nav button:disabled{
  opacity: 0.35;
  cursor: not-allowed;
}

.booking-weekdays,
.booking-grid{
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.booking-weekdays{
  margin-bottom: 0.35rem;
}

.booking-weekdays span{
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.booking-grid{
  gap: 3px;
}

.booking-day{
  position: relative;
  aspect-ratio: 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.booking-day:hover:not(:disabled){
  border-color: var(--rust);
  background: var(--paper);
  transform: translateY(-1px);
}

.booking-day.is-today:not(.is-selected)::after{
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rust);
  transform: translateX(-50%);
}

.booking-day.is-selected{
  background: var(--rust);
  border-color: var(--rust);
  color: var(--paper);
}

.booking-day:disabled{
  color: var(--ink-soft);
  opacity: 0.3;
  cursor: not-allowed;
}

.booking-day.is-empty{
  visibility: hidden;
}

/* ---------- orari ---------- */
.booking-selected-day{
  margin: 0 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-transform: capitalize;
}

.booking-slot-list{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
}

.booking-slot{
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.booking-slot:hover{
  border-color: var(--rust);
  background: var(--card);
  color: var(--rust-deep);
}

.booking-loading,
.booking-hint{
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------- form dati ---------- */
.booking-details-form{
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: rgba(251, 248, 241, 0.72);
  border: 1px solid var(--line);
  padding: 1rem;
}

.booking-details-form[hidden],
.booking-widget[hidden],
.booking-success[hidden]{
  display: none;
}

.booking-confirm-summary{
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-transform: capitalize;
}

.booking-details-form label{
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rust-deep);
}

.booking-details-form input,
.booking-details-form textarea{
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  padding: 0.7em 0.8em;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  letter-spacing: 0;
  text-transform: none;
}

.booking-details-form input:focus,
.booking-details-form textarea:focus{
  outline: 2px solid var(--rust);
  outline-offset: 1px;
}

.booking-details-form textarea{
  resize: vertical;
  min-height: 80px;
}

.booking-consent{
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.55rem !important;
  font-family: var(--font-sans) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--ink-soft) !important;
  line-height: 1.45;
}

.booking-consent input[type="checkbox"]{
  width: 15px;
  height: 15px;
  margin-top: 0.2em;
  flex-shrink: 0;
  accent-color: var(--rust);
}

.booking-consent a{ color: var(--rust-deep); }

.booking-error{
  min-height: 1.2em;
  margin: 0;
  color: var(--rust-deep);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.booking-submit{
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 1rem;
  border: 1px solid var(--rust);
  background: var(--rust);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.booking-submit:hover:not(:disabled){ background: var(--rust-deep); border-color: var(--rust-deep); }

.booking-submit:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- conferma ---------- */
.booking-success{
  text-align: center;
  padding: 1.2rem 0.4rem 0.4rem;
}

.booking-success-mark{
  width: 44px;
  height: 44px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--rust);
  color: var(--rust);
  font-size: 1.1rem;
}

.booking-success h3{
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.booking-success p{
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.booking-success-summary{
  margin: 1.1rem 0 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
}

.booking-success-summary span{
  color: var(--ink-soft);
  font-size: 0.86rem;
}

@media (max-width: 560px){
  .booking-date-dialog{ width: 94vw; }
}
