/*
 * CCC Booking — Multi‑step booking form styles
 *
 * This stylesheet defines a cohesive look and feel for the booking widget
 * generated by the ccc-booking plugin.  Colours and spacing values are
 * defined as CSS variables at the root so they can be tuned in one place.
 */

/* Palette and sizing variables */
:root {
  --ccc-blue:    #1766ff;
  --ccc-yellow:  #ffd43b;
  --ink:         #0f172a;
  --muted:       #6b7280;
  --bg:          #f7f8fb;
  --card:        #ffffff;
  --ring:        0 0 0 3px rgba(23, 102, 255, 0.18);
  --radius:      18px;
}

/* Reset some basics */
*, *::before, *::after {
  box-sizing: border-box;
}

.ccc-form * {
  min-width: 0;
}

/* Wrapper for the entire form */
.ccc-form {
  max-width: 840px;
  margin: 12px auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(2, 8, 20, 0.08);
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

/* Header section */
.ccc-head {
  padding: 22px 22px 10px;
}
.ccc-title {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: 0.2px;
}
.ccc-sub {
  margin: 0;
  color: var(--muted);
}
.ccc-sub .inline-note {
  float: right;
  font-size: 13px;
}
.ccc-sub .inline-note a {
  color: var(--ccc-blue);
  text-decoration: none;
}
.ccc-sub .inline-note a:hover {
  text-decoration: underline;
}

/* Progress bar */
.progress-wrap {
  padding: 0 22px 16px;
}
.progress {
  height: 10px;
  background: #e8eefb;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--ccc-blue), #80a8ff);
  transition: width 0.35s ease;
  border-radius: 999px;
}

/* Steps container */
#ccc-booking-root {
  padding: 16px 22px 24px;
}
.step {
  display: none;
  animation: fade 0.25s ease;
  padding: 16px 0;
}
.step.active {
  display: block;
}
@keyframes fade {
  from { opacity: 0.4; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Grid helpers */
.grid {
  display: grid;
  gap: 18px;
}
.g2 {
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .g2 { grid-template-columns: 1fr 1fr; }
}

/* Form fields */
.field label {
  display: block;
  font-weight: 700;
  margin: 0 0 8px;
  color: #000;
}
.help {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e6e8ef;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
select:focus {
  border-color: var(--ccc-blue);
  box-shadow: var(--ring);
}
input[readonly],
input[disabled] {
  background: #f4f6ff;
  color: #334155;
}

/* Buttons */
.btns {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 18px;
}
.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.2s, opacity 0.2s;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--ccc-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 102, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
}
.btn-ghost {
  background: #f1f4ff;
  color: #1e293b;
}

/* Cards */
.card {
  position: relative;
  border: 1px solid #eef2ff;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.06);
}

/* Badge / messages */
.badge {
  display: inline-block;
  background: #eef2ff;
  color: #334155;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin-top: 8px;
}
.err {
  color: #b91c1c;
  font-size: 13px;
  margin-top: 6px;
}

/* Time grid */
.time-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}
.slot {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.05s ease, background 0.15s ease;
    text-align: center;
}
.slot:hover {
  transform: translateY(-1px);
}
.slot.selected {
  background: var(--ccc-blue);
  color: #fff;
  border-color: transparent;
}

/* Summary box */
.summary {
  background: #f9fafc;
  border: 1.5px dashed #d8def0;
  border-radius: 12px;
  padding: 20px;
  color: #000;
  margin-top: 16px;
}

/* Add-ons grid */
.addons {
  display: grid;
  gap: 10px;
}

/* Make add‑ons list scrollable when tall */
.scrollable {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 6px;
}
.addon-row {
  display: grid;
  grid-template-columns: auto 1fr auto 90px;
  align-items: center;
  gap: 10px;
}
.addon-row .qty-label {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}
.addon-qty {
  width: 90px;
}

/* === Add-on visibility cards === */
.addons.scrollable {
  border: 1.5px dashed #d8def0;
  border-radius: 12px;
  padding: 8px;
  background: #ffffff;
}

.addon-row {
  border: 1.5px solid #e0e7ff;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.addon-row input[type="checkbox"] {
  transform: scale(1.1);
  place-self: center;
}

/* Quote box at bottom of step: larger text */
#quoteBox {
  margin-top: 14px;
  padding: 12px;
  background: #f4f7ff;
  border: 1.5px solid #e0e7ff;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}
/* emphasise total within quote */
#quoteBox .est-total {
  font-size: 26px;
  font-weight: 800;
  color: var(--ccc-blue);
}

/* Discount notice in summary */
.discount-applied {
    margin-top: 12px;
    padding: 10px 12px;
    background-color: rgba(34, 197, 94, 0.08);
    border: 1.5px dashed rgba(22, 163, 74, 0.6);
    color: #15803d;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    text-align: center;
}

/* Existing bookings list */
.bookings-wrap {
  display: grid;
  gap: 12px;
}
.bookings-list {
  display: grid;
  gap: 10px;
}
.booking-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.b-main .b-line1 {
  font-weight: 700;
}
.b-main .b-line2 {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.b-tags .badge {
  margin: 0;
}
.b-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Pager for existing bookings */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* New Calendar Styles */
.date-picker-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
#calendarDiv {
    flex: 1;
    min-width: 300px;
}
.time-picker {
    flex: 1;
    min-width: 300px;
}
#timePickerTitle {
    margin-bottom: 10px;
    font-size: 16px;
}
#timePickerTitle span {
    color: var(--ccc-blue);
    font-weight: bold;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.calendar-header button {
    background: none;
    border: 1px solid #ccc;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.day-name, .day {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
}
.day.selectable {
    cursor: pointer;
    background: #f0f0f0;
}
.day.selectable:hover {
    background: #fad34b;
}
.day.disabled {
    color: #ccc;
    background-color: #f7f7f7;
    cursor: not-allowed;
}

.day.booked {
  background-color: var(--ccc-blue) !important;
  color: white !important;
  cursor: not-allowed !important;
  opacity: 0.6;
  pointer-events: none !important; /* This is crucial to prevent clicks */
}
.day.today {
    font-weight: bold;
    border: 1.5px solid var(--ccc-blue);
}
.day.selected {
    background: var(--ccc-blue);
    color: white;
}
/* Add some extra spacing for the existing bookings step */
#ccc-booking-root .step:has(#existingWrap) {
  padding-top: 0;
  padding-bottom: 24px;
}

.bookings-wrap {
  border-top: 1.5px solid #eef2ff;
  margin-top: 16px;
  padding-top: 16px;
}