/**
 * Side Cart Styles
 * Premium sliding cart drawer with thresholds, animations, and effects
 *
 * @package Onviqa
 * @since 1.0.0
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
	--ksq-cart-width: 550px;
	--ksq-cart-width-mobile: 100%;
	--ksq-cart-bg: #FFFFFF;
	--ksq-cart-overlay-bg: rgba(0, 0, 0, var(--ksq-overlay-opacity, 0.5));
	--ksq-primary: #FF5100;
	--ksq-primary-hover: #E54900;
	--ksq-success: #00B67B;
	--ksq-success-light: #008000;
	--ksq-gray-100: #F5F6FA;
	--ksq-gray-200: #E6E9F0;
	--ksq-gray-300: #DDDDDD;
	--ksq-gray-400: #888888;
	--ksq-gray-500: #666666;
	--ksq-gray-600: #505050;
	--ksq-gray-700: #444444;
	--ksq-gray-800: #222222;
	--ksq-gray-900: #000000;
	--ksq-marquee-bg: #FFFBF4;
	--ksq-marquee-border: #DFDDD9;
	--ksq-marquee-text: #4A3106;
	--ksq-font-main: 'Roboto Flex', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--ksq-font-serif: 'DM Serif Display', Georgia, serif;
	--ksq-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	--ksq-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Overlay
   ======================================== */
.ksq-side-cart-overlay {
	position: fixed;
	inset: 0;
	background: var(--ksq-cart-overlay-bg);
	opacity: 0;
	visibility: hidden;
	z-index: 99998;
	transition: opacity 0.4s ease, visibility 0.4s ease;
	backdrop-filter: blur(2px);
}

.ksq-side-cart-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* ========================================
   Confetti Canvas
   ======================================== */
.ksq-confetti-canvas {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 100001;
}

/* ========================================
   Side Cart Drawer
   ======================================== */
.ksq-side-cart {
	position: fixed;
	top: 0;
	right: 0;
	width: var(--ksq-cart-width);
	max-width: 100%;
	height: 100vh;
	height: 100dvh;
	background: var(--ksq-cart-bg);
	box-shadow: var(--ksq-shadow-lg);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	overflow: hidden;
}

.ksq-side-cart.open {
	transform: translateX(0);
}

@media (max-width: 600px) {
	.ksq-side-cart {
		width: var(--ksq-cart-width-mobile);
	}
}

/* ========================================
   Header
   ======================================== */
.ksq-side-cart__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px 18px 32px;
	min-height: 68px;
	box-sizing: border-box;
	background: var(--ksq-cart-bg);
	border-bottom: 1px solid var(--ksq-gray-300);
	flex-shrink: 0;
}

.ksq-side-cart__title-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ksq-side-cart__title {
	margin: 0;
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 24px;
	line-height: 28px;
	color: var(--ksq-gray-900);
}

.ksq-side-cart__count {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	background: var(--ksq-primary);
	color: #FFFFFF;
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 18px;
	border-radius: 20px;
}

.ksq-side-cart__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: var(--ksq-transition);
	color: var(--ksq-gray-900);
}

.ksq-side-cart__close:hover {
	background: var(--ksq-gray-900);
	color: #FFFFFF;
}

.ksq-side-cart__close svg {
	width: 32px;
	height: 32px;
}

/* ========================================
   Achievement Thresholds
   ======================================== */
.ksq-side-cart__thresholds {
	position: relative;
	padding: 20px;
	background: var(--ksq-gray-100);
	border-bottom: 1px solid var(--ksq-gray-200);
	flex-shrink: 0;
	overflow: hidden;
}

.ksq-thresholds__confetti-bg {
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Ccircle cx='10' cy='20' r='2' fill='%23FFD700' opacity='0.6'/%3E%3Ccircle cx='50' cy='40' r='1.5' fill='%23FF6B6B' opacity='0.5'/%3E%3Ccircle cx='80' cy='15' r='2' fill='%2300B67B' opacity='0.4'/%3E%3Ccircle cx='30' cy='70' r='1' fill='%23FF5100' opacity='0.5'/%3E%3Ccircle cx='90' cy='80' r='1.5' fill='%23FFD700' opacity='0.6'/%3E%3Ccircle cx='15' cy='90' r='2' fill='%23FF6B6B' opacity='0.4'/%3E%3C/g%3E%3C/svg%3E");
	opacity: 0.8;
	pointer-events: none;
}

