/* Bed choice (krb_render_bed_step, assets/beds.js): only loaded on trips with a bed layout. The rooms sit in the form's
   own column like the other steps; the price is in the step 4 card (booking.css). On the theme's own tokens. */

.booking--beds {
	--taken: #E6E9E7;
	--hatch: #C4CCC7;
	--taken-ink: #6B7671;
	--note-bg: #FBF0E6;
	--note-ink: #7A3412;
	--floor: var(--bg-soft);
}
:root[data-theme="dark"] .booking--beds {
	--taken: #252F2B;
	--hatch: #3C4B45;
	--taken-ink: #8E9A94;
	--note-bg: #33231A;
	--note-ink: #F2B48F;
	--floor: var(--bg);
}

.booking--beds .booking__step { scroll-margin-top: 96px; }

.beds { font-size: 16px; line-height: 1.55; }
.beds h3, .beds h4, .beds p { margin: 0; }
.beds .beds-lede { color: var(--ink-soft); max-width: 62ch; margin-bottom: 22px; }
.beds--js .beds-party__select { display: none; }
.beds:not(.beds--js) .beds-seg, .beds:not(.beds--js) .beds-party__label { display: none; }

.beds-plans { display: grid; gap: 18px; min-width: 0; }
.beds-floors { display: grid; gap: 18px; min-width: 0; }
.beds-party { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.beds-party__label { font-weight: 600; }
.beds-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.beds-seg button { border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-weight: 600; min-width: 40px; min-height: 36px; padding: 0 8px; border-radius: 999px; cursor: pointer; font-variant-numeric: tabular-nums; }
.beds-seg button[aria-pressed="true"] { background: var(--green); color: var(--surface); }
.beds-seg button:disabled { opacity: .4; cursor: not-allowed; }
.beds-seg button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.beds-auto { margin: -6px 0 0; font-size: 15px; color: var(--ink-soft); max-width: 62ch; }
.beds-auto:empty { display: none; }
.beds-auto strong { color: var(--green); font-weight: 600; }
.beds-stuck { font-size: 15px; color: var(--note-ink); background: var(--note-bg); border-radius: 10px; padding: 10px 14px; }
.beds-stuck a { color: inherit; font-weight: 600; }

.beds-bldg { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: 0 2px 10px var(--shadow); display: grid; gap: 14px; }
.beds-bldg__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; }
.beds-bldg__head h3 { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.beds-bldg__head p { color: var(--ink-soft); font-size: 14px; }

/* Every room sits on the same columns, so the buildings line up. */
.beds-floor { display: grid; grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr)); background: var(--floor); border: 2px solid var(--green); border-radius: 12px; overflow: hidden; }
.beds-room { padding: 16px; display: grid; gap: 12px; grid-template-rows: auto 1fr; border-right: 1.5px solid var(--green); min-width: 0; }
.beds-room:last-child { border-right: 0; }
.beds-floor.is-open .beds-room { border-right-style: dashed; }
.beds-floor.is-open .beds-room:last-child { grid-column: span 2; border-right: 0; }
.beds-room__head { display: grid; line-height: 1.25; }
.beds-room__head h4 { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.1; }
.beds-room__kind { font-size: 13px; color: var(--ink-soft); }
.beds-bed { display: grid; min-width: 0; }
.beds-frame { display: grid; gap: 8px; grid-auto-rows: 1fr; min-width: 0; }
.beds-bed--double .beds-frame, .beds-bed--loft .beds-frame, .beds-bed--twin .beds-frame { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.beds-bed .beds-frame:has(.is-wide) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 720px) {
	.beds-bldg { padding: 14px; }
	.beds-floor { grid-template-columns: minmax(0, 1fr); }
	.beds-room, .beds-floor.is-open .beds-room { border-right: 0; border-bottom: 1.5px solid var(--green); }
	.beds-floor.is-open .beds-room { border-bottom-style: dashed; }
	.beds-room:last-child, .beds-floor.is-open .beds-room:last-child { border-bottom: 0; grid-column: auto; }
	.beds-bed--bunk .beds-frame { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.beds-spot {
	position: relative; appearance: none; font: inherit; text-align: left; cursor: pointer;
	border: 1.5px solid var(--field-border); background: var(--surface); color: var(--ink);
	border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 64px; min-width: 0;
	box-shadow: 0 1px 2px var(--shadow);
	transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.beds-spot:hover:not(:disabled) { border-color: var(--green); transform: translateY(-1px); box-shadow: 0 6px 14px var(--shadow); }
.beds-spot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.beds-spot__name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.beds-spot__meta { font-size: 13px; color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.beds-spot[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--surface); }
.beds-spot[aria-pressed="true"] .beds-spot__meta { color: var(--surface); }
.beds-spot[aria-pressed="true"]::after { content: attr(data-mark); position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); color: var(--green); font-weight: 700; font-size: 12px; line-height: 1; }
.beds-spot.is-span { grid-column: 1 / -1; }
.beds-spot:disabled { background: repeating-linear-gradient(135deg, var(--hatch) 0 1.5px, transparent 1.5px 8px), var(--taken); border-color: var(--hatch); color: var(--taken-ink); box-shadow: none; cursor: not-allowed; }
.beds-spot:disabled .beds-spot__name, .beds-spot:disabled .beds-spot__meta { align-self: flex-start; background: var(--taken); padding: 0 6px; border-radius: 4px; }
.beds-spot:disabled .beds-spot__name { font-weight: 500; }
.beds-spot:disabled .beds-spot__meta { color: var(--taken-ink); font-weight: 400; }

/* Who sleeps where, in the step 4 card */
.beds-who { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.beds-who li { display: flex; gap: 8px; align-items: center; }
.beds-n { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: var(--surface); font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.beds-who .is-open { color: var(--ink-soft); }
.beds-who .is-open .beds-n { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1.5px var(--field-border); }

/* One line about the chosen bed, under the rooms */
.beds .beds-detail { font-size: 15px; color: var(--ink-soft); max-width: 62ch; margin-top: -4px; }
.beds-detail:empty { display: none; }

@media (prefers-reduced-motion: reduce) { .beds-spot { transition: none; } }
