/**
 * Slide Cart Drawer for WooCommerce
 * ---------------------------------------------------------------------
 * Colours come from CSS custom properties set inline by PHP
 * (--wsc-accent, --wsc-accent-text, --wsc-header-bg, --wsc-header-text,
 * --wsc-note-bg) so they can be overridden from a theme stylesheet.
 */

.wsc-drawer {
	--wsc-accent: #e7b03f;
	--wsc-accent-text: #14342b;
	--wsc-header-bg: #123b2e;
	--wsc-header-text: #ffffff;
	--wsc-note-bg: #fdf1e7;
	--wsc-ink: #16241f;
	--wsc-muted: #6b7b75;
	--wsc-line: #e8ecea;
	--wsc-panel-width: 430px;
	--wsc-speed: 0.34s;

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	visibility: hidden;
	font-size: 15px;
	line-height: 1.45;
	color: var(--wsc-ink);
	-webkit-font-smoothing: antialiased;
}

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

.wsc-drawer.is-open {
	pointer-events: auto;
	visibility: visible;
}

.wsc-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 26, 20, 0.5);
	opacity: 0;
	transition: opacity var(--wsc-speed) ease;
}

.wsc-drawer.is-open .wsc-drawer__overlay {
	opacity: 1;
}

.wsc-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	width: min(var(--wsc-panel-width), 100%);
	background: #fff;
	box-shadow: -12px 0 44px rgba(6, 22, 17, 0.22);
	transform: translate3d(100%, 0, 0);
	transition: transform var(--wsc-speed) cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	overflow: hidden;
}

.wsc-drawer--left .wsc-drawer__panel {
	right: auto;
	left: 0;
	transform: translate3d(-100%, 0, 0);
	box-shadow: 12px 0 44px rgba(6, 22, 17, 0.22);
}

.wsc-drawer.is-open .wsc-drawer__panel {
	transform: translate3d(0, 0, 0);
}

/* Header ------------------------------------------------------------- */
.wsc-drawer__header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	padding: 20px 22px;
	background: var(--wsc-header-bg);
	color: var(--wsc-header-text);
	border-bottom: 3px solid var(--wsc-accent);
}

.wsc-drawer__cart-icon {
	display: inline-flex;
	color: var(--wsc-header-text);
	opacity: 0.95;
}

.wsc-drawer__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: inherit;
}

.wsc-drawer__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--wsc-accent);
	color: var(--wsc-accent-text);
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
}

.wsc-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background 0.18s ease, opacity 0.18s ease;
}

.wsc-drawer__close:hover,
.wsc-drawer__close:focus-visible {
	background: rgba(255, 255, 255, 0.14);
}

/* Notice ------------------------------------------------------------- */
.wsc-drawer__notice {
	flex: 0 0 auto;
	margin: 14px 22px 0;
	padding: 10px 14px;
	border-radius: 6px;
	background: #fdecea;
	color: #8a1f11;
	font-size: 13.5px;
}

.wsc-drawer__notice[hidden] {
	display: none;
}

/* Items -------------------------------------------------------------- */
.wsc-drawer__items {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 22px 8px;
	-webkit-overflow-scrolling: touch;
	transition: opacity 0.2s ease;
}

.wsc-drawer__items::-webkit-scrollbar {
	width: 6px;
}

.wsc-drawer__items::-webkit-scrollbar-thumb {
	background: #cdd6d2;
	border-radius: 999px;
}

.wsc-item {
	display: grid;
	grid-template-columns: 74px minmax(0, 1fr) auto;
	gap: 14px;
	padding: 20px 0;
	border-bottom: 1px solid var(--wsc-line);
}

.wsc-item:last-child {
	border-bottom: 0;
}

.wsc-item__thumb {
	width: 74px;
	height: 74px;
	border-radius: 8px;
	overflow: hidden;
	background: #f3f5f4;
}

.wsc-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
}

.wsc-item__info {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wsc-item__name {
	font-size: 15.5px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wsc-ink);
	text-decoration: none;
}

.wsc-item__name:hover {
	text-decoration: underline;
}

.wsc-item__meta {
	margin: 0;
	font-size: 13.5px;
	color: var(--wsc-muted);
}

.wsc-item__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
	text-align: right;
}

.wsc-item__price {
	font-size: 15.5px;
	font-weight: 700;
	white-space: nowrap;
}

.wsc-item__price .amount,
.wsc-drawer__totals-value .amount {
	color: inherit;
}

.wsc-item__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: auto !important;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
	color: #b3402d;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.wsc-item__remove:hover,
