/* ============================================================
   UTCATS — booking.css
   Floating Book Button · Modal Overlay · Booking Form
   Load on every page alongside style.css
   ============================================================ */

/* ============================================================
   FLOATING BOOK BUTTON
   ============================================================ */
.floating-book-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(255, 107, 53, 0.45);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.3s ease,
              opacity 0.3s ease,
              background 0.25s ease;

  /* Hidden by default — shown after scroll via JS */
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  pointer-events: none;
}

.floating-book-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-book-btn:hover {
  background: #e8562a;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 36px rgba(255, 107, 53, 0.55);
}

.floating-book-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Pulse animation — draws attention after 5s */
@keyframes floatPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(255,107,53,0.45); }
  50%       { box-shadow: 0 8px 28px rgba(255,107,53,0.45), 0 0 0 12px rgba(255,107,53,0.15); }
}
.floating-book-btn.pulse {
  animation: floatPulse 2s ease-in-out 3;
}

/* ============================================================
   BACKDROP
   ============================================================ */
.booking-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 10, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.booking-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   MODAL
   ============================================================ */
.booking-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -44%) scale(0.96);
  z-index: 1200;
  width: min(620px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease,
              visibility 0.35s ease,
              transform 0.4s cubic-bezier(0.34,1.56,0.64,1);

  /* Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.booking-modal::-webkit-scrollbar { width: 5px; }
.booking-modal::-webkit-scrollbar-track { background: transparent; }
.booking-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.booking-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Close button */
.booking-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--off-white);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  z-index: 2;
}
.booking-modal-close:hover {
  background: #fee;
  color: #c0392b;
  transform: rotate(90deg);
}

/* Modal header */
.booking-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--border);
}

.booking-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--green-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(46,125,50,0.3);
}

.booking-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--dark);
  margin-bottom: 4px;
  line-height: 1.2;
}

.booking-modal-header p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ============================================================
   BOOKING FORM
   ============================================================ */
.booking-form {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.booking-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.booking-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.booking-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.booking-field label span {
  color: var(--orange);
  margin-left: 2px;
}

/* Inputs, selects, textarea */
.booking-field input,
.booking-field select,
.booking-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--off-white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  appearance: none;
  -webkit-appearance: none;
}

.booking-field input::placeholder,
.booking-field textarea::placeholder {
  color: #aab0bc;
}

.booking-field input:focus,
.booking-field select:focus,
.booking-field textarea:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

/* Invalid state */
.booking-field input.invalid,
.booking-field select.invalid,
.booking-field textarea.invalid {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,0.1);
}

/* Inline field error */
.bk-field-error {
  font-size: 0.75rem;
  color: #e53935;
  font-weight: 500;
  min-height: 16px;
  display: block;
}

/* Select wrapper — custom chevron */
.booking-field .bk-select-wrap {
  position: relative;
}
.booking-field .bk-select-wrap select {
  padding-right: 36px;
  cursor: pointer;
}
.booking-field .bk-select-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-light);
  pointer-events: none;
}

/* Textarea */
.booking-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* Date input */
.booking-field input[type="date"] {
  cursor: pointer;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.booking-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--green);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 15px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  box-shadow: 0 6px 20px rgba(46,125,50,0.3);
}

.booking-submit:hover:not(:disabled) {
  background: var(--green-mid);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(46,125,50,0.4);
}

.booking-submit:active:not(:disabled) {
  transform: translateY(0);
}

.booking-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

/* Spinner */
.ct-spinner {
  animation: ctSpin 0.8s linear infinite;
}
.ct-spinner.hidden,
.hidden {
  display: none;
}

@keyframes ctSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   FEEDBACK TOAST (inside modal)
   ============================================================ */
.booking-feedback {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
}

.booking-feedback.success {
  display: flex;
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.booking-feedback.error {
  display: flex;
  background: #ffebee;
  color: #b71c1c;
  border: 1px solid #ef9a9a;
}

.booking-feedback svg {
  flex-shrink: 0;
}


/* ============================================================
   SEARCHABLE SERVICE SELECT
   ============================================================ */
.bk-search-select { position: relative; }

.bk-service-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--off-white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 36px 11px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.bk-service-input::placeholder { color: #aab0bc; }
.bk-service-input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}
.bk-service-input.invalid {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,0.1);
}

.bk-ss-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-light);
  transition: transform 0.2s ease;
}
.bk-search-select.open .bk-ss-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.bk-ss-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 9999;
  max-height: 210px;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.bk-ss-list::-webkit-scrollbar { width: 4px; }
.bk-ss-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.bk-search-select.open .bk-ss-list { display: block; }

.bk-ss-list li {
  list-style: none;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}
.bk-ss-list li:hover,
.bk-ss-list li.highlighted { background: var(--off-white); color: var(--green); }
.bk-ss-list li.selected { background: #e8f5e9; color: var(--green); font-weight: 600; }
.bk-ss-list li.no-results { color: var(--text-light); font-style: italic; cursor: default; }
.bk-ss-list li.no-results:hover { background: transparent; color: var(--text-light); }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .floating-book-btn {
    bottom: 20px;
    right: 16px;
    padding: 12px 18px;
    font-size: 0.82rem;
  }

  .booking-modal {
    width: 96vw;
    border-radius: 20px;
    max-height: 92vh;
  }

  .booking-modal-header {
    padding: 24px 20px 18px;
    gap: 12px;
  }

  .booking-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .booking-modal-header h3 {
    font-size: 1.15rem;
  }

  .booking-form {
    padding: 20px 20px 24px;
    gap: 14px;
  }

  .booking-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* On very small screens, hide the text label in floating button */
  @media (max-width: 380px) {
    .floating-book-btn span {
      display: none;
    }
    .floating-book-btn {
      width: 52px;
      height: 52px;
      padding: 0;
      justify-content: center;
      border-radius: 50%;
    }
  }
}