/*
 * Cykleriet Booking – frontend booking form styles
 * Mobile-first, BEM-ish class names all prefixed .cyk-
 * Brand colour: #df6d1f (Cykleriet orange)
 */

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

.cyk-booking *,
.cyk-booking *::before,
.cyk-booking *::after {
  box-sizing: border-box;
}

.cyk-booking {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */

.cyk-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin: 24px 0 32px;
  padding: 0;
  list-style: none;
}

.cyk-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  min-width: 0;
}

/* Connector line between steps */
.cyk-progress-line {
  flex: 1;
  height: 2px;
  background: #d0d0d0;
  margin-top: 18px;
  transition: background 0.25s;
}

.cyk-progress-line.done {
  background: #df6d1f;
}

.cyk-progress-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, color 0.25s;
  flex-shrink: 0;
}

.cyk-progress-step.active .cyk-progress-num {
  background: #df6d1f;
  color: #fff;
}

.cyk-progress-step.done .cyk-progress-num {
  background: #df6d1f;
  color: #fff;
}

.cyk-progress-step.done .cyk-progress-num::after {
  content: '\2713';
}

.cyk-progress-label {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

.cyk-progress-step.active .cyk-progress-label {
  color: #df6d1f;
  font-weight: 600;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.cyk-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 24px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  overflow: hidden; /* prevent child grids from bleeding outside */
}

/* ── Error notice ─────────────────────────────────────────────────────────── */

.cyk-error {
  background: #fdecea;
  border: 1px solid #e57373;
  border-radius: 6px;
  color: #c62828;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */

.cyk-spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

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

.cyk-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #df6d1f;
  border-radius: 50%;
  animation: cyk-spin 0.8s linear infinite;
}

/* ── Step heading ─────────────────────────────────────────────────────────── */

.cyk-step-heading {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #1a1a1a;
}

/* ── Option grid (booking type / bike type) ───────────────────────────────── */

.cyk-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
  /* Prevent any child from breaking out of the card */
  max-width: 100%;
}

.cyk-option-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 480px) {
  .cyk-option-grid--3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Vertical stack layout – one option per row, icon left, text left-aligned */
.cyk-option-grid--stack {
  grid-template-columns: 1fr;
}

.cyk-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 8px;   /* reduced horizontal padding so 3-col fits */
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  background: #fafafa;
  user-select: none;
  min-width: 0;        /* allow grid items to shrink below content width */
  width: 100%;
}

/* Override layout inside the stack grid */
.cyk-option-grid--stack .cyk-option {
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  gap: 14px;
}

.cyk-option:hover {
  border-color: #f0b88a;
  background: #fef6f0;
}

.cyk-option.selected {
  border-color: #df6d1f;
  background: #fef0e6;
  box-shadow: 0 0 0 3px rgba(223, 109, 31, .15);
}

.cyk-option-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.cyk-option-grid--stack .cyk-option-icon {
  margin-bottom: 0;
  font-size: 26px;
}

.cyk-option-body {
  display: flex;
  flex-direction: column;
  align-items: center;   /* centred in column mode */
  min-width: 0;
}

.cyk-option-grid--stack .cyk-option-body {
  align-items: flex-start;
}

.cyk-option-label {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  word-break: break-word;
}

.cyk-option-desc {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  line-height: 1.35;
}

/* ── Slot grid ────────────────────────────────────────────────────────────── */

.cyk-slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

@media (min-width: 480px) {
  .cyk-slot-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cyk-slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  text-align: center;
  min-width: 0;
}

.cyk-slot-btn:hover:not(.unavailable) {
  border-color: #f0b88a;
  background: #fef6f0;
}

.cyk-slot-btn.selected {
  border-color: #df6d1f;
  background: #fef0e6;
  box-shadow: 0 0 0 3px rgba(223, 109, 31, .15);
}

.cyk-slot-btn.unavailable {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f5f5f5;
}

.cyk-slot-name {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

.cyk-slot-time {
  font-size: 12px;
  color: #555;
  margin-top: 2px;
}

.cyk-slot-avail {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.cyk-slot-btn.unavailable .cyk-slot-avail {
  color: #c62828;
}

/* ── Service checkboxes (repair step) ─────────────────────────────────────── */

.cyk-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.cyk-check-row:hover {
  border-color: #f0b88a;
  background: #fef9f5;
}

.cyk-check-row input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: #df6d1f;
  flex-shrink: 0;
  cursor: pointer;
}

.cyk-check-label {
  font-size: 14px;
  color: #222;
  cursor: pointer;
}

.cyk-check-label strong {
  display: block;
  font-weight: 600;
  margin-bottom: 1px;
}

.cyk-check-label small {
  color: #666;
}

.cyk-check-row--extra {
  margin-top: 16px;
  border-style: dashed;
}

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

.cyk-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) {
  .cyk-form-grid {
    grid-template-columns: 1fr;
  }
}

