/* =========================================================================
   BuyTides — slide-out cart
   Values taken from the approved BuyTides-SideCart design.
   ========================================================================= */

.bt-drawer,
.bt-drawer__scrim {
	--bt-navy: #0b2c4d;
	--bt-navy-hover: #164a7a;
	--bt-navy-active: #08213a;
	--bt-cyan: #1fc8e3;
	--bt-cyan-tint: #eaf7fb;
	--bt-cyan-track: #cde9f2;
	--bt-teal: #1b7fa8;
	--bt-mist: #eef2f4;
	--bt-line: #dde7ee;
	--bt-line-soft: #e6edf1;
	--bt-muted: #7c93a3;
	--bt-navy-soft: #2c4658;
	--bt-ink-1: #d8e9f4;
	--bt-ink-2: #8fb6cc;

	--bt-sans: "Inter", system-ui, -apple-system, sans-serif;
	--bt-display: "Outfit", "Inter", system-ui, sans-serif;
}

html.bt-drawer-open {
	overflow: hidden;
}

.bt-drawer *,
.bt-drawer *::before {
	box-sizing: border-box;
}

.bt-drawer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bt-drawer a {
	text-decoration: none;
}

.bt-drawer p {
	margin: 0;
}

.bt-drawer button:focus-visible,
.bt-drawer a:focus-visible {
	outline: 2px solid var(--bt-cyan);
	outline-offset: 2px;
}

/* ---------- Scrim ---------- */

.bt-drawer__scrim {
	position: fixed;
	inset: 0;
	z-index: 60;
	background: rgba(11, 44, 77, 0.55);
	backdrop-filter: blur(2px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.32s ease;
}

.bt-drawer__scrim.is-open {
	opacity: 1;
	pointer-events: auto;
}

/* ---------- Panel ---------- */

.bt-drawer {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 61;
	height: 100vh;
	height: 100dvh;
	width: min(440px, 100vw);
	display: flex;
	flex-direction: column;
	background: var(--bt-mist);
	font-family: var(--bt-sans);
	color: var(--bt-navy);
	box-shadow: -24px 0 60px rgba(11, 44, 77, 0.24);
	transform: translateX(100%);
	transition: transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.bt-drawer.is-open {
	transform: translateX(0);
}

/* ---------- Head ---------- */

.bt-drawer__head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 22px;
	background: var(--bt-navy);
	color: #fff;
}

.bt-drawer__title {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-family: var(--bt-display);
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.bt-drawer__badge {
	color: var(--bt-ink-2);
	font-weight: 500;
}

.bt-drawer__close {
	appearance: none;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bt-drawer__close:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* ---------- Layout ---------- */

.bt-drawer__contents {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.bt-drawer__scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 18px 22px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	scrollbar-width: thin;
}

.bt-drawer__scroll::-webkit-scrollbar {
	width: 8px;
}

.bt-drawer__scroll::-webkit-scrollbar-thumb {
	background: #c7e9f3;
	border-radius: 8px;
}

/* ---------- Free shipping meter ---------- */

.bt-freeship {
	flex: 0 0 auto;
	background: var(--bt-cyan-tint);
	border: 1.5px solid var(--bt-cyan);
	border-radius: 16px;
	padding: 16px 18px;
}

.bt-freeship__row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bt-freeship__label {
	flex: 1;
	min-width: 0;
	font-family: var(--bt-display);
	font-size: 15.5px;
	font-weight: 600;
	color: var(--bt-navy);
}

.bt-freeship__check {
	flex: 0 0 auto;
	color: var(--bt-teal);
	display: none;
}

.bt-freeship.is-unlocked .bt-freeship__check {
	display: block;
}

.bt-freeship__track {
	margin-top: 12px;
	height: 8px;
	border-radius: 999px;
	background: var(--bt-cyan-track);
	overflow: hidden;
}

.bt-freeship__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--bt-teal);
	transition: width 0.4s ease;
}

/* ---------- Promo card ---------- */

.bt-promo {
	flex: 0 0 auto;
	display: flex;
	gap: 11px;
	background: var(--bt-navy);
	border: 1.5px solid var(--bt-cyan);
	border-radius: 16px;
	padding: 15px 18px;
}

.bt-promo__icon {
	flex: 0 0 auto;
	color: var(--bt-cyan);
}

.bt-promo__body {
	flex: 1;
	min-width: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--bt-ink-1);
}

.bt-promo__body b {
	color: #fff;
}

.bt-promo__countdown {
	color: var(--bt-cyan);
	font-variant-numeric: tabular-nums;
}

/* ---------- Items ---------- */

.bt-drawer__items {
	flex: 0 0 auto;
	background: #fff;
	border-radius: 18px;
	padding: 6px 18px;
}

.bt-ci {
	display: flex;
	gap: 14px;
	padding: 18px 0;
	border-bottom: 1px solid var(--bt-line-soft);
}

.bt-ci:last-child {
	border-bottom: 0;
}

.bt-ci__thumb {
	position: relative;
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border-radius: 12px;
	overflow: hidden;
	background: var(--bt-cyan-tint);
	border: 1px solid var(--bt-line);
	display: block;
}

