/* =====================================================================
   Side cart (slide-out mini-cart) — Haya
   Loaded globally on WooCommerce installs. Mirrors the .mobile-drawer
   backdrop + body-scroll-lock pattern, sliding in from the right.
   ===================================================================== */

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

.side-cart {
	position: fixed;
	inset: 0;
	z-index: 1600;
	display: flex;
	justify-content: flex-end;
	pointer-events: none;
	opacity: 0;
	background: rgba(0, 0, 0, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	transition: opacity 0.28s ease;
}

.side-cart.open {
	pointer-events: auto;
	opacity: 1;
}

.side-cart-panel {
	width: min(420px, 92vw);
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: #fff;
	border-left: 1px solid var(--hdr-line);
	box-shadow: -18px 0 50px rgba(0, 0, 0, 0.5);
	transform: translateX(105%);
	transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.side-cart.open .side-cart-panel {
	transform: translateX(0);
}

/* ---- Head -------------------------------------------------------- */
.side-cart-head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--border);
	background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.side-cart-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #fff;
}

.side-cart-title > i {
	color: var(--gold);
	font-size: 15px;
}

.side-cart-badge {
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: var(--gold);
	color: var(--ink);
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

.side-cart-close {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: transparent;
	color: #cfcfcf;
	font-size: 16px;
	cursor: pointer;
	transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.side-cart-close:hover {
	border-color: var(--gold);
	color: var(--gold);
	transform: rotate(90deg);
}

/* ---- Body wrapper (fragment-swapped) ----------------------------- */
.side-cart .widget_shopping_cart_content {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

/* ---- Free-shipping progress -------------------------------------- */
.sc-progress {
	flex: 0 0 auto;
	padding: 14px 20px;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}

.sc-progress-msg {
	margin: 0 0 9px;
	font-size: 12.5px;
	color: #d9d9d9;
}

.sc-progress-msg strong {
	color: var(--gold-bright);
	font-weight: 700;
}

.sc-progress-msg i {
	color: var(--gold);
	margin-right: 4px;
}

.sc-progress.is-unlocked .sc-progress-msg {
	color: var(--gold-bright);
	font-weight: 600;
}

.sc-progress-track {
	display: block;
	height: 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.sc-progress-bar {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-bright));
	transition: width 0.4s ease;
}

/* ---- Scrollable item list ---------------------------------------- */
.sc-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.sc-items {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.sc-item {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 14px;
	align-items: start;
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
}

.sc-item-thumb {
	display: block;
	width: 64px;
	height: 80px;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface-2);
}

.sc-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sc-item-info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.sc-item-name {
	color: #fff;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

a.sc-item-name:hover {
	color: var(--gold);
}

.sc-item-variant {
	font-size: 11.5px;
	color: var(--muted);
}

.sc-item-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-top: 2px;
}

.sc-item-qty {
	font-size: 12px;
	color: #b9b9b9;
}

.sc-item-total {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--gold-bright);
	white-space: nowrap;
}

.sc-remove {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--muted);
	font-size: 13px;
	text-decoration: none;
	transition: background 0.16s ease, color 0.16s ease;
}

.sc-remove:hover {
	background: rgba(220, 60, 60, 0.15);
	color: #ff6b6b;
}

/* ---- Footer ------------------------------------------------------ */
.sc-foot {
	flex: 0 0 auto;
	padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--border);
	background: linear-gradient(0deg, var(--surface) 0%, var(--bg) 100%);
}

.sc-subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 4px;
}

.sc-subtotal-label {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #cfcfcf;
}

.sc-subtotal-value {
	font-size: 20px;
	font-weight: 800;
	color: var(--gold-bright);
}

.sc-foot-note {
	margin: 0 0 14px;
	font-size: 11.5px;
	color: var(--muted);
}

.sc-foot-note i {
	color: var(--gold);
	margin-right: 5px;
}

.sc-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.sc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 50px;
	border-radius: var(--radius);
	font-size: 13.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.18s ease, color 0.18s ease, filter 0.18s ease;
}

.sc-btn-cart {
	border: 1px solid var(--border);
	color: #fff;
	background: transparent;
}

.sc-btn-cart:hover {
	border-color: var(--gold);
	color: var(--gold);
}

.sc-btn-checkout {
	border: 1px solid var(--gold);
	color: var(--ink);
	background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 55%, var(--gold-dark) 100%);
}

.sc-btn-checkout:hover {
	filter: brightness(1.06);
}

.sc-btn-checkout i {
	transition: transform 0.18s ease;
}

.sc-btn-checkout:hover i {
	transform: translateX(3px);
}

/* ---- Empty state ------------------------------------------------- */
.sc-empty {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 40px 28px;
	gap: 4px;
}

.sc-empty-icon {
	width: 76px;
	height: 76px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--gold);
	font-size: 28px;
	margin-bottom: 10px;
}

.sc-empty-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
}

.sc-empty-text {
	margin: 0 0 18px;
	font-size: 13px;
	color: var(--muted);
}

.sc-empty .sc-btn-checkout {
	padding: 0 26px;
	height: 48px;
}

/* ---- Loading veil while a line is removed ------------------------ */
.side-cart-panel.is-loading .widget_shopping_cart_content {
	opacity: 0.5;
	pointer-events: none;
}

/* ---- Small screens ----------------------------------------------- */
@media (max-width: 480px) {
	.side-cart-panel {
		width: 100%;
	}

	.sc-actions {
		grid-template-columns: 1fr;
	}

	.sc-btn-cart {
		order: 2;
	}
}
