/* ============================================================
   Camp booking — ik- design system extension
   Views/Home/CampDetails.cshtml only: the price list, the "Camp weeks"
   card, "Your campers" and the day picker in the booking modal.
   Prefix: ik-cb-. Loaded after event-detail.css (ik-ed-*), which it builds on.

   Contrast, computed against the surface each pair actually lands on:
     #fff on --ik-green (a picked day)                      4.53
     --ik-green-deep on --ik-mint-bg (a booked day)         5.06
     --ik-muted on --ik-cream-2 (closed / past / full day)  4.51
     --ik-red on --ik-cream-2 ("Full")                      4.85
     --ik-red on --ik-pink-bg (full dot, errors)            4.57
     --ik-gold-text on #fff ("2 left", tags)                5.40
     --ik-gold-text on --ik-tan-bg (filling-up dot)         4.54
     --ik-green-deep on --ik-tan-bg (hint link)             4.81
     --ik-ink on --ik-mint-bg (waiver notice)              10.16
   --ik-gray is NOT used on cream-2 (4.18); --ik-muted is.
   ============================================================ */

.ik-cb-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- hero: the phone-width jump to the price card ---------- */
.ik-cb-hero-cta { margin-top: 22px; min-height: 48px; padding: 12px 24px; }
.ik-svc-hero .ik-cb-hero-cta:focus-visible { outline-color: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .3); }
@media (min-width: 992px) {
    /* Beside the hero the price card is already in view. */
    .ik-cb-hero-cta { display: none; }
}

/* ---------- price card ---------- */
.ik-cb-price-gap { height: 14px; }
.ik-cb-terms {
    list-style: none;
    margin: 0 0 16px;
    padding: 14px 0 0;
    border-top: 1px solid var(--ik-border-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ik-cb-terms li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: var(--ik-body);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ik-ink);
}
.ik-cb-terms svg { flex: none; margin-top: 1px; color: var(--ik-green-deep); }
.ik-cb-space { margin-bottom: 16px; }
.ik-cb-space .ik-ed-price-row span.ik-cb-space-low { color: var(--ik-red); }
.ik-cb-cta-slot { margin-top: 4px; }
.ik-cb-cta-slot .ik-btn-cta { min-height: 48px; }
.ik-ed-status-msg.ik-cb-status { justify-content: flex-start; text-align: left; line-height: 1.45; }
.ik-cb-status svg { flex: none; }