.cyk-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cyk-form-group--full {
  grid-column: 1 / -1;
}

.cyk-label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.cyk-input,
.cyk-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.cyk-input:focus,
.cyk-textarea:focus {
  outline: none;
  border-color: #df6d1f;
  box-shadow: 0 0 0 3px rgba(223, 109, 31, .15);
}

.cyk-textarea {
  min-height: 100px;
  resize: vertical;
}

.cyk-input-file {
  font-size: 14px;
  color: #555;
}

/* Date input – entire field should be clickable */
input[type="date"].cyk-input {
  cursor: pointer;
}

/* Radio row (customer home / other location) */
.cyk-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.cyk-radio-row input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #df6d1f;
  cursor: pointer;
}

.cyk-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: #222;
  cursor: pointer;
}

/* ── Navigation buttons ───────────────────────────────────────────────────── */

.cyk-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.cyk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.18s, border-color 0.18s, opacity 0.18s;
  text-decoration: none;
  white-space: nowrap;
}

.cyk-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cyk-btn--primary {
  background: #df6d1f;
  color: #fff;
  border-color: #df6d1f;
}

.cyk-btn--primary:hover:not(:disabled) {
  background: #b85a18;
  border-color: #b85a18;
}

.cyk-btn--secondary {
  background: #fff;
  color: #333;
  border-color: #ccc;
}

.cyk-btn--secondary:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #aaa;
}

/* ── Info / hint / description text ──────────────────────────────────────── */

