/**
 * SLICE CK-2 (2026-09-20). The trip basket: header control + slide-in drawer.
 *
 * Replaces SLICE C-2's floating bottom-right pill, which rendered on every
 * page whether or not anything was in it and sat on top of the checkout
 * form's phone field at 375px. The control now lives in the header, next to
 * the other header actions, and only appears once the basket holds something.
 *
 * Every colour, radius, shadow and font here is an existing corridor-v1
 * token. Gold stays a rule/small-caps accent and is never a filled primary,
 * per that file's own :root comment.
 */

/* ── header control ──────────────────────────────────────────────────── */

.header-basket {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--corr-rule, #C3CFC7);
	border-radius: 999px;
	background: var(--corr-surface, #fff);
	color: var(--corr-action, #0E4C33);
	cursor: pointer;
	transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.header-basket:hover { border-color: var(--corr-action, #0E4C33); }
.header-basket:focus-visible { outline: 2px solid var(--corr-action, #0E4C33); outline-offset: 2px; }
.header-basket[hidden] { display: none !important; }

.header-basket__icon { display: block; width: 21px; height: 21px; }
.header-basket__icon svg { display: block; width: 100%; height: 100%; }

.header-basket__count {
	position: absolute;
	top: -5px;
	inset-inline-end: -5px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--corr-action, #0E4C33);
	color: #fff;
	font-family: var(--corr-sans, system-ui);
	font-size: .6875rem;
	font-style: normal;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* The basket sits in the mobile drawer too, where it is a full-width row. */
.mobile-drawer .header-basket {
	width: 100%;
	height: 48px;
	justify-content: flex-start;
	gap: 10px;
	padding: 0 14px;
	border-radius: var(--corr-r-sm, 5px);
}
.mobile-drawer .header-basket .screen-reader-text {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	clip-path: none;
	white-space: normal;
	font-family: var(--corr-sans, system-ui);
	font-size: .9375rem;
	font-weight: 600;
}
.mobile-drawer .header-basket__count { position: static; margin-inline-start: auto; }

/* ── drawer ──────────────────────────────────────────────────────────── */

.idrive-basket[hidden] { display: none !important; }

.idrive-basket__backdrop {
	position: fixed;
	inset: 0;
	z-index: var(--z-backdrop, 45);
	background: rgba(6, 21, 18, .52);
	border: 0;
	padding: 0;
	cursor: pointer;
}

.idrive-basket__panel {
	position: fixed;
	z-index: var(--z-modal, 60);
	inset-block: 0;
	inset-inline-end: 0;
	width: min(420px, 100vw);
	display: flex;
	flex-direction: column;
	background: var(--corr-surface, #fff);
	box-shadow: var(--corr-sh-3, 0 8px 20px rgba(6, 21, 18, .09));
	overscroll-behavior: contain;
}

.idrive-basket__panel[hidden] { display: none !important; }

.idrive-basket__head {
	flex: 0 0 auto;
	position: relative;
	padding: 20px 56px 16px 20px;
	border-bottom: 1px solid var(--corr-hair, #D9E1DB);
	background: var(--corr-600, #123F2B);
	color: #fff;
}

.idrive-basket__eyebrow {
	margin: 0 0 4px;
	font-family: var(--corr-sans, system-ui);
	font-size: .6875rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--corr-gold-lift, #C9A96A);
}

.idrive-basket__head h2 {
	margin: 0;
	font-family: var(--corr-serif, Georgia, serif);
	font-size: 1.5rem;
	line-height: 1.2;
	color: #fff;
}

.idrive-basket__close {
	position: absolute;
	top: 14px;
	inset-inline-end: 12px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}
.idrive-basket__close:hover { background: rgba(255, 255, 255, .12); }
.idrive-basket__close:focus-visible { outline: 2px solid var(--corr-gold-lift, #C9A96A); outline-offset: 2px; }

.idrive-basket__error {
	margin: 12px 16px 0;
	padding: 10px 12px;
	border-radius: var(--corr-r-md, 8px);
	border: 1px solid rgba(158, 40, 32, .28);
	background: var(--corr-crit-bg, #F7E1DF);
	color: var(--corr-crit, #9E2820);
	font-size: .875rem;
	line-height: 1.45;
}
.idrive-basket__error[hidden] { display: none !important; }

.idrive-basket__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px;
}

.idrive-basket__empty {
	padding: 32px 8px;
	text-align: center;
	color: var(--corr-mist, #6A7A72);
}
.idrive-basket__empty[hidden] { display: none !important; }
.idrive-basket__empty-mark { display: block; margin: 0 auto 12px; width: 40px; height: 40px; color: var(--corr-faint, #93A199); }
.idrive-basket__empty h3 { margin: 0 0 6px; font-family: var(--corr-serif, Georgia, serif); font-size: 1.125rem; color: var(--corr-ink, #061512); }
.idrive-basket__empty p { margin: 0; font-size: .9375rem; line-height: 1.5; }

.idrive-basket__items { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.idrive-basket__items[hidden] { display: none !important; }

.idrive-basket__item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: start;
	padding: 12px;
	border: 1px solid var(--corr-hair, #D9E1DB);
	border-radius: var(--corr-r-md, 8px);
	background: var(--corr-surface, #fff);
}
.idrive-basket__item.is-pending { opacity: .6; }

.idrive-basket__thumb {
	width: 56px;
	height: 42px;
	border-radius: var(--corr-r-sm, 5px);
	object-fit: cover;
	background: var(--corr-sunken, #E8EEE9);
}
.idrive-basket__thumb--blank {
	display: grid;
	place-items: center;
	font-family: var(--corr-sans, system-ui);
	font-size: .625rem;
	letter-spacing: .06em;
	color: var(--corr-faint, #93A199);
}

.idrive-basket__item-body { min-width: 0; }
.idrive-basket__item-body strong {
	display: block;
	font-family: var(--corr-sans, system-ui);
	font-size: .9375rem;
	line-height: 1.3;
	color: var(--corr-ink, #061512);
}
.idrive-basket__item-body span {
	display: block;
	margin-top: 2px;
	font-size: .8125rem;
	line-height: 1.4;
	color: var(--corr-mist, #6A7A72);
}

.idrive-basket__item-side { display: grid; justify-items: end; gap: 6px; }
.idrive-basket__item-price {
	font-family: var(--corr-sans, system-ui);
	font-size: .9375rem;
	font-weight: 700;
	color: var(--corr-ink, #061512);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.idrive-basket__remove {
	width: 44px;
	height: 44px;
	margin: -8px -8px -8px 0;
	border: 0;
	background: transparent;
	color: var(--corr-mist, #6A7A72);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 999px;
}
.idrive-basket__remove:hover { background: var(--corr-sunken, #E8EEE9); color: var(--corr-crit, #9E2820); }
.idrive-basket__remove:focus-visible { outline: 2px solid var(--corr-action, #0E4C33); outline-offset: -2px; }

.idrive-basket__foot {
	flex: 0 0 auto;
	padding: 16px;
	border-top: 1px solid var(--corr-hair, #D9E1DB);
	background: var(--corr-stone, #F1F4F1);
	display: grid;
	gap: 10px;
}

.idrive-basket__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--corr-rule, #C3CFC7);
}
.idrive-basket__total[hidden] { display: none !important; }
.idrive-basket__total span {
	font-family: var(--corr-sans, system-ui);
	font-size: .6875rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--corr-mist, #6A7A72);
}
.idrive-basket__total strong {
	font-family: var(--corr-sans, system-ui);
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--corr-ink, #061512);
	font-variant-numeric: tabular-nums;
}

.idrive-basket__note {
	margin: 0;
	font-size: .8125rem;
	line-height: 1.5;
	color: var(--corr-mist, #6A7A72);
}
.idrive-basket__note[hidden] { display: none !important; }

.idrive-basket__checkout {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	text-align: center;
}
.idrive-basket__checkout[hidden] { display: none !important; }

.idrive-basket__add,
.idrive-basket__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	border: 0;
	background: transparent;
	font-family: var(--corr-sans, system-ui);
	font-size: .9375rem;
	color: var(--corr-action, #0E4C33);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.idrive-basket__clear { color: var(--corr-mist, #6A7A72); }
.idrive-basket__clear[hidden] { display: none !important; }
.idrive-basket__add:focus-visible,
.idrive-basket__clear:focus-visible { outline: 2px solid var(--corr-action, #0E4C33); outline-offset: 2px; }

/* Full-bleed on the narrowest phones; 100dvh so the browser chrome cannot
   crop the checkout button off the bottom. */
@media (max-width: 480px) {
	/* 100% not 100vw: 100vw includes the scrollbar, which pushed the panel
	   15px off the left edge when measured at a 375px viewport. */
	.idrive-basket__panel { width: 100%; height: 100dvh; }
}

@media (prefers-reduced-motion: no-preference) {
	.idrive-basket__panel { animation: idriveBasketIn .22s ease-out both; }
	@keyframes idriveBasketIn {
		from { transform: translateX(8%); opacity: .4; }
		to   { transform: none; opacity: 1; }
	}
}

/*
 * The WordPress admin bar is position:fixed at the top for logged-in users
 * and overlapped the drawer's eyebrow and close button. Visitors never see
 * this, but the owner reviewing the site does.
 */
body.admin-bar .idrive-basket__panel { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .idrive-basket__panel { top: 46px; }
}
