/* Wooc Side Cart — front end. Design tokens come from :root vars printed by PHP. */

.wsc,
.wsc *,
.wsc *::before,
.wsc *::after { box-sizing: border-box; }

.wsc[hidden] { display: none !important; }

.wsc {
	position: fixed;
	inset: 0;
	z-index: 999999;
	font-family: var(--wsc-font, inherit);
	color: var(--wsc-text, #111);
	font-size: var(--wsc-fs-base, 14px);
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

.wsc-overlay {
	position: absolute;
	inset: 0;
	background: var(--wsc-overlay, rgba(17, 17, 17, .42));
	opacity: 0;
	transition: opacity .3s ease;
}

.wsc-drawer {
	position: absolute;
	top: 0;
	width: min(100vw, var(--wsc-width, 440px));
	height: 100%;
	max-height: 100dvh;
	background: var(--wsc-bg, #fff);
	box-shadow: 0 0 60px rgba(0, 0, 0, .18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	outline: none;
	transition: transform .38s cubic-bezier(.2, .8, .2, 1);
	will-change: transform;
}
.wsc--h-fixed .wsc-drawer { height: var(--wsc-height, 760px); }
.wsc--left .wsc-drawer { left: 0; transform: translateX(-102%); }
.wsc--right .wsc-drawer { right: 0; transform: translateX(102%); }
.wsc--h-fixed.wsc--left .wsc-drawer { border-bottom-right-radius: 20px; }
.wsc--h-fixed.wsc--right .wsc-drawer { border-bottom-left-radius: 20px; }

.wsc.is-open .wsc-overlay { opacity: 1; }
.wsc.is-open .wsc-drawer { transform: none; }

html.wsc-lock, html.wsc-lock body { overflow: hidden; }

.wsc-content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	position: relative;
}
.wsc.is-busy .wsc-content { cursor: progress; }
.wsc.is-busy .wsc-content::after {
	content: "";
	position: absolute;
	inset: 0;
	background: transparent;
}

.wsc button { font-family: inherit; }
.wsc a { color: inherit; }
.wsc img { max-width: 100%; height: auto; display: block; }
.wsc .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Header */
.wsc-head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	border-bottom: 1px solid var(--wsc-border);
}
.wsc-head__title { display: flex; align-items: center; gap: 10px; }
.wsc-title {
	margin: 0;
	font-size: var(--wsc-fs-title, 22px);
	font-weight: 600;
	letter-spacing: -.01em;
	line-height: 1.2;
	color: inherit;
}
.wsc-badge {
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wsc-text) 6%, var(--wsc-bg));
	font-size: 13px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wsc-iconbtn {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	text-decoration: none;
	transition: background .2s;
}
.wsc-iconbtn:hover { background: color-mix(in srgb, var(--wsc-text) 6%, transparent); }

.wsc :focus-visible {
	outline: 2px solid var(--wsc-accent);
	outline-offset: 2px;
}

/* Free shipping bar */
.wsc-ship {
	flex: 0 0 auto;
	padding: 16px 24px 14px;
	border-bottom: 1px solid color-mix(in srgb, var(--wsc-border) 70%, var(--wsc-bg));
}
.wsc-ship__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}
.wsc-ship__text {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px;
	font-weight: 500;
}
.wsc-ship__text .wsc-i { color: var(--wsc-accent); flex: 0 0 auto; }
.wsc-ship__goal { font-size: var(--wsc-fs-base); color: var(--wsc-muted); white-space: nowrap; }
.wsc-ship__track {
	height: 6px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wsc-accent) 10%, #eef0f2);
	overflow: hidden;
}
.wsc-ship__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--wsc-accent);
	transition: width .45s cubic-bezier(.2, .8, .2, 1);
}

/* Body / items */
.wsc-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: none;
}
.wsc-body::-webkit-scrollbar { width: 0; }

