/* ============================================================
   Bokningskortet i Claude Design-språket.

   booking-v2.js är oförändrad Supabase-logik från gamla sajten och byter ut
   kortets innehåll vid varje steg (kalender → formulär → kvitto). Den skriver
   sin egen markup med bc-*-klasser, så allt den kan tänkas rendera måste vara
   stylat här — inte bara det som står i Booking.astro.

   Skriptet skriver också inline `var(--straw)` och `var(--stone)`. De två
   variablerna måste finnas, annars blir bocken i kvittot osynlig.
   ============================================================ */
#bookCard {
  --straw: #0B4A32;
  --stone: #6E6A62;
  --line: #E8E6E1;

  width: 100%;
  max-width: 720px;
  background: #FEFDFB;
  border: 1px solid rgba(15, 15, 14, .06);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 1px 3px rgba(15, 22, 35, .05), 0 60px 90px -60px rgba(15, 15, 14, .5);
  font-family: Archivo, sans-serif;
  color: #0F0F0E;
}

/* Kalenderns höjd är låst till sex veckorader — den bredaste månaden — så att
   kortet inte hoppar när man bläddrar mellan månader, och så att tidslistan
   har en höjd att scrolla inuti. */
.bc-main { display: grid; grid-template-columns: 1fr 210px; gap: 26px; min-height: 436px; }

/* ── kalendern ─────────────────────────────────────────────── */
.bc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bc-head .m {
  font-family: 'Familjen Grotesk', sans-serif; font-weight: 500;
  font-size: 19px; letter-spacing: -.02em; text-transform: capitalize;
}
.bc-nav { display: flex; gap: 6px; }
.bc-nav button {
  width: 32px; height: 32px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: #0F0F0E;
  font-size: 17px; line-height: 1; transition: background .18s ease, border-color .18s ease;
}
.bc-nav button:hover { background: #F4F0E8; border-color: #DCD7CC; }

.bc-dow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: #B4AFA7; text-align: center;
}
.bc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.bc-day {
  aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  background: transparent; color: #0F0F0E; font-family: Archivo, sans-serif; font-size: 14px;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.bc-day:hover:not(:disabled) { background: #F4F0E8; }
.bc-day.today { border-color: var(--line); }
.bc-day.sel { background: #0B4A32; color: #FEFDFB; border-color: #0B4A32; }
.bc-day:disabled, .bc-day.empty { opacity: .26; cursor: default; background: transparent; }
.bc-day.empty { pointer-events: none; }

/* ── tiderna ───────────────────────────────────────────────── */
.bc-times {
  border-left: 1px solid var(--line); padding-left: 22px;
  max-height: 436px; overflow-y: auto; min-height: 0;
  /* Toningen nedtill säger att listan fortsätter — sexton tider ryms inte. */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
}
.bc-times::-webkit-scrollbar { width: 4px; }
.bc-times::-webkit-scrollbar-thumb { background: #DCD7CC; border-radius: 999px; }
.bc-empty { font-size: 13.5px; line-height: 1.5; color: var(--stone); padding-top: 4px; }
.bc-slots { display: flex; flex-direction: column; gap: 6px; }
.bc-slot {
  width: 100%; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: center;
  border: 1px solid var(--line); background: #fff; color: #0F0F0E;
  font-family: Archivo, sans-serif; font-size: 14px;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.bc-slot:hover:not(:disabled) { border-color: #0B4A32; }
.bc-slot.sel { background: #0B4A32; color: #FEFDFB; border-color: #0B4A32; }
.bc-slot:disabled { opacity: .3; cursor: default; }

/* ── knappen ───────────────────────────────────────────────── */
#bookCard .btn,
.bc-confirm {
  display: block; width: 100%; margin-top: 22px; padding: 16px 24px;
  border: none; border-radius: 13px; cursor: pointer;
  background: #1A1A18; color: #fff;
  font-family: Archivo, sans-serif; font-weight: 600; font-size: 15px;
  transition: opacity .18s ease, transform .18s ease;
}
#bookCard .btn:disabled, .bc-confirm:disabled { opacity: .34; cursor: default; }
#bookCard .btn:not(:disabled):hover { transform: translateY(-1px); }

/* ── formuläret ────────────────────────────────────────────── */
.bc-form-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.bc-back-btn {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: #0F0F0E; font-size: 18px; line-height: 1;
}
.bc-back-btn:hover { background: #F4F0E8; }
.bc-form-summary { font-size: 15px; color: var(--stone); }
.bc-form-summary strong { color: #0F0F0E; font-weight: 600; }
.bc-form { display: flex; flex-direction: column; gap: 10px; }
.bc-input {
  width: 100%; padding: 14px 16px; border-radius: 11px;
  border: 1px solid var(--line); background: #fff; color: #0F0F0E;
  font-family: Archivo, sans-serif; font-size: 15px;
}
.bc-input::placeholder { color: #A29D95; }
.bc-input:focus { outline: none; border-color: #0B4A32; box-shadow: 0 0 0 3px rgba(11, 74, 50, .1); }

/* ── kvittot ───────────────────────────────────────────────── */
.bc-done { text-align: center; padding: 26px 10px; }
.bc-done .check {
  width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 999px;
  background: rgba(11, 74, 50, .09); display: flex; align-items: center; justify-content: center;
}
.bc-done .check svg { width: 26px; height: 26px; }
.bc-done h4 {
  margin: 0 0 12px; font-family: 'Familjen Grotesk', sans-serif; font-weight: 500;
  font-size: 27px; letter-spacing: -.03em;
}
.bc-done p { margin: 0 0 7px; font-size: 15px; line-height: 1.55; color: var(--stone); }
.bc-done p strong { color: #0F0F0E; font-weight: 600; }
.bc-retry {
  margin-top: 18px !important; font-family: 'JetBrains Mono', monospace;
  font-size: 10px !important; letter-spacing: .1em; text-transform: uppercase; color: #B4AFA7 !important;
}
.bc-resend-link {
  border: none; background: none; cursor: pointer; padding: 0;
  color: #0B4A32; font: inherit; text-decoration: underline;
}

/* Kalender och tider staplas när kortet inte får plats bredvid varandra. */
@media (max-width: 760px) {
  #bookCard { padding: 20px; }
  .bc-main { grid-template-columns: 1fr; gap: 20px; }
  .bc-main { min-height: 0; }
  .bc-times { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 18px; max-height: none; mask-image: none; -webkit-mask-image: none; }
  .bc-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