/* ---------- "Camp weeks" card ---------- */
.ik-cb-lede {
    font-family: var(--ik-body);
    font-weight: 500;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ik-muted);
    max-width: 62ch;
    margin: -4px 0 14px;
}
.ik-cb-weeks { list-style: none; margin: 0; padding: 0; }
.ik-cb-week {
    display: grid;
    grid-template-columns: minmax(7rem, 8.5rem) 1fr auto;
    align-items: center;
    gap: 8px 16px;
    padding: 12px 0;
    border-top: 1px solid var(--ik-border-soft);
}
.ik-cb-week:first-child { border-top: none; padding-top: 4px; }
.ik-cb-week-label { font-family: var(--ik-display); font-weight: 600; font-size: 15px; color: var(--ik-ink); }
.ik-cb-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.ik-cb-dot {
    min-width: 44px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1.5px solid var(--ik-border);
    background: #fff;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 12.5px;
    color: var(--ik-ink);
}
.ik-cb-dot.is-few { background: var(--ik-tan-bg); border-color: var(--ik-gold); color: var(--ik-gold-text); }
.ik-cb-dot.is-full { background: var(--ik-pink-bg); border-color: transparent; color: var(--ik-red); }
.ik-cb-dot.is-closed,
.ik-cb-dot.is-past { background: var(--ik-cream-2); border-color: transparent; color: var(--ik-muted); }
.ik-cb-dot.is-closed > span[aria-hidden] { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ik-cb-week-state { font-family: var(--ik-body); font-weight: 700; font-size: 13px; text-align: right; white-space: nowrap; }
/* A week with room carries no label; only "Filling up", "Full" and "Past" are said. */
.ik-cb-week-state.is-few { color: var(--ik-gold-text); }
.ik-cb-week-state.is-full { color: var(--ik-red); }
.ik-cb-week-state.is-muted { color: var(--ik-muted); }
.ik-cb-weeks-cta { margin-top: 18px; min-height: 48px; }
@media (max-width: 575.98px) {
    .ik-cb-week { grid-template-columns: 1fr auto; }
    .ik-cb-dots { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- "Your campers" card ---------- */
.ik-cb-campers-head { margin: 0; }
.ik-cb-campers { list-style: none; margin: 0; padding: 6px 12px 10px; }
.ik-cb-camper { padding: 10px 0; }
.ik-cb-camper + .ik-cb-camper { border-top: 1px solid var(--ik-border-soft); }
.ik-cb-camper-head { display: flex; align-items: center; gap: 11px; }
.ik-cb-add-days {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1.5px solid var(--ik-border);
    background: #fff;
    color: var(--ik-ink);
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}
.ik-cb-add-days svg { color: var(--ik-green-deep); }
.ik-cb-add-days:hover { border-color: var(--ik-green); background: var(--ik-mint-bg); }
.ik-cb-camper-weeks {
    list-style: none;
    margin: 8px 0 0 45px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ik-cb-camper-weeks li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--ik-body);
    font-size: 13.5px;
    line-height: 1.4;
}
.ik-cb-camper-week { font-weight: 700; color: var(--ik-ink); white-space: nowrap; }
.ik-cb-camper-days { font-weight: 600; color: var(--ik-muted); text-align: right; }
.ik-cb-camper-weeks li.is-over .ik-cb-camper-week { color: var(--ik-muted); font-weight: 600; }
.ik-cb-camper-none { margin: 6px 0 0 45px; font-family: var(--ik-body); font-weight: 600; font-size: 13px; color: var(--ik-muted); }

/* ============================================================
   Booking modal — the picker
   ============================================================ */
.ik-cb-modal-card {
    max-width: 720px;
    scrollbar-width: thin;
    scrollbar-color: var(--ik-border) transparent;
}
.ik-cb-modal-card .ik-ed-modal-title { margin: 0; line-height: 1.3; }
.ik-cb-modal-close { width: 44px; height: 44px; flex: none; border-radius: 12px; }
@media (max-width: 575.98px) {
    .ik-cb-modal { padding: 8px; }
    .ik-cb-modal .ik-ed-modal-card { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
    .ik-cb-modal .ik-ed-modal-head { padding: 12px 14px 12px 16px; }
    .ik-cb-modal .ik-ed-modal-body { padding: 18px 16px 22px; }
    .ik-cb-modal .ik-ed-modal-foot { padding-left: 16px; padding-right: 16px; }
}

/* steps: fieldsets that read like the page's other step headings */
.ik-cb-step { border: 0; margin: 26px 0 0; padding: 0; min-width: 0; }
.ik-cb-step:first-child { margin-top: 0; }
.ik-cb-step[hidden] { display: none !important; }
.ik-cb-step > legend { padding: 0; width: 100%; }
.ik-cb-hint { font-family: var(--ik-body); font-weight: 600; font-size: 13px; line-height: 1.5; color: var(--ik-muted); margin: -4px 0 12px; }
.ik-cb-hint--lead { margin-top: -6px; }
.ik-cb-req { color: var(--ik-red); }

/* step 1: children */
.ik-cb-child { min-height: 54px; flex-wrap: wrap; }
.ik-cb-child.is-disabled { opacity: 1; background: var(--ik-cream-2); border-color: var(--ik-border-soft); }
.ik-cb-child.is-disabled .ik-ed-student-name,
.ik-cb-child.is-disabled .ik-ed-note { color: var(--ik-muted); }
.ik-cb-child:has(input:focus-visible) { outline: 3px solid var(--ik-focus); outline-offset: 2px; }
.ik-cb-tag {
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 12px;
    line-height: 1.3;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--ik-border);
    background: #fff;
    color: var(--ik-muted);
    text-align: right;
}
.ik-cb-tag--ok { background: var(--ik-mint-bg); border-color: transparent; color: var(--ik-green-deep); }
.ik-cb-tag--warn { border-color: var(--ik-gold); color: var(--ik-gold-text); }

/* step 2: toggles */
.ik-cb-same { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 16px; }
.ik-cb-same[hidden] { display: none; }
.ik-cb-same .ik-cb-hint { margin: 0; }
.ik-cb-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1.5px solid var(--ik-border);
    background: #fff;
    color: var(--ik-ink);
    font-family: var(--ik-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .16s ease, background-color .16s ease;
}
.ik-cb-toggle svg { flex: none; color: var(--ik-green-deep); }
.ik-cb-toggle:hover { border-color: var(--ik-green); }
.ik-cb-toggle[aria-pressed="true"] { background: var(--ik-mint-bg); border-color: var(--ik-green); }
.ik-cb-toggle:disabled { cursor: not-allowed; background: var(--ik-cream-2); border-color: transparent; color: var(--ik-muted); }
.ik-cb-toggle--sm { padding: 0 14px; font-size: 13.5px; }

/* step 2: one child's days */
.ik-cb-child-days { border: 0; margin: 0; padding: 0; min-width: 0; }
.ik-cb-child-days[hidden] { display: none !important; }
/* Every shown child after the first shown one gets a divider; unselected children are display:none. */
.ik-cb-child-days:not([hidden]) ~ .ik-cb-child-days:not([hidden]) { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ik-border); }
.ik-cb-child-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 4px;
}
.ik-cb-child-name { font-family: var(--ik-display); font-weight: 600; font-size: 18px; color: var(--ik-ink); }