.bt-ci__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bt-ci__body {
	flex: 1;
	min-width: 0;
}

.bt-ci__top {
	display: flex;
	gap: 10px;
	align-items: baseline;
}

.bt-ci__name {
	flex: 1;
	min-width: 0;
	font-family: var(--bt-display);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--bt-navy);
}

a.bt-ci__name:hover {
	color: var(--bt-teal);
}

.bt-ci__price {
	flex: 0 0 auto;
	font-family: var(--bt-display);
	font-size: 16.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.bt-ci__meta {
	font-size: 13.5px;
	color: var(--bt-muted);
	margin-top: 3px;
}

.bt-ci__meta p {
	margin: 0;
}

.bt-ci__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 11px;
}

.bt-qty {
	display: flex;
	align-items: center;
	gap: 2px;
	border: 1px solid var(--bt-line);
	border-radius: 999px;
	padding: 2px;
	background: #fff;
}

.bt-qty__btn {
	appearance: none;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bt-navy);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bt-qty__btn:hover:not(:disabled) {
	background: var(--bt-cyan-tint);
}

.bt-qty__btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.bt-qty__val {
	min-width: 24px;
	text-align: center;
	font-family: var(--bt-display);
	font-size: 15px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.bt-ci__remove {
	appearance: none;
	border: 0;
	background: transparent;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 5px;
	font-family: var(--bt-display);
	font-size: 14px;
	font-weight: 600;
	color: var(--bt-teal);
	cursor: pointer;
}

.bt-ci__remove:hover {
	color: var(--bt-navy);
}

.bt-ci__removeicon {
	width: 15px;
	height: 15px;
}

.bt-drawer__empty {
	padding: 22px 0;
	text-align: center;
	font-size: 14.5px;
	color: var(--bt-muted);
}

/* ---------- Summary ---------- */

.bt-drawer__summary {
	flex: 0 0 auto;
	background: #fff;
	border-top: 1px solid var(--bt-line);
	padding: 18px 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.bt-drawer__line {
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.bt-drawer__linelabel {
	flex: 1;
	min-width: 0;
	font-family: var(--bt-display);
	font-size: 19px;
	font-weight: 600;
}

.bt-drawer__linevalue {
	font-family: var(--bt-display);
	font-size: 23px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.bt-drawer__code {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	background: var(--bt-cyan-tint);
	border-radius: 14px;
	padding: 13px 15px;
}

.bt-drawer__codebadge {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 7px;
	background: var(--bt-teal);
	color: #fff;
	font-family: var(--bt-display);
	font-size: 13px;
	font-weight: 700;
}

.bt-drawer__codecopy {
	flex: 1;
	min-width: 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--bt-navy-soft);
}

.bt-drawer__ship {
	font-size: 13px;
	line-height: 1.6;
	color: var(--bt-muted);
}

.bt-drawer__checkout {
	width: 100%;
	border: 0;
	border-radius: 999px;
	background: var(--bt-navy);
	color: #fff;
	font-family: var(--bt-display);
	font-size: 17px;
	font-weight: 600;
	padding: 17px 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: background 0.15s ease;
}

.bt-drawer__checkout:hover {
	background: var(--bt-navy-hover);
	color: #fff;
}

.bt-drawer__checkout:active {
	background: var(--bt-navy-active);
}

.bt-drawer__checkout[aria-disabled="true"] {
	opacity: 0.45;
	pointer-events: none;
}

.bt-drawer__ruo {
	font-size: 12.5px;
	line-height: 1.6;
	color: var(--bt-muted);
	text-align: center;
}

/* ---------- Busy + error ---------- */

.bt-drawer__spinner {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(238, 242, 244, 0.55);
	pointer-events: none;
}

.bt-drawer.is-busy .bt-drawer__spinner {
	display: flex;
}

.bt-drawer.is-busy .bt-drawer__contents {
	pointer-events: none;
}

.bt-drawer__spinner span {
	width: 26px;
	height: 26px;
	border: 2.5px solid var(--bt-line);
	border-top-color: var(--bt-teal);
	border-radius: 50%;
	animation: bt-drawer-spin 0.7s linear infinite;
}

@keyframes bt-drawer-spin {
	to { transform: rotate(360deg); }
}

.bt-drawer__error {
	display: none;
	margin: 0 18px;
	padding: 11px 14px;
	border-radius: 12px;
	background: #fdecea;
	color: #a4231a;
	font-size: 13px;
	line-height: 1.5;
}

.bt-drawer.is-error .bt-drawer__error {
	display: block;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	.bt-drawer__head,
	.bt-drawer__summary {
		padding-inline: 16px;
	}

	.bt-drawer__scroll {
		padding-inline: 14px;
	}

	.bt-drawer__items {
		padding-inline: 14px;
	}

	.bt-ci__thumb {
		flex-basis: 62px;
		width: 62px;
		height: 62px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bt-drawer,
	.bt-drawer__scrim,
	.bt-freeship__fill {
		transition: none;
	}

	.bt-drawer__spinner span {
		animation-duration: 2s;
	}
}
