/* ---- Overlay & shell ---- */

.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.booking-modal[hidden] {
  display: none !important;
}

body.booking-modal-open {
  overflow: hidden;
}

.booking-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(35, 35, 38, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.booking-modal.is-open .booking-modal__overlay {
  opacity: 1;
}

.booking-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  transform: scale(0.94) translateY(16px);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.28s ease;
}

.booking-modal.is-open .booking-modal__dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ---- Header ---- */

.booking-modal__header {
  position: relative;
  flex-shrink: 0;
  padding: 28px 24px 22px;
  background: linear-gradient(135deg, #e6f4fe 0%, #d6eefd 55%, #cce8fc 100%);
  overflow: hidden;
}

.booking-modal__header::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(191, 95, 73, 0.08);
  pointer-events: none;
}

.booking-modal__header::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(90, 151, 193, 0.12);
  pointer-events: none;
}

.booking-modal__header-inner {
  position: relative;
  z-index: 1;
  padding-right: 36px;
}

.booking-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: #232326;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.booking-modal__close:hover {
  background: #fff;
  transform: scale(1.05);
}

.booking-modal__title {
  margin: 0 0 8px;
  font-size: 26px;
  font-family: var(--font-brand, sans-serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-black, #232326);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.booking-modal__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #5a6b75;
}

/* ---- Body ---- */

.booking-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 24px;
}

/* ---- Form ---- */

.booking-form .form-item {
  margin-bottom: 14px;
}

.booking-form label,
.booking-form h4.label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #7a9bb5;
}

.booking-form input[type="text"],
.booking-form input[type="tel"],
.booking-form input[type="number"],
.booking-form input[type="date"],
.booking-form input[type="time"],
.booking-form textarea,
.booking-form select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e0eef7;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-black, #232326);
  background: #f8fcff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.booking-form input:hover,
.booking-form textarea:hover {
  border-color: #c5dff0;
  background: #fff;
}

.booking-form input:focus,
.booking-form textarea:focus,
.booking-form select:focus {
  outline: none;
  border-color: var(--color-accent, #bf5f49);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(191, 95, 73, 0.1);
}

.booking-form .form-datetime-wrapper,
.booking-form #edit-datetime.container-inline {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
}

.booking-form .form-datetime-wrapper .form-item,
.booking-form #edit-datetime.container-inline .form-item {
  margin-bottom: 0;
}

/* Hide raw number input when stepper is active */
.booking-form__item--guests input.booking-form__guests-input[type="hidden"] {
  display: none;
}

/* ---- Guest stepper ---- */

.booking-guests-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid #e0eef7;
  border-radius: 12px;
  background: #f8fcff;
  overflow: hidden;
}

.booking-guests-stepper__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--color-accent, #bf5f49);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.booking-guests-stepper__btn:hover {
  background: rgba(191, 95, 73, 0.08);
}