.wsc-items {
	list-style: none;
	margin: 0;
	padding: 8px 24px 4px;
}
.wsc-item {
	display: flex;
	gap: 16px;
	margin: 0 -12px;
	padding: 16px 12px;
	border-radius: 16px;
	border-bottom: 1px solid color-mix(in srgb, var(--wsc-border) 70%, var(--wsc-bg));
	transition: background .7s ease, opacity .2s;
}
.wsc-item:last-child { border-bottom: 0; }
.wsc-item.is-new { background: color-mix(in srgb, var(--wsc-accent) 9%, var(--wsc-bg)); }
.wsc-item.is-pending { opacity: .55; }

.wsc-thumb {
	flex: 0 0 88px;
	width: 88px;
	height: 88px;
	border-radius: 16px;
	background: var(--wsc-thumb-bg);
	overflow: hidden;
}
.wsc-thumb a, .wsc-thumb img { display: block; width: 100%; height: 100%; }
.wsc-thumb img { object-fit: cover; mix-blend-mode: multiply; }

.wsc-item__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wsc-item__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.wsc-item__name { font-size: var(--wsc-fs-name, 16px); font-weight: 500; line-height: 1.35; }
.wsc-item__name a { text-decoration: none; }
.wsc-item__name a:hover { text-decoration: underline; }
.wsc-item__remove {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	margin-block-start: -6px;
	margin-inline-end: -8px;
	color: var(--wsc-muted);
}
.wsc-item__meta, .wsc-item__unit { font-size: var(--wsc-fs-base); color: var(--wsc-muted); }
.wsc-item__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.wsc-item__qtytext { color: var(--wsc-muted); }
.wsc-item__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wsc-item__price del { font-size: var(--wsc-fs-base); color: color-mix(in srgb, var(--wsc-muted) 80%, var(--wsc-bg)); }
.wsc-item__total { font-size: var(--wsc-fs-price, 17px); font-weight: 600; }

/* Quantity stepper */
.wsc-qty {
	display: inline-flex;
	align-items: center;
	height: 36px;
	border: 1px solid color-mix(in srgb, var(--wsc-text) 12%, var(--wsc-bg));
	border-radius: 999px;
	flex: 0 0 auto;
}
.wsc-qty--sm { height: 40px; }
.wsc-qty__btn {
	width: 36px;
	height: 100%;
	border: 0;
	padding: 0;
	background: transparent;
	color: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 999px;
}
.wsc-qty__btn:disabled { opacity: .35; cursor: default; }
.wsc-qty__input, .wsc-qty__val {
	width: 28px;
	min-width: 18px;
	border: 0;
	padding: 0;
	background: transparent;
	color: inherit;
	text-align: center;
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	-moz-appearance: textfield;
	appearance: textfield;
}
.wsc-qty__input::-webkit-outer-spin-button,
.wsc-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Empty state */
.wsc-empty {
	padding: 40px 24px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 10px;
}
.wsc-empty__icon {
	width: 72px; height: 72px;
	border-radius: 999px;
	background: var(--wsc-thumb-bg);
	display: flex; align-items: center; justify-content: center;
}
.wsc-empty__title { margin: 0; font-size: 18px; font-weight: 600; }
.wsc-empty__sub { margin: 0; color: var(--wsc-muted); }
.wsc-link { color: var(--wsc-text); font-weight: 500; text-underline-offset: 3px; }

/* Upsells */
.wsc-up {
	flex: 0 0 auto;
	padding: 16px 0 14px;
	border-top: 1px solid var(--wsc-border);
	background: var(--wsc-upsell-bg);
}
@media (max-width: 767px) { .wsc-up--no-mobile { display: none; } }
@media (max-height: 640px) { .wsc-up { display: none; } }

.wsc-up__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	margin-bottom: 12px;
}
.wsc-up__title { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.3; color: inherit; }
.wsc-up__nav { display: flex; gap: 8px; }
.wsc-roundbtn {
	width: 40px; height: 40px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--wsc-text) 12%, var(--wsc-bg));
	background: var(--wsc-bg);
	color: inherit;
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer;
	padding: 0;
}
.wsc-roundbtn:disabled { opacity: .35; cursor: default; }