.ik-cb-week-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 12px 0;
    border-top: 1px dashed var(--ik-border);
}
.ik-cb-child-head + .ik-cb-week-row { border-top: none; }
.ik-cb-week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.ik-cb-week-name { font-family: var(--ik-display); font-weight: 600; font-size: 15px; color: var(--ik-ink); }
@media (min-width: 600px) {
    .ik-cb-week-row { grid-template-columns: 8.5rem minmax(0, 1fr); align-items: center; column-gap: 16px; }
    .ik-cb-week-head { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
}

/* the day chips: real checkboxes, the label is the target */
.ik-cb-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ik-cb-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    min-height: 64px;
    padding: 6px 2px;
    border-radius: 14px;
    border: 1.5px solid var(--ik-border);
    background: #fff;
    color: var(--ik-ink);
    text-align: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s cubic-bezier(.22, 1, .36, 1);
}
.ik-cb-chip-input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.ik-cb-chip-day {
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 11.5px;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--ik-muted);
}
.ik-cb-chip-num { font-family: var(--ik-display); font-weight: 600; font-size: 19px; line-height: 1.15; }
.ik-cb-chip-note {
    min-height: 1.25em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 11px;
    line-height: 1.25;
    color: var(--ik-gold-text);
}
.ik-cb-chip:has(.ik-cb-chip-input:focus-visible) {
    outline: 3px solid var(--ik-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--ik-focus-halo);
}