.ksq-thresholds__message {
	position: relative;
	text-align: center;
	font-family: var(--ksq-font-main);
	font-weight: 500;
	font-size: 16px;
	line-height: 19px;
	color: var(--ksq-gray-900);
	margin: 0 0 20px;
}

.ksq-thresholds__track {
	position: relative;
}

.ksq-thresholds__progress-bar {
	position: relative;
	height: 4px;
	background: #CCCCCC;
	border-radius: 30px;
	overflow: visible;
}

.ksq-thresholds__progress-fill {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	background: #00B67B;
	border-radius: 10px;
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ksq-thresholds__progress-fill.animate {
	animation: ksq-progress-pulse 0.5s ease-out;
}

@keyframes ksq-progress-pulse {
	0%, 100% { transform: scaleY(1); }
	50% { transform: scaleY(1.5); }
}

.ksq-thresholds__markers {
	display: flex;
	justify-content: space-between;
	position: relative;
	margin-top: -12px;
}

.ksq-thresholds__marker {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	flex: 1;
	max-width: 140px;
}

.ksq-thresholds__marker-icon {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #FFFFFF;
	border: 1.5px solid #888888;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #888888;
	transition: var(--ksq-transition);
	flex-shrink: 0;
}

.ksq-thresholds__marker-icon svg {
	width: 13px;
	height: 10px;
}

.ksq-thresholds__marker.unlocked .ksq-thresholds__marker-icon {
	border-color: #00B67B;
	border-width: 2px;
	color: #00B67B;
}

.ksq-thresholds__marker.unlocked .ksq-thresholds__marker-icon svg {
	animation: ksq-checkmark-pop 0.4s ease-out;
}

@keyframes ksq-checkmark-pop {
	0% { transform: scale(0); }
	60% { transform: scale(1.3); }
	100% { transform: scale(1); }
}

.ksq-thresholds__marker-label {
	font-family: 'Roboto Flex', var(--ksq-font-main);
	font-weight: 400;
	font-size: 14px;
	line-height: 16px;
	text-align: center;
	text-transform: capitalize;
	color: #000000;
	max-width: 140px;
	min-height: 32px;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.ksq-thresholds__marker:not(.unlocked) .ksq-thresholds__marker-label {
	color: #666666;
}

/* ========================================
   Cart Body
   ======================================== */
.ksq-side-cart__body {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0;
	-webkit-overflow-scrolling: touch;
	min-height: 0; /* Important for flex scroll */
}

/* Custom Scrollbar */
.ksq-side-cart__body::-webkit-scrollbar {
	width: 6px;
}

.ksq-side-cart__body::-webkit-scrollbar-track {
	background: transparent;
}

.ksq-side-cart__body::-webkit-scrollbar-thumb {
	background: var(--ksq-gray-300);
	border-radius: 3px;
}

.ksq-side-cart__body::-webkit-scrollbar-thumb:hover {
	background: var(--ksq-gray-400);
}

/* ========================================
   Empty Cart
   ======================================== */
.ksq-side-cart__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 80px 32px 60px;
	text-align: center;
	flex: 1;
}

.ksq-side-cart__empty-icon {
	margin-bottom: 28px;
}

.ksq-side-cart__empty-title {
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 20px;
	line-height: 24px;
	color: var(--ksq-gray-900);
	margin: 0 0 8px;
}

.ksq-side-cart__empty-subtitle {
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 14px;
	line-height: 18px;
	color: var(--ksq-gray-400);
	margin: 0 0 32px;
}

.ksq-side-cart__continue-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 40px;
	background: var(--ksq-primary);
	color: #FFFFFF;
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 16px;
	line-height: 19px;
	text-decoration: none;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: var(--ksq-transition);
}

.ksq-side-cart__continue-btn:hover {
	background: var(--ksq-primary-hover);
	color: #FFFFFF;
}

/* ========================================
   Cart Items
   ======================================== */
.ksq-side-cart__items {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px 20px 0;
}

.ksq-cart-item {
	display: flex;
	gap: 20px;
	padding: 0;
	position: relative;
	animation: ksq-item-slide-in 0.3s ease-out;
}

