/**
 * CJ Funtime Rental — Booking Widget Styles
 * Turo/Airbnb-inspired booking form
 */

.bw-container {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 24px;
  position: sticky;
  top: 100px;
  max-width: 400px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}

/* Header with live pricing */
.bw-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Up-front ID requirement disclosure */
.bw-id-note {
  display: block;
  margin: -8px 0 20px;
  padding: 10px 12px;
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.25);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffb700;
  line-height: 1.4;
}

.bw-price-display {
  font-family: var(--heading, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.3px;
}

/* Promo price. A visitor arriving from a discount email needs to see the
   discount, not just a number they cannot check. Old price struck through,
   new price emphasised, and the code named so it is obvious WHY it changed. */
.bw-price-was {
  text-decoration: line-through;
  opacity: 0.55;
  font-weight: 500;
  margin-right: 8px;
}
.bw-price-now { color: #FF6B00; }
.bw-price-note {
  display: block;
  margin-top: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #1a7f4b;
}

/* Section spacing */
.bw-section {
  margin-bottom: 20px;
}

.bw-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  letter-spacing: 0;
}

/* Date inputs */
.bw-date-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #222;
  transition: all 0.2s;
  cursor: pointer;
}

.bw-date-input:hover {
  border-color: #bbb;
}

.bw-date-input:focus {
  outline: none;
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
}

.bw-hint {
  font-size: 12px;
  color: #717171;
  margin-top: 6px;
}

/* Duration type buttons */
.bw-duration-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bw-duration-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bw-duration-btn:hover {
  background: #f7f7f7;
  border-color: #bbb;
}

.bw-duration-btn.selected {
  background: #222;
  border-color: #222;
}

.bw-duration-btn.selected .bw-btn-label,
.bw-duration-btn.selected .bw-btn-sub {
  color: #fff;
}

.bw-btn-label {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  letter-spacing: 0;
}

.bw-btn-sub {
  font-size: 12px;
  color: #717171;
  letter-spacing: 0;
}

/* Input fields */
.bw-input {
  width: 100%;
  padding: 12px 14px;
  background: #242424;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.bw-input:focus {
  outline: none;
  border-color: var(--orange, #ff4d00);
}

.bw-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Date input styling */
.bw-input[type="date"],
.bw-input[type="time"] {
  color-scheme: dark;
}

/* Row layout */
.bw-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.bw-field {
  display: flex;
  flex-direction: column;
}

/* Delivery options */
.bw-delivery-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bw-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 10px;
  background: #242424;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.bw-checkbox:hover {
  background: #2a2a2a;
}

.bw-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--orange, #ff4d00);
}

.bw-checkbox strong {
  color: var(--amber, #ffb700);
  margin-left: auto;
}

/* Error message */
.bw-error {
  background: rgba(255, 77, 0, 0.1);
  border: 1px solid rgba(255, 77, 0, 0.3);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #ff6b4d;
  font-size: 13px;
  line-height: 1.5;
}

/* CTA button */
.bw-cta {
  width: 100%;
  padding: 16px 24px;
  background: var(--orange, #ff4d00);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
}

.bw-cta:hover:not(:disabled) {
  background: #ff6200;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 77, 0, 0.3);
}

.bw-cta:disabled {
  background: #333;
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .bw-container {
    position: relative;
    top: 0;
    max-width: 100%;
    margin-bottom: 32px;
  }

  .bw-duration-btns {
    grid-template-columns: 1fr;
  }

  .bw-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .bw-container {
    padding: 20px;
  }

  .bw-price-display {
    font-size: 1.75rem;
  }

  .bw-cta {
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* ── Date picker (flatpickr) ────────────────────────────────────────────────
   Unavailable days are greyed out IN the calendar, so a customer never picks a
   date and then finds out at the bottom of the form that the vehicle is taken.

   flatpickr's default disabled colour is 10% opacity, which reads as "blank"
   rather than "unavailable". These days need to look deliberately closed. */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: #b6b6b6;
  background: repeating-linear-gradient(
    -45deg, rgba(0,0,0,0.045) 0 4px, transparent 4px 8px);
  text-decoration: line-through;
  cursor: not-allowed;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #FF6B00;
  border-color: #FF6B00;
  color: #fff;
}
.flatpickr-day:hover:not(.flatpickr-disabled) { background: #ffe8d6; border-color: #ffe8d6; }
.flatpickr-calendar { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
/* Wider tap targets on a phone. */
@media (max-width: 768px) {
  .flatpickr-calendar { width: auto; max-width: 100%; }
  .flatpickr-day { height: 42px; line-height: 42px; }
}
