/* Időpontfoglaló: napválasztó, foglaltsági rács, összesítő, kapcsolati és számlázási adatok. */

/* ===== Foglalás ===== */
.booking {
  display: grid;
  gap: 1.6rem;
  padding: clamp(1.2rem, 4vw, 2.2rem);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}
.step {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.step legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  font-weight: 800;
  font-size: 1.05rem;
}
.step legend small {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
}
.step__num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 0.9rem;
}

.days {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scroll-snap-type: x mandatory;
}
.day {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  padding: 0.6rem 0;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--white);
  font: 600 0.75rem var(--font);
  color: var(--muted);
  text-transform: uppercase;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}
.day strong {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
}
.day.is-active {
  border-color: var(--green);
  background: var(--green);
  color: rgba(255, 255, 255, 0.85);
}
.day.is-active strong {
  color: var(--white);
}
.day.is-promo::after {
  content: "akció";
  margin-top: 2px;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--coral);
}
.day.is-active.is-promo::after {
  color: var(--coral-light);
}
.day:focus-visible {
  outline: 3px solid var(--sky-strong);
  outline-offset: 2px;
}

.booking__bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
}
.booking__contact {
  display: grid;
  gap: 0.9rem;
}
.booking label {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.9rem;
}
.booking input[type="text"],
.booking input[type="tel"] {
  width: 100%;
  padding: 0.75em 0.9em;
  border-radius: 12px;
  border: 2px solid var(--line);
  font: 600 1rem var(--font);
  color: var(--ink);
}
.booking input:focus {
  outline: none;
  border-color: var(--green-soft);
  box-shadow: 0 0 0 4px rgba(42, 107, 87, 0.15);
}
.booking .is-invalid {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(236, 95, 110, 0.2);
}

.summary {
  padding: 1.1rem 1.3rem;
  border-radius: 14px;
  background: var(--sky);
  font-weight: 600;
}
.summary__empty {
  margin: 0;
  color: var(--muted);
}
.summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
}
.summary dt {
  color: var(--muted);
  font-weight: 600;
}
.summary dd {
  margin: 0;
  font-weight: 800;
}
.summary .total {
  font-size: 1.3rem;
  color: var(--coral-dark);
}

@media (max-width: 700px) {
  .booking__bottom {
    grid-template-columns: 1fr;
  }
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.stepper__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--white);
  font: 800 1.3rem var(--font);
  color: var(--green);
  cursor: pointer;
}
.stepper__btn:hover {
  border-color: var(--coral);
}
.stepper__btn:focus-visible {
  outline: 3px solid var(--sky-strong);
  outline-offset: 2px;
}
.stepper output {
  min-width: 1.5ch;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 900;
}
.stepper__unit {
  color: var(--muted);
  font-weight: 600;
}

.rules {
  margin-top: 1.4rem;
  padding: clamp(1.2rem, 4vw, 1.8rem);
  border-radius: var(--radius);
  background: var(--white);
  border-left: 5px solid var(--coral);
}
.rules h3 {
  margin-bottom: 0.6rem;
}
.rules ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.5rem;
  color: var(--muted);
}
.rules strong {
  color: var(--ink);
}

/* foglaltsági rács */
.avail-wrap {
  overflow-x: auto;
  margin-left: -0.3rem;
  margin-right: -0.3rem;
}
.avail {
  width: 100%;
  min-width: 300px;
  border-collapse: separate;
  border-spacing: 5px;
  table-layout: fixed;
}
.avail th,
.avail td {
  padding: 0;
}
.avail thead th {
  padding: 0.55rem 0.3rem;
  border-radius: 10px;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: box-shadow 0.2s ease;
}
.avail th.avail__corner {
  width: 3.4rem;
  background: none;
}
.avail__court--padel1 {
  background: var(--court-blue);
}
.avail__court--padel2 {
  background: var(--court-terracotta);
}
.avail__court--foci {
  background: #2f6b34;
}
.avail thead th.is-focus {
  box-shadow: 0 0 0 3px var(--coral);
}
.avail .short {
  display: none;
}
.avail tbody th {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.cell {
  width: 100%;
  padding: 0.55rem 0.2rem;
  border: 0;
  border-radius: 9px;
  font: 700 0.8rem var(--font);
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}
.cell.is-free {
  background: #e3f4e6;
  color: #2d7a3a;
}
.cell.is-free:hover {
  background: #c9ebcf;
}
.cell.is-selected {
  background: var(--coral);
  color: var(--white);
  transform: scale(1.03);
}
.cell.is-taken {
  background: #fbe1df;
  color: #b13d33;
  cursor: not-allowed;
}
.cell.is-past {
  background: #f0f3f2;
  color: #a7b2ae;
  cursor: not-allowed;
}
.cell:focus-visible {
  outline: 3px solid var(--sky-strong);
  outline-offset: 2px;
}
.avail__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.lg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lg::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.lg--free::before {
  background: #e3f4e6;
  border: 1px solid #b9e2c0;
}
.lg--sel::before {
  background: var(--coral);
}
.lg--taken::before {
  background: #fbe1df;
  border: 1px solid #f2bdb8;
}
@media (max-width: 560px) {
  .avail .long {
    display: none;
  }
  .avail .short {
    display: inline;
  }
  .avail thead th {
    font-size: 0.7rem;
    letter-spacing: 0;
    text-transform: none;
    padding: 0.5rem 0.15rem;
  }
  .avail {
    border-spacing: 4px;
  }
  .avail th.avail__corner {
    width: 2.9rem;
  }
  .cell {
    font-size: 0.74rem;
    padding: 0.5rem 0.1rem;
  }
}

.form__status {
  margin: -0.6rem 0 0;
  font-weight: 700;
  min-height: 1.4em;
  color: var(--coral-dark);
}

/* ===== Online foglalás: e-mail, számlázási cím, feltételek ===== */
.online-fields {
  display: grid;
  gap: 0.9rem;
}
.online-fields small {
  font-weight: 500;
  color: var(--muted);
}
.billing {
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}
.billing legend {
  padding: 0 0.4rem;
  font-weight: 800;
  font-size: 0.9rem;
}
.billing__row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.8rem;
}
.booking input[type="email"] {
  width: 100%;
  padding: 0.75em 0.9em;
  border-radius: 12px;
  border: 2px solid var(--line);
  font: 600 1rem var(--font);
  color: var(--ink);
}
.terms {
  display: flex !important;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 600 !important;
  line-height: 1.45;
}
.terms input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.1rem;
  accent-color: var(--green);
  flex-shrink: 0;
}
.terms a {
  color: var(--green);
}
#submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* élő frissítés: a szemünk előtt lefoglalt cella egyszer finoman felvillan (a méret nem változik) */
.cell.is-just-taken {
  animation: just-taken 1.2s ease-out;
}
@keyframes just-taken {
  0% {
    box-shadow: 0 0 0 0 rgba(236, 95, 110, 0.55);
    background: #f9c9c4;
  }
  100% {
    box-shadow: 0 0 0 8px rgba(236, 95, 110, 0);
  }
}

.billing__hint {
  margin: -0.3rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--coral-dark);
}
.billing__hint:empty {
  display: none;
}

/* helyszíni fizetés (amíg nincs online fizetés) */
.onsite-note {
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: #e8f4f1;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 600;
}