.cyk-info {
  font-size: 13px;
  color: #555;
  background: #f5f5f5;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

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

.cyk-desc {
  font-size: 14px;
  color: #555;
  margin-bottom: 16px;
}

/* ── Summary (step 6) ─────────────────────────────────────────────────────── */

.cyk-summary {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.cyk-summary-row {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.cyk-summary-row:last-child {
  border-bottom: none;
}

.cyk-summary-label {
  font-weight: 600;
  color: #555;
  flex-shrink: 0;
  min-width: 110px;
}

.cyk-summary-value {
  color: #1a1a1a;
  word-break: break-word;
}

/* ── Price box ────────────────────────────────────────────────────────────── */

.cyk-price-box {
  background: #fef6f0;
  border: 1px solid #f0b88a;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.cyk-price-heading {
  font-size: 13px;
  font-weight: 700;
  color: #df6d1f;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.cyk-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;  /* prevent columns from expanding beyond box width */
}

.cyk-price-table td,
.cyk-price-table th {
  padding: 5px 0;
  vertical-align: middle;
}

/* Right-hand amount column */
.cyk-price-table td:last-child,
.cyk-price-table th:last-child {
  text-align: right;
  white-space: nowrap;
  padding-left: 12px;
  width: 30%;
}

/* Left-hand description column */
.cyk-price-table td:first-child,
.cyk-price-table th:first-child {
  width: 70%;
}

/* Amount cells – no display:block, just bold & brand colour */
.cyk-price-amount {
  font-weight: 700;
  color: #df6d1f;
}

/* Total row */
.cyk-price-total-row td,
.cyk-price-total-row th {
  border-top: 1px solid #f0b88a;
  padding-top: 10px;
  font-size: 16px;
}

.cyk-price-total-row .cyk-price-amount {
  font-size: 18px;
}

.cyk-price-disclaimer {
  font-size: 12px;
  color: #888;
  margin-top: 10px;
  font-style: italic;
}

/* ── Terms note ───────────────────────────────────────────────────────────── */

.cyk-terms {
  font-size: 13px;
  color: #555;
  margin-bottom: 20px;
}

.cyk-terms a {
  color: #df6d1f;
  text-decoration: underline;
}

/* ── Success screen ───────────────────────────────────────────────────────── */

.cyk-success-card {
  text-align: center;
  padding: 40px 24px;
}

.cyk-success-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
}

.cyk-success-heading {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px;
}

.cyk-booking-number {
  display: inline-block;
  background: #fef0e6;
  border: 1px solid #f0b88a;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 20px;
  font-weight: 700;
  color: #df6d1f;
  letter-spacing: .05em;
  margin-bottom: 20px;
}

.cyk-success-note {
  font-size: 15px;
  color: #555;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Custom calendar widget ──────────────────────────────────────────────── */

.cyk-calendar {
  margin-bottom: 20px;
  user-select: none;
}

.cyk-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cyk-cal-nav {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.cyk-cal-nav:hover {
  background: #fef6f0;
  border-color: #df6d1f;
  color: #df6d1f;
}

.cyk-cal-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  text-transform: capitalize;
}

/* 7-column grid shared by day-of-week labels and day cells */
.cyk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cyk-cal-dow {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-align: center;
  padding: 4px 0 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* All day cells are buttons */
.cyk-cal-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  padding: 0;
  min-width: 0;
  width: 100%;
}

/* Empty padding cells before day 1 */
.cyk-cal-day--filler {
  background: none;
  border: none;
  cursor: default;
  pointer-events: none;
}

/* Available – bookable */
.cyk-cal-day--available {
  background: #fef6f0;
  border-color: #f0b88a;
  color: #c05a14;
  font-weight: 600;
}

.cyk-cal-day--available:hover {
  background: #fde9d4;
  border-color: #df6d1f;
}

/* Unavailable – greyed out, not clickable */
.cyk-cal-day--unavailable {
  background: #f5f5f5;
  color: #bbb;
  cursor: not-allowed;
  border-color: transparent;
}

/* Selected date */
.cyk-cal-day--selected {
  background: #df6d1f !important;
  border-color: #df6d1f !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(223, 109, 31, .2);
}

/* Today indicator (ring, not filled) */
.cyk-cal-day--today:not(.cyk-cal-day--selected) {
  border-color: #df6d1f;
  font-weight: 700;
}

/* Skeleton shimmer while month data is loading */
@keyframes cyk-cal-shimmer {
  0%   { opacity: 0.35; }
  50%  { opacity: 0.7; }
  100% { opacity: 0.35; }
}

.cyk-cal-day--loading {
  background: #f0f0f0;
  border-color: transparent;
  color: transparent;
  animation: cyk-cal-shimmer 1.2s ease-in-out infinite;
  cursor: default;
}

/* ── Responsive tweaks (small mobile) ────────────────────────────────────── */

@media (max-width: 540px) {
  .cyk-booking {
    padding: 0 10px 32px;
  }

  .cyk-card {
    padding: 18px 12px;
  }

  .cyk-step-heading {
    font-size: 18px;
  }

  .cyk-btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  .cyk-progress-label {
    display: none;
  }

  .cyk-progress-num {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .cyk-progress-line {
    margin-top: 15px;
  }

  .cyk-option-grid {
    gap: 8px;
  }

  .cyk-option-grid--3 {
    grid-template-columns: 1fr 1fr 1fr; /* keep 3 cols even on small screens */
  }

  .cyk-option {
    padding: 10px 4px;
  }

  .cyk-option-grid--stack .cyk-option {
    padding: 12px 14px; /* keep comfortable tap target in stack layout */
  }

  .cyk-option-grid--stack .cyk-option-desc {
    display: block; /* show description in stack layout even on mobile */
  }

  .cyk-option-icon {
    font-size: 22px;
  }

  .cyk-option-label {
    font-size: 12px;
  }

  .cyk-option-desc {
    display: none; /* hide descriptions on small screens to save space */
  }

  .cyk-summary-label {
    min-width: 90px;
  }
}

/* ── Multi-bike cards ─────────────────────────────────────────────────────── */

.cyk-bike-card {
  border: 1.5px solid #e8e8e8;
  border-radius: 10px;
  padding: 16px 16px 12px;
  margin-bottom: 20px;
}

.cyk-bike-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cyk-bike-card-title {
  font-weight: 700;
  font-size: 15px;
  color: #333;
}

.cyk-bike-remove-btn {
  background: none;
  border: 1px solid #d9534f;
  color: #d9534f;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cyk-bike-remove-btn:hover {
  background: #d9534f;
  color: #fff;
}

.cyk-add-bike-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  margin-bottom: 24px;
  padding: 12px 20px;
  background: #fff;
  border: 2px dashed #df6d1f;
  border-radius: 10px;
  color: #df6d1f;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}

.cyk-add-bike-btn:hover {
  background: #fdf3eb;
}

/* ── Per-bike service sections (step 4) ──────────────────────────────────── */

.cyk-bike-services {
  margin-bottom: 24px;
}

.cyk-bike-services + .cyk-bike-services {
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.cyk-bike-services-heading {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  padding: 0;
}

/* ── Postal code zone routing (step 3) ──────────────────────────────────── */

.cyk-postal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.cyk-postal-field {
  width: 110px;
  max-width: 100%;
  font-size: 20px;
  letter-spacing: 4px;
  text-align: center;
}

.cyk-postal-checking {
  color: #888;
  font-size: 13px;
}

.cyk-postal-not-serviced {
  background: #fff8f0;
  border: 1px solid #f0c080;
  border-left: 4px solid #df6d1f;
  border-radius: 6px;
  padding: 14px 16px;
  margin: 16px 0 8px;
  color: #7a4000;
  line-height: 1.5;
  font-size: 15px;
}