.wsc-up__track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 24px;
	padding: 0 24px 2px;
	scrollbar-width: none;
	outline: none;
}
.wsc-up__track::-webkit-scrollbar { height: 0; }

.wsc-card {
	flex: 0 0 300px;
	max-width: calc(100% - 40px);
	scroll-snap-align: start;
	border: 1px solid color-mix(in srgb, var(--wsc-text) 9%, var(--wsc-bg));
	border-radius: 20px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--wsc-bg);
}
.wsc-card__top { display: flex; align-items: center; gap: 12px; }
.wsc-card__thumb {
	flex: 0 0 64px;
	width: 64px; height: 64px;
	border-radius: 14px;
	background: var(--wsc-thumb-bg);
	overflow: hidden;
}
.wsc-card__thumb img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.wsc-card__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wsc-card__name { font-size: 15px; font-weight: 500; line-height: 1.3; text-decoration: none; }
.wsc-card__name:hover { text-decoration: underline; }
.wsc-card__price { font-size: 16px; font-weight: 600; }
.wsc-card__price del { font-size: 13px; font-weight: 400; color: color-mix(in srgb, var(--wsc-muted) 80%, var(--wsc-bg)); margin-inline-start: 6px; }
.wsc-card__price ins { text-decoration: none; }
.wsc-card__hint { font-size: 12px; color: var(--wsc-muted); }
.wsc-card.is-ready .wsc-card__hint { display: none; }

.wsc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.wsc-pill {
	min-width: 40px;
	height: 32px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--wsc-text) 12%, var(--wsc-bg));
	background: var(--wsc-bg);
	color: var(--wsc-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}
.wsc-pill[aria-pressed="true"] { background: var(--wsc-btn-bg); color: var(--wsc-btn-text); border-color: var(--wsc-btn-bg); }
.wsc-pill:disabled {
	background: transparent;
	color: color-mix(in srgb, var(--wsc-muted) 60%, var(--wsc-bg));
	border-style: dashed;
	text-decoration: line-through;
	cursor: not-allowed;
}