.booking-guests-stepper__value {
  min-width: 36px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: var(--color-black, #232326);
}

.booking-guests-stepper__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.booking-guests-stepper__chip {
  padding: 6px 14px;
  border: 1.5px solid #e0eef7;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #5a6b75;
  cursor: pointer;
  transition: all 0.2s ease;
}

.booking-guests-stepper__chip:hover {
  border-color: var(--color-accent, #bf5f49);
  color: var(--color-accent, #bf5f49);
}

.booking-guests-stepper__chip.is-active {
  border-color: var(--color-accent, #bf5f49);
  background: var(--color-accent, #bf5f49);
  color: #fff;
}

/* ---- Submit ---- */

.booking-form .form-actions {
  margin-top: 6px;
  margin-bottom: 0;
}

.booking-form .form-submit,
.booking-modal__success-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 13px 20px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--color-accent, #bf5f49);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(191, 95, 73, 0.35);
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.booking-form .form-submit:hover,
.booking-modal__success-btn:hover {
  background: var(--color-accent-hover, #a84f3c);
  box-shadow: 0 6px 20px rgba(191, 95, 73, 0.4);
  transform: translateY(-1px);
}

.booking-form .form-submit:active {
  transform: translateY(0);
}

.booking-form .form-item--error-message {
  margin-top: 5px;
  font-size: 12px;
  color: #c0392b;
}

.booking-modal.is-success .booking-modal__header {
  display: none;
}

.booking-modal.is-success .booking-modal__body {
  padding-top: 36px;
}

/* ---- Success screen ---- */

.booking-modal__success-screen {
  position: relative;
  padding: 12px 8px 16px;
  text-align: center;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Pulsing rings behind icon */
.booking-modal__success-burst {
  position: absolute;
  top: 28px;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translateX(-50%);
  pointer-events: none;
}

.booking-modal__success-burst-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(191, 95, 73, 0.35);
  opacity: 0;
  animation: booking-burst-ring 1.8s ease-out infinite;
}

.booking-modal__success-burst-ring--2 {
  animation-delay: 0.4s;
}

.booking-modal__success-burst-ring--3 {
  animation-delay: 0.8s;
}

@keyframes booking-burst-ring {
  0% {
    opacity: 0.7;
    transform: scale(0.6);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

/* Confetti particles */
.booking-modal__success-confetti span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  animation: booking-confetti-fly 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.booking-modal__success-confetti span:nth-child(1) { top: 35%; left: 8%;  background: #bf5f49; animation-delay: 0.2s; }
.booking-modal__success-confetti span:nth-child(2) { top: 20%; left: 22%; background: #5a97c1; animation-delay: 0.35s; width: 7px; height: 7px; }
.booking-modal__success-confetti span:nth-child(3) { top: 15%; right: 20%; background: #d4785f; animation-delay: 0.25s; }
.booking-modal__success-confetti span:nth-child(4) { top: 30%; right: 8%;  background: #cce8fc; border: 1px solid #5a97c1; animation-delay: 0.4s; width: 8px; height: 8px; }
.booking-modal__success-confetti span:nth-child(5) { bottom: 35%; left: 12%; background: #5a97c1; animation-delay: 0.3s; width: 6px; height: 6px; }
.booking-modal__success-confetti span:nth-child(6) { bottom: 25%; right: 15%; background: #bf5f49; animation-delay: 0.45s; }
.booking-modal__success-confetti span:nth-child(7) { top: 50%; left: 5%;  background: #e6f4fe; border: 1px solid #5a97c1; animation-delay: 0.5s; width: 7px; height: 7px; }
.booking-modal__success-confetti span:nth-child(8) { top: 45%; right: 6%; background: #d4785f; animation-delay: 0.55s; width: 6px; height: 6px; }

@keyframes booking-confetti-fly {
  0%   { opacity: 0; transform: translateY(20px) scale(0.3) rotate(0deg); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50px) scale(1) rotate(180deg); }
}

/* SVG checkmark icon */
.booking-modal__success-icon {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  margin-bottom: 24px;
  animation: booking-icon-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}

@keyframes booking-icon-pop {
  from { opacity: 0; transform: scale(0.3); }
  to   { opacity: 1; transform: scale(1); }
}

.booking-modal__success-svg {
  width: 88px;
  height: 88px;
  display: block;
}

.booking-modal__success-svg-circle {
  stroke: var(--color-accent, #bf5f49);
  stroke-width: 2.5;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: booking-circle-draw 0.6s ease 0.1s both;
}

.booking-modal__success-svg-check {
  stroke: var(--color-accent, #bf5f49);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: booking-check-draw 0.4s ease 0.55s both;
}

@keyframes booking-circle-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes booking-check-draw {
  to { stroke-dashoffset: 0; }
}

.booking-modal__success-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-family: var(--font-brand, sans-serif);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-black, #232326);
  animation: booking-slide-up 0.5s ease 0.5s both;
}

.booking-modal__success-text {
  margin: 0 0 8px;
  max-width: 340px;
  font-size: 16px;
  line-height: 1.65;
  color: #444;
  animation: booking-slide-up 0.5s ease 0.65s both;
}

.booking-modal__success-note {
  margin: 0 0 28px;
  font-size: 13px;
  color: #7a9bb5;
  animation: booking-slide-up 0.5s ease 0.75s both;
}

.booking-modal__success-btn {
  animation: booking-slide-up 0.5s ease 0.85s both;
}

@keyframes booking-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Mobile ---- */

@media (max-width: 439px) {
  .booking-modal__header {
    padding: 24px 20px 18px;
  }

  .booking-modal__body {
    padding: 18px 20px 20px;
  }

  .booking-modal__title {
    font-size: 22px;
  }

  .booking-form .form-datetime-wrapper,
  .booking-form #edit-datetime.container-inline {
    grid-template-columns: 1fr;
  }
}
