/* ── PAGE HEADER ── */
.page-header {
  padding: 5rem clamp(1.25rem, 4vw, 3rem) 3rem;
  border-bottom: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
}
.page-header h1 {
  font-family: 'Anton', sans-serif;
  font-size: clamp(3.5rem, 9vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
}
.page-header h1 .dot { color: var(--teal); }
.page-header-right {
  padding-bottom: 0.5rem;
}
.page-header-right p {
  font-size: 1rem;
  opacity: 0.65;
  line-height: 1.8;
  max-width: 380px;
}

/* ── BOOKING RULES ── */
.booking-rules {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ink);
  overflow-x: auto;
}
.rule-block {
  flex: 1;
  min-width: 160px;
  padding: 1.5rem clamp(1rem, 2.5vw, 2rem);
  border-right: 1px solid rgba(19,37,36,0.15);
}
.rule-block:last-child { border-right: none; }
.rule-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 0.4rem;
}
.rule-val {
  font-family: 'Anton', sans-serif;
  font-size: 1.4rem;
  line-height: 1;
}
.rule-desc {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  opacity: 0.4;
  margin-top: 0.3rem;
  line-height: 1.5;
}

/* ── MAIN BOOKING LAYOUT ── */
.booking-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 280px);
}

/* ── CALENDAR PANEL ── */
.cal-panel {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-right: 1px solid rgba(19,37,36,0.15);
}

.cal-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.cal-month-label {
  font-family: 'Anton', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}
.cal-arrows {
  display: flex;
  gap: 0.5rem;
}
.cal-arrow {
  width: 36px; height: 36px;
  background: none;
  border: 1px solid rgba(19,37,36,0.2);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cal-arrow:hover { background: var(--ink); color: var(--cream); }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.4rem;
}
.cal-wd {
  font-family: 'DM Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-align: center;
  opacity: 0.3;
  padding: 0.4rem 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-cell {
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  border: 1px solid transparent;
  transition: all 0.15s;
  overflow: hidden;
  user-select: none;
}

/* Empty cells */
.cal-cell.empty {
  cursor: default;
  pointer-events: none;
}

/* Past days */
.cal-cell.past {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

/* Today */
.cal-cell.today {
  border-color: var(--ink);
  font-weight: 600;
}

/* Has availability */
.cal-cell.has-slots:hover {
  background: rgba(19,37,36,0.06);
  border-color: rgba(19,37,36,0.2);
}

/* Selected */
.cal-cell.selected {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

/* Fully booked or blocked — hatched pattern overlay */
.cal-cell.fully-booked {
  color: rgba(19,37,36,0.3);
  cursor: not-allowed;
  pointer-events: none;
}
.cal-cell.fully-booked::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(19,37,36,0.12) 0,
    rgba(19,37,36,0.12) 1px,
    transparent 0,
    transparent 6px
  );
  pointer-events: none;
}

/* Partially booked */
.cal-cell.partial::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--teal);
}
.cal-cell.selected::after { display: none; }

/* Legend */
.cal-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(19,37,36,0.1);
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  opacity: 0.55;
}
.legend-swatch {
  width: 16px; height: 16px;
  border: 1px solid rgba(19,37,36,0.2);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.legend-swatch.available { background: transparent; }
.legend-swatch.partial::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(181,209,204,0.5);
}
.legend-swatch.booked::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(19,37,36,0.2) 0,
    rgba(19,37,36,0.2) 1.5px,
    transparent 0,
    transparent 6px
  );
}

/* ── DAY SHEET PANEL ── */
.day-panel {
  background: var(--ink);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.day-panel-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
  opacity: 0.25;
}
.day-panel-empty-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}
.day-panel-empty p {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.8;
}

.day-panel-content {
  display: none;
  flex-direction: column;
  height: 100%;
}
.day-panel-content.visible { display: flex; }

.day-sheet-header {
  padding: 1.5rem clamp(1.25rem, 2.5vw, 2rem);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.day-sheet-date {
  font-family: 'Anton', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1;
}
.day-sheet-month {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-top: 0.3rem;
}
.day-sheet-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--cream);
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background 0.15s;
}
.day-sheet-close:hover { background: rgba(255,255,255,0.1); }