.wsc-card__actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.wsc-addbtn {
	flex: 1 1 auto;
	height: 40px;
	border-radius: 999px;
	border: 0;
	padding: 0 14px;
	font-size: 15px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--wsc-btn-bg);
	color: var(--wsc-btn-text);
	cursor: pointer;
	transition: background .2s, color .2s;
}
.wsc-addbtn .wsc-i--check { display: none; }
.wsc-addbtn:disabled { background: color-mix(in srgb, var(--wsc-text) 6%, var(--wsc-bg)); color: color-mix(in srgb, var(--wsc-muted) 70%, var(--wsc-bg)); cursor: not-allowed; }
.wsc-addbtn.is-added { background: color-mix(in srgb, var(--wsc-success) 12%, var(--wsc-bg)); color: color-mix(in srgb, var(--wsc-success) 80%, #000); }
.wsc-addbtn.is-added .wsc-i--check { display: inline; }
.wsc-addbtn.is-loading { opacity: .7; cursor: progress; }

/* Footer */
.wsc-foot {
	flex: 0 0 auto;
	border-top: 1px solid var(--wsc-border);
	padding: 14px 24px 22px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--wsc-bg);
}
.wsc-textbtn {
	align-self: flex-start;
	min-height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: var(--wsc-fs-base);
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}
.wsc-textbtn--center { align-self: center; color: var(--wsc-muted); text-decoration: underline; text-underline-offset: 3px; }
.wsc-textbtn .wsc-i--chevron { transition: transform .25s; }
.wsc-textbtn[aria-expanded="true"] .wsc-i--chevron { transform: rotate(180deg); }

.wsc-coupon__form, .wsc-calc__form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}
.wsc-coupon__form[hidden], .wsc-calc__form[hidden] { display: none; }
.wsc-input {
	flex: 1 1 140px;
	min-width: 0;
	height: 44px;
	border: 1px solid color-mix(in srgb, var(--wsc-text) 15%, var(--wsc-bg));
	border-radius: 12px;
	padding: 0 14px;
	font: inherit;
	font-size: 15px;
	color: var(--wsc-text);
	background: var(--wsc-bg);
}
.wsc-input.is-invalid { border-color: #B42318; }
.wsc-btn-outline {
	height: 44px;
	padding: 0 18px;
	border-radius: 12px;
	border: 1px solid var(--wsc-btn-bg);
	background: var(--wsc-bg);
	color: var(--wsc-text);
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}
.wsc-error { flex-basis: 100%; margin: 0; font-size: 13px; color: #B42318; }

.wsc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: var(--wsc-fs-base); }
.wsc-row--muted { color: var(--wsc-muted); }
.wsc-row--muted .wsc-row__val { font-weight: 500; }
.wsc-row--total { align-items: baseline; font-size: 17px; font-weight: 500; }
.wsc-row--total .wsc-row__val { font-size: var(--wsc-fs-total, 20px); font-weight: 600; }
.wsc-good, .wsc-free { color: var(--wsc-success); font-weight: 500; }

.wsc-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 32px;
	padding: 0 4px 0 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wsc-text) 6%, var(--wsc-bg));
	font-weight: 500;
	letter-spacing: .02em;
	color: var(--wsc-text);
}
.wsc-chip__x {
	width: 26px; height: 26px;
	border: 0; padding: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--wsc-muted);
	display: inline-flex; align-items: center; justify-content: center;
	cursor: pointer;
}

.wsc-checkout {
	height: 56px;
	margin-top: 4px;
	border-radius: 999px;
	background: var(--wsc-btn-bg);
	color: var(--wsc-btn-text) !important;
	text-decoration: none !important;
	font-size: var(--wsc-fs-button, 17px);
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: opacity .2s;
}
.wsc-checkout:hover { opacity: .9; }

.wsc-note { margin: 0; font-size: 13px; color: var(--wsc-muted); text-align: center; line-height: 1.5; }
.wsc-note a { color: var(--wsc-text); text-underline-offset: 3px; }

/* Toast */
.wsc-toast {
	position: absolute;
	inset-inline: 24px;
	bottom: 24px;
	padding: 12px 16px;
	border-radius: 14px;
	background: #2A1414;
	color: #fff;
	font-size: 14px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
	z-index: 2;
}

/* Cart icon (shortcode / menu) */
.wsc-icon {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: inherit;
	text-decoration: none;
	line-height: 1;
}
.wsc-icon__glyph { position: relative; display: inline-flex; }
.wsc-icon__glyph img, .wsc-icon__glyph svg { width: var(--wsc-icon-size, 22px); height: var(--wsc-icon-size, 22px); object-fit: contain; }
.wsc-icon__count {
	position: absolute;
	top: -7px;
	inset-inline-end: -9px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--wsc-btn-bg, #111);
	color: var(--wsc-btn-text, #fff);
	font-size: 11px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.wsc-icon__count--inline { position: static; }
.wsc-icon__count[data-count="0"] { display: none; }
.wsc-icon__subtotal { font-size: .95em; font-weight: 500; }

@media (max-width: 480px) {
	.wsc-head, .wsc-ship, .wsc-foot { padding-inline: 16px; }
	.wsc-items { padding-inline: 16px; }
	.wsc-up__head { padding-inline: 16px; }
	.wsc-up__track { padding-inline: 16px; scroll-padding-inline: 16px; }
	.wsc-card { flex-basis: 280px; }
	.wsc-thumb { flex-basis: 76px; width: 76px; height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
	.wsc-drawer, .wsc-overlay, .wsc-ship__fill, .wsc-item { transition: none; }
}
