@import 'shared.css';

.booking-create {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.booking-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
}

.booking-date-toggle {
  display: none;
}

.booking-block--date .booking-month {
  margin-bottom: auto;
}

.booking-block--date .booking-month__days {
  row-gap: 16px;
}

.booking-block--date .booking-month__weekdays {
  margin-bottom: 14px;
}

.booking-details {
  gap: 16px;
}

.booking-form > *,
.booking-form .form__field {
  min-width: 0;
}

.booking-details .booking-step {
  margin-bottom: 0;
}

.booking-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(23, 184, 179, 0.32);
  background: linear-gradient(135deg, rgba(23, 184, 179, 0.1), rgba(15, 142, 137, 0.04));
  transition: background-color 160ms ease, border-color 160ms ease;
}

.booking-summary--empty {
  border-style: dashed;
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.booking-summary__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: 0 2px 6px rgba(16, 38, 58, 0.06);
}

.booking-summary--empty .booking-summary__icon {
  color: var(--text-muted);
}

.booking-summary__body {
  display: grid;
  flex: 1;
  min-width: 0;
}

.booking-summary__date {
  display: block;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.booking-summary__date::first-letter {
  text-transform: uppercase;
}

.booking-summary__time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 1.12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.booking-summary--empty .booking-summary__time {
  color: var(--text-muted);
  font-size: 0.98rem;
  font-weight: 600;
}

.booking-summary__duration {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.booking-summary__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.booking-summary__clear:hover {
  background: var(--surface);
  color: var(--booking-busy-ink);
}

.booking-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
}

.booking-details__save {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

@media (max-width: 1100px) {
  .booking-create {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "date details"
      "time details";
    grid-auto-rows: auto;
  }

  .booking-block--date { grid-area: date; }
  .booking-block--time { grid-area: time; }
  .booking-block--details { grid-area: details; }

}

@media (max-width: 760px) {
  .booking-create {
    grid-template-columns: 1fr;
    grid-template-areas:
      "date"
      "time"
      "details";
    gap: 14px;
  }

  .booking-block {
    padding: 16px;
  }

  .booking-date-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 14px 0 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease;
  }

  .booking-date-toggle[aria-expanded="true"] {
    border-color: var(--accent);
    box-shadow: var(--booking-ring);
  }

  .booking-date-toggle[aria-expanded="true"] .booking-date-toggle__chevron {
    transform: rotate(180deg);
  }

  .booking-date-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--booking-accent-soft);
    color: var(--accent-deep);
  }

  .booking-date-toggle__text {
    flex: 1;
    min-width: 0;
  }

  .booking-date-toggle__text::first-letter {
    text-transform: uppercase;
  }

  .booking-date-toggle__chevron {
    color: var(--text-muted);
    transition: transform 160ms ease;
  }

  .booking-month {
    display: none;
    max-width: none;
  }

  .booking-month.is-open-mobile {
    display: block;
    margin-top: 8px;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    animation: rise-in 140ms ease;
  }

  .booking-month .booking-day {
    max-width: 44px;
  }

}