/* Block selector */
.block-selector {
  padding: 1.25rem clamp(1.25rem, 2.5vw, 2rem);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.block-selector-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-right: 0.5rem;
  flex-shrink: 0;
}
.block-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.block-btn:hover { background: rgba(255,255,255,0.08); }
.block-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--ink);
}

/* Time slots */
.time-slots-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem clamp(1.25rem, 2.5vw, 2rem);
}

.time-slot-row {
  position: relative;
  margin-bottom: 0.5rem;
}

.time-slot {
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: stretch;
  gap: 0;
  position: relative;
  transition: opacity 0.15s;
}
.time-slot:hover:not(:disabled) .slot-bar { border-color: rgba(255,255,255,0.4); }
.time-slot:hover:not(:disabled) .slot-label { opacity: 1; }

.slot-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.35);
  text-align: right;
  padding-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  letter-spacing: 0.05em;
}

.slot-bar {
  border: 1px solid rgba(255,255,255,0.1);
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

/* BOOKED slot — hatched pattern */
.time-slot.booked {
  cursor: not-allowed;
  opacity: 0.6;
}
.time-slot.booked .slot-bar {
  border-color: rgba(255,255,255,0.06);
}
.time-slot.booked .slot-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0.06) 0,
    rgba(255,255,255,0.06) 1px,
    transparent 0,
    transparent 7px
  );
}

.slot-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  position: relative;
  transition: opacity 0.15s;
}
.time-slot.booked .slot-label {
  color: rgba(255,255,255,0.2);
  text-decoration: line-through;
}

.slot-duration-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.2);
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.08);
  margin-left: auto;
}

/* SELECTED slot */
.time-slot.selected .slot-bar {
  background: var(--teal);
  border-color: var(--teal);
}
.time-slot.selected .slot-label { color: var(--ink); opacity: 1; }
.time-slot.selected .slot-time { color: var(--teal); }
.time-slot.selected .slot-duration-badge {
  color: rgba(19,37,36,0.5);
  border-color: rgba(19,37,36,0.2);
}

/* 4-hr block visual — second row connectors */
.slot-connector {
  position: absolute;
  left: 70px;
  top: -4px;
  width: calc(100% - 70px);
  height: 5px;
  background: var(--teal);
  display: none;
  z-index: 2;
}
.time-slot-row.block-top .slot-connector { display: block; }

/* END TIME row */
.slot-end-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  color: rgba(255,255,255,0.2);
  text-align: right;
  padding-right: 1rem;
  padding-top: 0.3rem;
  letter-spacing: 0.05em;
}

/* ── BOOKING FORM ── */
.booking-form-section {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem clamp(1.25rem, 2.5vw, 2rem);
  display: none;
}
.booking-form-section.visible { display: block; }

.form-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 1.25rem;
}

.selected-summary {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.summary-item-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.35;
}
.summary-item-val {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  margin-top: 0.15rem;
  color: var(--teal);
}

.form-row { margin-bottom: 0.9rem; }
.form-label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 0.35rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--cream);
  padding: 0.65rem 0.9rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.04em;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.form-input::placeholder { opacity: 0.25; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--teal);
}
.form-select option { background: var(--ink); }
.form-textarea { height: 72px; resize: vertical; }

.form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-submit {
  width: 100%;
  padding: 0.9rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--teal);
  color: var(--ink);
  border: none;
  cursor: pointer;
  margin-top: 1rem;
  font-weight: 600;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.form-submit:hover { opacity: 0.85; }
.form-submit .wa-icon { font-size: 1rem; }

/* success */
.success-state {
  display: none;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.success-state.visible { display: flex; }
.success-checkmark {
  width: 48px; height: 48px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--ink);
}
.success-state h3 {
  font-family: 'Anton', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.03em;
}
.success-state p {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  opacity: 0.45;
  max-width: 260px;
  line-height: 1.7;
  letter-spacing: 0.05em;
}
.success-state .new-booking-btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.65rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s;
}
.success-state .new-booking-btn:hover { background: rgba(255,255,255,0.08); }

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
  .page-header { grid-template-columns: 1fr; gap: 1.5rem; }
  .booking-body { grid-template-columns: 1fr; }
  .day-panel {
    border-top: 1px solid rgba(19,37,36,0.15);
    min-height: 500px;
  }
}