/* open: white; picked: the brand fill with a white label */
.ik-cb-chip--bookable:hover { border-color: var(--ik-green); }
.ik-cb-chip--bookable:has(.ik-cb-chip-input:checked) {
    background: var(--ik-green);
    border-color: var(--ik-green);
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(9, 127, 171, .7);
}
.ik-cb-chip--bookable:has(.ik-cb-chip-input:checked) .ik-cb-chip-day,
.ik-cb-chip--bookable:has(.ik-cb-chip-input:checked) .ik-cb-chip-note { color: #fff; }

/* booked: ticked and locked, in the tint rather than the fill so it reads as "yours already" */
.ik-cb-chip--booked { background: var(--ik-mint-bg); border-color: var(--ik-mint-bg); color: var(--ik-green-deep); cursor: default; }
.ik-cb-chip--booked .ik-cb-chip-day,
.ik-cb-chip--booked .ik-cb-chip-note { color: var(--ik-green-deep); }

/* cannot be picked: the darker paper, muted ink (never opacity, which would fail contrast) */
.ik-cb-chip--closed,
.ik-cb-chip--past,
.ik-cb-chip--full,
.ik-cb-chip--weekunavailable { background: var(--ik-cream-2); border-color: transparent; color: var(--ik-muted); cursor: not-allowed; }
.ik-cb-chip--closed { border: 1.5px dashed var(--ik-border); }
.ik-cb-chip--closed .ik-cb-chip-num { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ik-cb-chip--closed .ik-cb-chip-note,
.ik-cb-chip--past .ik-cb-chip-note,
.ik-cb-chip--weekunavailable .ik-cb-chip-note { color: var(--ik-muted); }
.ik-cb-chip--full .ik-cb-chip-note { color: var(--ik-red); }

/* ---------- the live price ---------- */
.ik-cb-quote {
    margin-top: 24px;
    background: #fff;
    border: 1px solid var(--ik-border-soft);
    border-radius: 14px;
    padding: 14px 16px;
}
.ik-cb-quote[hidden] { display: none; }
.ik-cb-quote .ik-ed-breakdown-title { margin: 0 0 8px; }
.ik-cb-quote .ik-ed-breakdown-row { gap: 12px; padding: 3px 0; font-size: 14px; color: var(--ik-ink); }
.ik-cb-quote .ik-ed-breakdown-row span:last-child,
.ik-cb-quote .ik-ed-breakdown-total span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ik-cb-quote .ik-ed-breakdown-row.is-sub { color: var(--ik-muted); font-size: 13px; }
.ik-cb-quote .ik-ed-breakdown-row.is-sub span:first-child { padding-left: 14px; }
.ik-cb-quote .ik-ed-breakdown-row.is-saving { color: var(--ik-green-deep); font-weight: 700; }
.ik-cb-quote .ik-ed-breakdown-row.is-pending { color: var(--ik-muted); }
.ik-cb-quote .ik-ed-breakdown-total { font-size: 16px; }
/* A newer price is on its way: the total goes quiet rather than the whole box fading. */
.ik-cb-quote.is-busy .ik-ed-breakdown-total span:last-child { color: var(--ik-muted); }
.ik-cb-errors {
    list-style: none;
    margin: 10px 0 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--ik-pink-bg);
    color: var(--ik-red);
    font-family: var(--ik-body);
    font-weight: 700;
    font-size: 13px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ik-cb-errors[hidden] { display: none; }
.ik-cb-errors.is-soft { background: var(--ik-cream-2); color: var(--ik-muted); font-weight: 600; }
.ik-cb-week-hints:empty { display: none; }
.ik-cb-week-hint {
    margin: 10px 0 0;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--ik-tan-bg);
    font-family: var(--ik-body);
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ik-ink);
}
.ik-cb-linkbtn {
    display: inline-block;
    padding: 10px 2px;
    margin: -10px 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: 800;
    color: var(--ik-green-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    cursor: pointer;
}
.ik-cb-linkbtn:hover { color: var(--ik-green-dark); }

.ik-cb-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--ik-mint-bg);
    font-family: var(--ik-body);
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ik-ink);
}
.ik-cb-notice[hidden] { display: none; }
.ik-cb-notice svg { flex: none; margin-top: 1px; color: var(--ik-green-deep); }

/* footer */
.ik-cb-foot-cancel { width: auto; min-height: 48px; padding: 0 20px; }
.ik-ed-modal-foot .ik-cb-submit { min-height: 48px; padding: 0 22px; }
@media (max-width: 479.98px) {
    .ik-ed-modal-foot .ik-cb-submit { flex: 1 1 auto; }
    .ik-cb-foot-cancel { padding: 0 16px; }
}

/* ---------- motion: one small authored moment — a picked day settles into place ---------- */
@media (prefers-reduced-motion: no-preference) {
    .ik-cb-chip--bookable:active { transform: scale(.95); }
    .ik-cb-chip--bookable:has(.ik-cb-chip-input:checked) .ik-cb-chip-num { animation: ik-cb-settle .32s cubic-bezier(.22, 1, .36, 1); }
    @keyframes ik-cb-settle {
        from { transform: scale(.72); }
        to { transform: scale(1); }
    }
}
@media (prefers-reduced-motion: reduce) {
    .ik-cb-chip,
    .ik-cb-toggle,
    .ik-cb-add-days { transition: none; }
}