@keyframes ksq-item-slide-in {
	from {
		opacity: 0;
		transform: translateX(20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.ksq-cart-item.removing {
	animation: ksq-item-slide-out 0.3s ease-out forwards;
}

@keyframes ksq-item-slide-out {
	from {
		opacity: 1;
		transform: translateX(0);
	}
	to {
		opacity: 0;
		transform: translateX(20px);
	}
}

.ksq-cart-item__image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 12px;
	overflow: hidden;
	background: var(--ksq-gray-100);
}

.ksq-cart-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ksq-cart-item--free-gift .ksq-cart-item__image {
	border: 2px solid var(--ksq-success);
}

.ksq-cart-item__details {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 20px;
}

.ksq-cart-item__name-group {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ksq-cart-item__name {
	margin: 0;
	font-family: var(--ksq-font-main);
	font-weight: 500;
	font-size: 16px;
	line-height: 19px;
	text-transform: capitalize;
	color: var(--ksq-gray-900);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ksq-cart-item__name a {
	color: inherit;
	text-decoration: none;
}

.ksq-cart-item__name a:hover {
	color: var(--ksq-primary);
}

.ksq-cart-item__qty {
	font-weight: 400;
	font-size: 13px;
	color: #999;
	margin-left: 4px;
}

.ksq-cart-item__variant {
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 13px;
	line-height: 16px;
	color: #888888;
	text-transform: capitalize;
}

/* Free Gift Badge */
.ksq-cart-item__gift-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 12px;
	background: linear-gradient(135deg, #00B67B 0%, #00a06d 100%);
	color: #fff;
	font-family: var(--ksq-font-main);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 4px;
}

.ksq-cart-item__variation {
	display: none;
}

.ksq-cart-item__bottom-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ksq-cart-item__price-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.ksq-cart-item__price {
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 18px;
	line-height: 21px;
	color: var(--ksq-gray-900);
}

.ksq-cart-item__price--free {
	color: var(--ksq-success-light);
	text-transform: capitalize;
}

.ksq-cart-item__price--original {
	font-weight: 400;
	color: var(--ksq-gray-400);
	text-decoration: line-through;
}

.ksq-cart-item--free-gift .ksq-cart-item__price-row {
	gap: 12px;
}

.ksq-cart-item__savings {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	margin-left: 8px;
	padding: 4px 12px;
	background: #FFA033;
	border-radius: 60px;
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 12px;
	line-height: 14px;
	color: #4E2104;
	white-space: nowrap;
}

.ksq-cart-item__actions {
	flex-shrink: 0;
}

.ksq-cart-item__remove {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--ksq-gray-800);
	font-family: var(--ksq-font-main);
	font-weight: 500;
	font-size: 14px;
	line-height: 16px;
	white-space: nowrap;
	transition: var(--ksq-transition);
}

.ksq-cart-item__remove:hover {
	color: #DC2626;
}

.ksq-cart-item__remove svg {
	width: 20px;
	height: 20px;
}

.ksq-cart-item__divider {
	height: 0;
	border-top: 1px solid var(--ksq-gray-300);
	background: none;
}

.ksq-cart-item__divider:last-child {
	display: none;
}

/* ========================================
   Upsells Section
   ======================================== */
.ksq-side-cart__upsells {
	padding: 20px 24px;
	border-top: 1px solid var(--ksq-gray-300);
	margin-top: 8px;
}

/* Recently Viewed in Empty Cart State - stick to bottom */
.ksq-side-cart__body:has(.ksq-side-cart__empty) {
	display: flex;
	flex-direction: column;
}

.ksq-side-cart__body .ksq-side-cart__empty {
	flex-shrink: 0;
}

.ksq-side-cart__body .ksq-side-cart__recently-viewed {
	margin-top: auto;
	border-top: none;
}

.ksq-upsells__title {
	margin: 0 0 16px;
	font-family: var(--ksq-font-serif);
	font-weight: 400;
	font-size: 20px;
	line-height: 27px;
	color: var(--ksq-gray-900);
}

/* Recommendations Section (Sticky Footer Position) */
.ksq-side-cart__recommendations {
	background: var(--ksq-gray-100);
	padding: 16px 20px;
	border-top: 1px solid var(--ksq-gray-200);
	border-bottom: 1px solid var(--ksq-gray-200);
	flex-shrink: 0;
}

.ksq-recommendations__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.ksq-recommendations__title {
	margin: 0;
	font-family: var(--ksq-font-serif);
	font-style: italic;
	font-weight: 400;
	font-size: 20px;
	line-height: 27px;
	color: #111111;
}

.ksq-recommendations__dots {
	display: flex;
	align-items: center;
	gap: 4px;
}

.ksq-recommendations__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #D9D9D9;
	transition: background 0.3s ease;
}

.ksq-recommendations__dot.active {
	background: var(--ksq-primary);
}

.ksq-recommendations__slider {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 0;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	/* Enable touch scrolling */
	touch-action: pan-x pan-y;
	overscroll-behavior-x: contain;
	cursor: grab;
	user-select: none;
}

.ksq-recommendations__slider.dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

.ksq-recommendations__slider::-webkit-scrollbar {
	display: none;
}

.ksq-recommendations__slider .ksq-upsell-card {
	scroll-snap-align: start;
}

.ksq-upsells__slider {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 8px;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
	/* Enable touch scrolling */
	touch-action: pan-x pan-y;
	overscroll-behavior-x: contain;
	cursor: grab;
	user-select: none;
}

.ksq-upsells__slider.dragging {
	cursor: grabbing;
	scroll-snap-type: none;
}

.ksq-upsells__slider::-webkit-scrollbar {
	display: none;
}

.ksq-upsell-card {
	flex-shrink: 0;
	width: 388px;
	scroll-snap-align: start;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	background: #FFFFFF;
	border: 1px solid var(--ksq-gray-300);
	border-radius: 12px;
	position: relative;
}

@media (max-width: 600px) {
	.ksq-upsell-card {
		width: auto;
		min-width: 240px;
		max-width: 280px;
		gap: 8px;
		padding: 8px;
	}
}

.ksq-upsell-card__image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
	background: #111111;
}

.ksq-upsell-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ksq-upsell-card__content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ksq-upsell-card__name {
	margin: 0;
	font-family: var(--ksq-font-main);
	font-weight: 500;
	font-size: 16px;
	line-height: 20px;
	text-transform: capitalize;
	color: var(--ksq-gray-900);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ksq-upsell-card__name a {
	color: inherit;
	text-decoration: none;
}

.ksq-upsell-card__name a:hover {
	color: var(--ksq-primary);
}

.ksq-upsell-card__price {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ksq-upsell-card__price-current {
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 18px;
	line-height: 21px;
	color: var(--ksq-primary);
}

.ksq-upsell-card__price-original {
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 18px;
	line-height: 21px;
	text-decoration: line-through;
	color: var(--ksq-gray-400);
}

.ksq-upsell-card__add {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 20px;
	background: var(--ksq-primary);
	border: none;
	border-radius: 32px;
	cursor: pointer;
	color: #FFFFFF;
	font-family: var(--ksq-font-main);
	font-weight: 500;
	font-size: 16px;
	line-height: 19px;
	text-transform: capitalize;
	transition: var(--ksq-transition);
}

.ksq-upsell-card__add:hover {
	background: var(--ksq-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(255, 81, 0, 0.3);
}

.ksq-upsell-card__add.loading {
	opacity: 0.7;
	pointer-events: none;
}

.ksq-upsell-card__add.loading svg {
	animation: ksq-spin 1s linear infinite;
}

.ksq-upsell-card__add svg {
	width: 10px;
	height: 10px;
	flex-shrink: 0;
}

@keyframes ksq-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* ========================================
   Trust Marquee
   ======================================== */
.ksq-side-cart__marquee {
	background: #FFFBF4;
	border-top: 1px solid #DFDDD9;
	border-bottom: 1px solid #DFDDD9;
	overflow: hidden;
	flex-shrink: 0;
}

.ksq-marquee__track {
	display: flex;
	height: 52px;
	align-items: center;
}

.ksq-marquee__content {
	display: flex;
	align-items: center;
	gap: 0;
	animation: ksq-marquee-scroll 25s linear infinite;
	white-space: nowrap;
}

@keyframes ksq-marquee-scroll {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

.ksq-marquee__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 16px;
	flex-shrink: 0;
}

.ksq-marquee__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ksq-marquee__icon svg {
	width: 28px;
	height: 28px;
	color: #4A3106;
}

.ksq-marquee__text {
	font-family: var(--ksq-font-main);
	font-weight: 500;
	font-size: 16px;
	line-height: 19px;
	color: #4A3106;
	white-space: nowrap;
}

.ksq-marquee__dot {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0 4px;
}

.ksq-marquee__dot svg {
	width: 8px;
	height: 8px;
	color: #DFDDD9;
}

/* ========================================
   Footer (Sticky at Bottom)
   ======================================== */
.ksq-side-cart__footer {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 20px 20px;
	background: #FFFFFF;
	border-top: 1px solid var(--ksq-gray-200);
	flex-shrink: 0;
}

.ksq-side-cart__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ksq-side-cart__subtotal-label {
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 20px;
	line-height: 23px;
	text-transform: capitalize;
	color: var(--ksq-gray-500);
}

.ksq-side-cart__subtotal-value {
	font-family: var(--ksq-font-main);
	font-weight: 700;
	font-size: 20px;
	line-height: 23px;
	color: var(--ksq-gray-900);
}

.ksq-side-cart__subtotal-value .woocommerce-Price-amount {
	font-weight: 700;
}

/* Coupon Information */
.ksq-side-cart__coupon-info {
	padding-bottom: 0;
	border-bottom: 1px solid var(--ksq-gray-200);
}

.ksq-side-cart__coupon-row,
.ksq-side-cart__discount-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.ksq-side-cart__coupon-row:last-child,
.ksq-side-cart__discount-row:last-child {
	margin-bottom: 0;
}

.ksq-side-cart__coupon-label,
.ksq-side-cart__discount-label {
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 16px;
	line-height: 19px;
	color: var(--ksq-gray-500);
}

.ksq-side-cart__coupon-code {
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 16px;
	line-height: 19px;
	color: var(--ksq-primary);
	text-transform: uppercase;
}

.ksq-side-cart__discount-value {
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 16px;
	line-height: 19px;
	color: #2CA003; /* Green for discount */
}

.ksq-side-cart__discount-value .woocommerce-Price-amount {
	font-weight: 600;
	color: #2CA003;
}

.ksq-side-cart__checkout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	height: 60px;
	padding: 0 24px;
	background: var(--ksq-primary);
	color: #FFFFFF;
	font-family: var(--ksq-font-main);
	font-weight: 600;
	font-size: 20px;
	line-height: 23px;
	text-decoration: none;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: var(--ksq-transition);
	flex-shrink: 0;
}

.ksq-side-cart__checkout-btn:hover,
.ksq-side-cart__checkout-btn:focus,
.ksq-side-cart__checkout-btn:active,
.ksq-side-cart__checkout-btn:visited {
	background: var(--ksq-primary-hover);
	color: #FFFFFF;
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(255, 81, 0, 0.3);
}

.ksq-side-cart__checkout-btn svg {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
}

.ksq-side-cart__checkout-btn.loading {
	pointer-events: none;
	cursor: not-allowed;
}

.ksq-side-cart__checkout-btn.loading svg {
	animation: ksq-icon-pulse 1.2s ease-in-out infinite;
}

@keyframes ksq-icon-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.5; transform: scale(1.15); }
}

.ksq-side-cart__payment-icons {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
}

.ksq-side-cart__payment-label {
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 14px;
	line-height: 16px;
	color: var(--ksq-gray-700);
	white-space: nowrap;
}

.ksq-side-cart__payment-icons img {
	max-height: 28px;
	width: auto;
}

.ksq-side-cart__payment-icons-list {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ksq-side-cart__payment-icons-list svg {
	border-radius: 4px;
	flex-shrink: 0;
}

/* ========================================
   Loading State
   ======================================== */
.ksq-side-cart.loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
}

.ksq-side-cart.loading .ksq-side-cart__body {
	opacity: 0.5;
	pointer-events: none;
}

/* ========================================
   Cart Count Badge (Header)
   ======================================== */
.ksq-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: var(--ksq-primary);
	color: #FFFFFF;
	font-size: 12px;
	font-weight: 600;
	border-radius: 10px;
	position: absolute;
	top: -8px;
	right: -8px;
}

