/* =============================================
   CALENDAR / BOOKING MODULE
   ============================================= */

.booking {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* --- Calendar --- */
.calendar {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}

.calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.calendar__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--green-dark);
}

.calendar__nav {
  display: flex;
  gap: 0.5rem;
}

.calendar__nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.calendar__nav-btn:hover {
  background: var(--green-pale);
  border-color: var(--green-mid);
}

.calendar__nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--green-dark);
  fill: none;
  stroke-width: 2;
}

.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.5rem;
}

.calendar__weekday {
  text-align: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-light);
  padding: 0.5rem 0;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  cursor: default;
  position: relative;
  border: none;
  background: none;
  color: var(--text-primary);
}

.calendar__day--empty {
  visibility: hidden;
}

.calendar__day--past,
.calendar__day--unavailable {
  color: var(--text-light);
  opacity: 0.4;
}

.calendar__day--available {
  cursor: pointer;
  font-weight: 600;
}

.calendar__day--available:hover {
  background: var(--green-pale);
  color: var(--green-dark);
}

.calendar__day--available::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-light);
}

.calendar__day--selected {
  background: var(--green-dark) !important;
  color: #fff !important;
}

.calendar__day--selected::after {
  background: var(--copper) !important;
}

.calendar__day--today {
  border: 2px solid var(--copper);
}

/* --- Time Slots --- */
.slots {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}

.slots__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

.slots__date {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.slots__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.slots__empty svg {
  width: 48px;
  height: 48px;
  stroke: var(--border-color);
  margin-bottom: 1rem;
}

.slots__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.slots__btn {
  padding: 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.slots__btn:hover {
  border-color: var(--green-mid);
  background: var(--green-pale);
  color: var(--green-dark);
}

.slots__btn--selected {
  background: var(--green-dark);
  color: #fff;
  border-color: var(--green-dark);
}

/* --- Booking Form --- */
.booking-form {
  grid-column: 1 / -1;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  display: none;
}

.booking-form--visible {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.booking-form__title {
  font-size: var(--font-size-xl);
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

.booking-form__subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.booking-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.booking-form__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.booking-form__group--full {
  grid-column: 1 / -1;
}

.booking-form__label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.booking-form__label .required {
  color: #dc3545;
}

.booking-form__input,
.booking-form__select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.booking-form__input:focus,
.booking-form__select:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(36, 94, 72, 0.1);
  outline: none;
}

.booking-form__input--error {
  border-color: #dc3545;
}

.booking-form__error {
  font-size: var(--font-size-xs);
  color: #dc3545;
  display: none;
}

.booking-form__error--visible {
  display: block;
}

.booking-form__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.booking-form__submit {
  background: var(--copper);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: var(--font-size-base);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.booking-form__submit:hover {
  background: var(--copper-dark);
}

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

.booking-form__cancel {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.85rem 1.5rem;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.booking-form__cancel:hover {
  border-color: var(--text-secondary);
}

/* --- Success/Error Messages --- */
.booking-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  display: none;
}

.booking-message--visible {
  display: block;
}

.booking-message__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.booking-message__icon--success {
  background: var(--green-pale);
}

.booking-message__icon--error {
  background: #fde8e8;
}

.booking-message__icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.booking-message h3 {
  margin-bottom: 0.5rem;
}

.booking-message p {
  font-size: var(--font-size-base);
}

/* Loading spinner */
.booking-form__spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.booking-form__submit--loading .booking-form__spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === MOBILE === */
@media (max-width: 767px) {
  .booking {
    grid-template-columns: 1fr;
  }

  .slots__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .booking-form__fields {
    grid-template-columns: 1fr;
  }

  .booking-form__group--full {
    grid-column: 1;
  }

  .booking-form__actions {
    grid-column: 1;
    flex-direction: column;
  }
}

/* === TABLET === */
@media (min-width: 768px) and (max-width: 1199px) {
  .slots__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
