/* ======================================================
   quick-booking.css — Упрощенная форма бронирования места
   Site: tttdnr.ru/zabronirovat-mesto/
   Design: Черный фон, белые поля, красная кнопка (как в архиве)
   ====================================================== */

/* ───────── Reset & Base ───────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #1a1a1a;
  color: #fff;
  overflow-y: auto;
}

/* ───────── Success Screen ───────── */

.success-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: #1a1a1a;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.success-screen[style*="display: flex"] {
  display: flex !important;
}

.success-icon {
  font-size: 80px;
  margin-bottom: 24px;
  animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.success-text {
  font-size: 16px;
  line-height: 1.6;
  color: #bbb;
  max-width: 400px;
  margin-bottom: 24px;
}

.success-order-id {
  font-size: 14px;
  color: #888;
  margin-bottom: 32px;
}

.btn-home {
  display: inline-block;
  background: #e53e3e;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-home:hover {
  background: #c53030;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ───────── Booking Container ───────── */

.booking-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.booking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-top: 8px;
}

.back-btn,
.close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
  transition: background 0.2s;
}

.back-btn:hover,
.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.form-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  flex: 1;
}

/* ───────── Form ───────── */

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
}

.required {
  color: #e53e3e;
}

.form-field input[type="text"],
.form-field input[type="tel"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: all 0.2s;
}

.form-field input[type="text"]::placeholder,
.form-field input[type="tel"]::placeholder,
.form-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #e53e3e;
}

.form-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-field select option {
  background: #1a1a1a;
  color: #fff;
}

.form-field textarea {
  resize: none;
  min-height: 44px;
  line-height: 1.5;
  overflow-y: hidden;
}

/* ───────── Button Groups (Direction, Seats, Time) ───────── */

.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-option {
  flex: 1;
  min-width: calc(50% - 4px);
  padding: 12px 16px;
  font-size: 22px;
  font-family: inherit;
  font-weight: 500;
  background: transparent;
  border: 2px solid #e53e3e;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  line-height: 1.4;
  filter: grayscale(100%);
}

.btn-option:hover {
  border-color: #c53030;
  background: rgba(229, 62, 62, 0.1);
}

.btn-option.active {
  background: #e53e3e;
  border-color: #e53e3e;
  color: #fff;
  filter: grayscale(0%);
}

/* Direction: 2 buttons */
.direction-group .btn-option {
  font-size: 14px;
  line-height: 1.3;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Seats: 4 buttons in a row */
.seats-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.seats-group .btn-option {
  min-width: unset;
  padding: 10px 8px;
  font-size: 22px;
}

.seats-group .btn-option .icon {
  display: inline-block;
  filter: brightness(0) invert(1);
}

.seats-group .btn-option.active {
}

.seats-group .btn-option.active .icon {
  filter: brightness(0) invert(1);
}

/* Time: 4 buttons in a row */
.time-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.time-group .btn-option {
  min-width: unset;
  padding: 12px 8px;
  font-size: 16px;
  font-weight: 600;
}

/* ───────── Date Input (Custom Calendar Trigger) ───────── */

.date-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.date-input:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.date-input:focus {
  outline: 2px solid #e53e3e;
  outline-offset: 2px;
}

.date-placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
}

.date-input.selected .date-placeholder {
  color: #fff;
}

.date-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.field-error {
  font-size: 13px;
  color: #fc8181;
  display: none;
}

.field-error.show {
  display: block;
}

.field-hint {
  font-size: 13px;
  color: #888;
  margin-top: -4px;
}

/* ───────── Checkbox ───────── */

.form-checkbox {
  margin-top: 8px;
}

.checkbox-label {
  display: flex;
  gap: 12px;
  cursor: pointer;
  align-items: flex-start;
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
  background: #e53e3e;
  border-color: #e53e3e;
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.checkbox-text {
  font-size: 13px;
  line-height: 1.5;
  color: #bbb;
}

.checkbox-text a {
  color: #e53e3e;
  text-decoration: underline;
}

/* ───────── Submit Button ───────── */

.btn-submit {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  background: #e53e3e;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover {
  background: #c53030;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

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

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-submit.loading .btn-text {
  display: none;
}

.btn-submit.loading .btn-loader {
  display: flex !important;
}

.btn-loader {
  display: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ───────── Form Hint ───────── */

.form-hint {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-top: 8px;
}

/* ───────── Responsive ───────── */

@media (max-width: 600px) {
  .booking-container {
    padding: 12px;
  }

  .form-title {
    font-size: 20px;
  }

  .success-title {
    font-size: 24px;
  }

  .btn-submit {
    font-size: 16px;
    padding: 14px;
  }

  /* Уменьшение шрифта количества мест для мобильных */
  .seats-group .btn-option {
    font-size: 18px;
    padding: 8px 6px;
  }

  /* Уменьшение шрифта времени для мобильных */
  .button-group .btn-option {
    font-size: 18px;
    padding: 10px 12px;
  }
}

/* ───────── Dark mode inputs (iOS/Safari) ───────── */

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

/* ───────── Honeypot hidden field ───────── */

input[name="website"] {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

/* ───────── Modal Sheet (Calendar) ───────── */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px 22px 0 0;
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.sheet.open {
  transform: translateY(0);
}

.sheet__handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.date-picker-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-picker-hdr__title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.date-picker-hdr__confirm {
  background: none;
  border: none;
  font-size: 17px;
  font-weight: 700;
  color: #e53e3e;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  padding: 0;
}

.wheel-wrap {
  position: relative;
  display: flex;
  height: 220px;
  overflow: hidden;
  padding: 0 12px;
}

.wheel-wrap::before,
.wheel-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 88px;
  z-index: 2;
  pointer-events: none;
}

.wheel-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, #1a1a1a 20%, transparent);
}

.wheel-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, #1a1a1a 20%, transparent);
}

.wheel-wrap__highlight {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  pointer-events: none;
  z-index: 0;
}

.wheel-col {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  padding-top: 88px;
  padding-bottom: 88px;
  scrollbar-width: none;
  flex: 2;
  position: relative;
  z-index: 1;
  cursor: grab;
}

.wheel-col.dragging {
  cursor: grabbing;
}

.wheel-col::-webkit-scrollbar {
  display: none;
}

.wheel-col.wheel-col--sm {
  flex: 1;
}

.wheel-col.wheel-col--md {
  flex: 1.2;
}

.wheel-item {
  scroll-snap-align: center;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  user-select: none;
}