.wsc-item__remove:focus-visible {
	opacity: 1;
	background: transparent !important;
}

/* Quantity stepper --------------------------------------------------- */
.wsc-qty {
	display: inline-flex;
	align-items: stretch;
	margin-top: 8px;
	height: 34px;
	background: #fff;
	overflow: hidden;
	width: max-content;
}

.wsc-qty__btn {
    border: 1px solid #ccc !important;
    background: #ccc !important;
    color: var(--wsc-ink) !important;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}
.wsc-qty__btn:hover,
.wsc-qty__btn:focus-visible {
	background: #f1f4f2;
}

.wsc-qty__input {
	width: 40px !important;
	padding: 0 !important;
	border: none !important;
	background: transparent;
	color: var(--wsc-ink);
	font-size: 14.5px;
	font-weight: 700;
	text-align: center;
	-moz-appearance: textfield;
}

.wsc-qty__input::-webkit-outer-spin-button,
.wsc-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wsc-qty__input:focus {
	outline: 2px solid var(--wsc-accent);
	outline-offset: -2px;
	border-radius: 4px;
}

/* Footer ------------------------------------------------------------- */
.wsc-drawer__summary {
	flex: 0 0 auto;
	padding: 18px 22px 22px;
	border-top: 1px solid var(--wsc-line);
	background: #f5f6f6;
	transition: opacity 0.2s ease;
}

.wsc-drawer__note {
	margin: 0 0 12px;
	padding: 12px 14px;
	border-radius: 5px;
	background: var(--wsc-note-bg);
	color: #1f3a2f;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.4;
}

.wsc-drawer__note .amount {
	font-weight: 700;
	color: inherit;
}

.wsc-drawer__summary[data-qualified="yes"] .wsc-drawer__note {
	background: #e8f6ec;
	color: #14532d;
	font-weight: 600;
}

.wsc-progress {
	position: relative;
	height: 6px;
	margin: 0 0 16px;
	border-radius: 999px;
	background: rgba(20, 52, 43, 0.12);
	overflow: hidden;
}

.wsc-progress__bar {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--wsc-accent);
	transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.wsc-drawer__totals {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 16px;
	font-size: 16px;
}

.wsc-drawer__totals-label {
	font-weight: 500;
	color: var(--wsc-ink);
}

.wsc-drawer__totals-value {
	font-size: 18px;
	font-weight: 800;
	color: var(--wsc-ink);
}

.wsc-drawer__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 16px 18px;
	border: 0;
	border-radius: 6px;
	background: var(--wsc-accent);
	color: var(--wsc-accent-text);
	font-size: 15.5px;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.18s ease, transform 0.12s ease;
}

.wsc-drawer__checkout:hover,
.wsc-drawer__checkout:focus-visible {
	background: var(--wsc-accent);
	color: var(--wsc-accent-text);
	filter: brightness(0.94);
	text-decoration: none;
}

.wsc-drawer__checkout:active {
	transform: translateY(1px);
}

/* Empty state -------------------------------------------------------- */
.wsc-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 60px 20px;
	text-align: center;
	color: var(--wsc-muted);
}

.wsc-empty__icon {
	color: #c3ccc8;
}

.wsc-empty__text {
	margin: 0;
	font-size: 15px;
}

.wsc-empty__button {
	display: inline-block;
	padding: 11px 20px;
	border-radius: 6px;
	background: var(--wsc-header-bg);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.wsc-empty__button:hover {
	color: #fff;
	filter: brightness(1.12);
	text-decoration: none;
}

/* States ------------------------------------------------------------- */
.wsc-drawer.is-busy .wsc-drawer__items,
.wsc-drawer.is-busy .wsc-drawer__summary {
	opacity: 0.55;
	pointer-events: none;
}

.wsc-drawer.is-busy .wsc-drawer__items {
	overflow-y: hidden;
}

/* Add-to-cart button while a request is in flight */
.wsc-busy {
	opacity: 0.65;
	cursor: progress;
	pointer-events: none;
}

body.wsc-locked {
	overflow: hidden !important;
}

/* Responsive --------------------------------------------------------- */
@media (max-width: 480px) {
	.wsc-drawer {
		--wsc-panel-width: 100%;
	}

	.wsc-drawer__header {
		padding: 16px 18px;
	}

	.wsc-drawer__items,
	.wsc-drawer__summary {
		padding-left: 18px;
		padding-right: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wsc-drawer__panel,
	.wsc-drawer__overlay,
	.wsc-progress__bar {
		transition: none;
	}
}