/* ========================================
   Mobile Optimizations
   ======================================== */
@media (max-width: 600px) {

	/* --- Header --- */
	.ksq-side-cart__header {
		padding: 12px 16px;
		min-height: 52px;
	}

	.ksq-side-cart__title {
		font-size: 18px;
		line-height: 21px;
	}

	.ksq-side-cart__count {
		min-width: 28px;
		height: 28px;
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-side-cart__close {
		width: 28px;
		height: 28px;
		aspect-ratio: 1/1;
	}

	.ksq-side-cart__close svg {
		width: 28px;
		height: 28px;
	}

	/* --- Thresholds --- */
	.ksq-side-cart__thresholds {
		padding: 12px 16px;
		box-sizing: border-box;
	}

	.ksq-thresholds__message {
		font-size: 12px;
		line-height: 14px;
		margin-bottom: 12px;
	}

	.ksq-thresholds__progress-bar {
		height: 2px;
	}

	.ksq-thresholds__markers {
		margin-top: -10px;
	}

	.ksq-thresholds__marker-icon {
		width: 20px;
		height: 20px;
		border-width: 1.5px;
	}

	.ksq-thresholds__marker-icon svg {
		width: 11px;
		height: 7px;
	}

	.ksq-thresholds__marker.unlocked .ksq-thresholds__marker-icon {
		border-width: 1.5px;
	}

	.ksq-thresholds__marker-label {
		font-size: 10px;
		line-height: 12px;
		max-width: 80px;
		min-height: 24px;
	}

	/* --- Cart Items --- */
	.ksq-side-cart__items {
		padding: 16px 16px 0;
		gap: 16px;
	}

	.ksq-cart-item {
		gap: 16px;
		padding: 0;
	}

	.ksq-cart-item__image {
		width: 60px;
		height: 60px;
		border-radius: 8px;
	}

	.ksq-cart-item__name {
		font-size: 12px;
		line-height: 14px;
	}

	.ksq-cart-item__variant {
		font-size: 11px;
		line-height: 13px;
	}

	.ksq-cart-item__price {
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-cart-item__price--free {
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-cart-item__price--original {
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-cart-item__savings {
		font-size: 10px;
		line-height: 12px;
		padding: 2px 8px;
	}

	.ksq-cart-item__details {
		gap: 12px;
	}

	.ksq-cart-item__remove span {
		display: none;
	}

	.ksq-cart-item__remove {
		padding: 0;
	}

	/* --- Recommendations --- */
	.ksq-side-cart__recommendations {
		padding: 12px 16px;
	}

	.ksq-recommendations__title {
		font-size: 16px;
		line-height: 22px;
	}

	.ksq-recommendations__dot {
		width: 4px;
		height: 4px;
	}

	.ksq-upsell-card__image {
		width: 60px;
		height: 60px;
	}

	.ksq-upsell-card__content {
		gap: 8px;
	}

	.ksq-upsell-card__name {
		font-size: 12px;
		line-height: 14px;
	}

	.ksq-upsell-card__price-current {
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-upsell-card__price-original {
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-upsell-card__add {
		width: 24px;
		height: 24px;
		padding: 0;
		border-radius: 100px;
		right: 8px;
		bottom: 8px;
		font-size: 0;
		gap: 0;
	}

	.ksq-upsell-card__add span {
		display: none;
	}

	.ksq-upsell-card__add svg {
		width: 8px;
		height: 8px;
	}

	/* --- Trust Marquee --- */
	.ksq-side-cart__marquee {
		border-width: 1px 0;
		border-style: solid;
		border-color: #DFDDD9;
	}

	.ksq-marquee__track {
		height: 42px;
	}

	.ksq-marquee__icon svg {
		width: 17px;
		height: 17px;
	}

	.ksq-marquee__text {
		font-size: 12px;
		line-height: normal;
	}

	.ksq-marquee__item {
		gap: 8px;
		padding: 0 10px;
	}

	.ksq-marquee__dot svg {
		width: 5px;
		height: 5px;
	}

	/* --- Footer --- */
	.ksq-side-cart__footer {
		gap: 12px;
		padding: 16px;
	}

	.ksq-side-cart__subtotal-label {
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-side-cart__subtotal-value {
		font-size: 14px;
		line-height: 16px;
	}

	.ksq-side-cart__checkout-btn {
		height: 46px;
		font-size: 16px;
		line-height: 19px;
		border-radius: 8px;
		gap: 8px;
	}

	.ksq-side-cart__checkout-btn svg {
		width: 24px;
		height: 24px;
	}

	/* --- Upsells (in body) --- */
	.ksq-side-cart__upsells {
		padding: 12px 16px;
	}
}

/* ========================================
   Animations
   ======================================== */
.ksq-tada {
	animation: ksq-tada 1s ease-in-out;
}

@keyframes ksq-tada {
	0% { transform: scale(1); }
	10%, 20% { transform: scale(0.9) rotate(-3deg); }
	30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
	40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
	100% { transform: scale(1) rotate(0); }
}

/* Pulse animation for newly unlocked thresholds */
.ksq-pulse {
	animation: ksq-pulse 0.5s ease-out;
}

@keyframes ksq-pulse {
	0% { box-shadow: 0 0 0 0 rgba(0, 182, 123, 0.7); }
	70% { box-shadow: 0 0 0 15px rgba(0, 182, 123, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 182, 123, 0); }
}

/* ========================================
   Body Lock when Cart is Open
   ======================================== */
body.ksq-cart-open {
	overflow: hidden;
	position: relative;
}

body.ksq-cart-open::after {
	content: '';
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	z-index: 99997;
	pointer-events: none;
	animation: ksq-fade-in 0.3s ease-out;
}

@keyframes ksq-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Prevent body scroll on iOS */
body.ksq-cart-open {
	touch-action: none;
	-webkit-overflow-scrolling: auto;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
	.ksq-side-cart,
	.ksq-side-cart-overlay,
	.ksq-confetti-canvas {
		display: none !important;
	}
}

/* ========================================
   Potential Savings Banner
   ======================================== */
.ksq-side-cart__potential-savings {
	margin: 0;
}

.ksq-potential-savings__trigger {
	display: flex;
	align-items: center;
	width: 100%;
	background: #F0ECFF;
	border: 1px solid #6749E5;
	border-radius: 32px;
	cursor: pointer;
	transition: all 0.3s ease;
	height: 60px;
	padding: 0 8px 0 24px;
	gap: 10px;
}

.ksq-potential-savings__trigger:hover {
	border-color: #5538C8;
	box-shadow: 0px 4px 12px rgba(103, 73, 229, 0.2);
	transform: translateY(-1px);
}

.ksq-potential-savings__trigger:active {
	transform: translateY(0) scale(0.99);
}

.ksq-potential-savings__icon {
	display: none;
}

.ksq-potential-savings__text {
	flex: 1;
	font-family: var(--ksq-font-main);
	font-weight: 400;
	font-size: 18px;
	line-height: 21px;
	color: #444444;
	text-align: left;
}

.ksq-potential-savings__text .woocommerce-Price-amount {
	font-weight: 700;
	color: #6749E5;
}

.ksq-potential-savings__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--ksq-font-main);
	font-weight: 500;
	font-size: 16px;
	line-height: 19px;
	color: #FFFFFF;
	background: #6749E5;
	padding: 12px 20px;
	border-radius: 30px;
	transition: all 0.2s ease;
	flex-shrink: 0;
	white-space: nowrap;
	text-transform: capitalize;
}

.ksq-potential-savings__trigger:hover .ksq-potential-savings__cta {
	background: #5538C8;
}

.ksq-potential-savings__cta svg {
	width: 20px;
	height: 20px;
}

/* Popup styles are now handled by best-price.css (loaded globally).
   The side cart dynamically builds the popup using ksq-best-price-popup__* classes. */

/* ========================================
   Potential Savings - Mobile Trigger
   ======================================== */
@media (max-width: 600px) {
	.ksq-potential-savings__trigger {
		height: 42px;
		padding: 0 6px 0 16px;
		border-radius: 28px;
	}

	.ksq-potential-savings__text {
		font-size: 12px;
		line-height: 14px;
	}

	.ksq-potential-savings__cta {
		font-size: 12px;
		line-height: 14px;
		height: 30px;
		padding: 0 12px;
		gap: 4px;
		border-radius: 30px;
	}

	.ksq-potential-savings__cta svg {
		width: 16px;
		height: 16px;
	}
}

/* ========================================
   Potential Savings - Accessibility
   ======================================== */
.ksq-potential-savings__trigger:focus-visible {
	outline: 2px solid #8238BE;
	outline-offset: 2px;
}

/* ========================================
   Potential Savings - Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
	.ksq-potential-savings__trigger,
	.ksq-potential-savings__icon {
		transition: none;
		animation: none;
	}
}

