/* ==========================================================================
   HKN Energy — side cart drawer
   ========================================================================== */

.hkn-side-cart {
	position: fixed;
	inset: 0;
	z-index: 100;
	visibility: hidden;
	overflow: hidden;
}
.hkn-side-cart.is-open { visibility: visible; }

.hkn-side-cart__overlay {
	position: absolute;
	inset: 0;
	background: rgba(6, 10, 18, 0.55);
	opacity: 0;
	transition: opacity 0.25s var(--ease);
}
.hkn-side-cart.is-open .hkn-side-cart__overlay { opacity: 1; }

.hkn-side-cart__panel {
	position: absolute;
	top: 0; right: 0; bottom: 0;
	width: min(420px, 100%);
	background: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s var(--ease);
	box-shadow: -24px 0 48px rgba(11, 18, 32, 0.2);
}
.hkn-side-cart.is-open .hkn-side-cart__panel { transform: translateX(0); }

.hkn-side-cart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-5) var(--space-6);
	border-bottom: var(--border-hair);
	flex-shrink: 0;
}
.hkn-side-cart__head h2 { font-size: 1.1rem; }
.hkn-side-cart__close {
	background: none; border: 0; padding: 6px;
	display: inline-flex; color: var(--hkn-text);
}

.hkn-side-cart__body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.hkn-side-cart__items {
	flex: 1;
	overflow-y: auto;
	padding: var(--space-4) var(--space-6);
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
}

.hkn-side-cart__item {
	position: relative;
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: var(--space-4);
	padding-bottom: var(--space-5);
	border-bottom: var(--border-hair);
}
.hkn-side-cart__item:last-child { border-bottom: 0; padding-bottom: 0; }

.hkn-side-cart__item-media {
	width: 64px; height: 64px;
	border-radius: var(--radius-md);
	background: var(--hkn-off-white);
	display: flex; align-items: center; justify-content: center;
	overflow: hidden;
	color: var(--hkn-gray-600);
}
.hkn-side-cart__item-media img { width: 100%; height: 100%; object-fit: cover; }

.hkn-side-cart__item-body { display: flex; flex-direction: column; gap: 6px; padding-right: var(--space-5); }
.hkn-side-cart__item-name { font-size: var(--fs-small); font-weight: 600; line-height: 1.35; }
.hkn-side-cart__item-variation { font-size: var(--fs-metadata); color: var(--hkn-gray-600); }
.hkn-side-cart__item-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: 4px; }
.hkn-side-cart__item-price { font-weight: 700; font-size: var(--fs-small); }

.hkn-side-cart__item-remove {
	position: absolute; top: 0; right: 0;
	background: none; border: 0; padding: 4px;
	color: var(--hkn-gray-600);
}
.hkn-side-cart__item-remove:hover { color: var(--hkn-text); }

.hkn-qty {
	display: inline-flex;
	align-items: center;
	border: var(--border-hair);
	border-radius: var(--radius-sm);
}
.hkn-qty__btn {
	width: 26px; height: 26px;
	background: none; border: 0;
	font-size: 1rem; line-height: 1;
	color: var(--hkn-text);
}
.hkn-qty__btn:hover { background: var(--hkn-off-white); }
.hkn-qty__value { min-width: 22px; text-align: center; font-size: var(--fs-small); font-weight: 600; }

.hkn-side-cart__item.is-updating { opacity: 0.5; pointer-events: none; }

.hkn-side-cart__footer {
	flex-shrink: 0;
	padding: var(--space-5) var(--space-6) var(--space-6);
	border-top: var(--border-hair);
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}
.hkn-side-cart__subtotal {
	display: flex; align-items: center; justify-content: space-between;
	font-size: var(--fs-body-lg);
}
.hkn-side-cart__note { font-size: var(--fs-metadata); color: var(--hkn-gray-600); margin: 0 0 var(--space-2); }
.hkn-side-cart__footer .hkn-btn { width: 100%; }

.hkn-switch { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; position: relative; }
.hkn-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.hkn-switch__track {
	flex-shrink: 0; width: 36px; height: 20px; margin-top: 2px; border-radius: 999px;
	background: #c9ced8; position: relative; transition: background 0.2s ease;
}
.hkn-switch__track::after {
	content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
	border-radius: 50%; background: #fff; transition: transform 0.2s ease;
}
.hkn-switch input:checked + .hkn-switch__track { background: var(--hkn-blue); }
.hkn-switch input:checked + .hkn-switch__track::after { transform: translateX(16px); }
.hkn-switch input:focus-visible + .hkn-switch__track { outline: 2px solid var(--hkn-blue); outline-offset: 2px; }
.hkn-switch__text { font-size: var(--fs-small); color: var(--hkn-text); display: flex; flex-direction: column; gap: 2px; }
.hkn-switch__text small { font-size: var(--fs-metadata); color: var(--hkn-gray-600); }

.hkn-side-cart__empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: var(--space-3);
	padding: var(--space-8) var(--space-6);
	color: var(--hkn-gray-600);
}
.hkn-side-cart__empty h3 { font-size: 1.15rem; color: var(--hkn-text); }
.hkn-side-cart__empty p { font-size: var(--fs-small); max-width: 30ch; }
.hkn-side-cart__empty .hkn-btn { margin-top: var(--space-3); }

body.hkn-cart-open { overflow: hidden; }

@media (max-width: 480px) {
	.hkn-side-cart__panel { width: 100%; }
}
