:root {
	--alsafa-cart-blue: #0b74b5;
	--alsafa-cart-navy: #103d60;
	--alsafa-cart-red: #c82333;
	--alsafa-cart-border: #dbe5ec;
	--alsafa-cart-muted: #5d6d78;
}

.alsafa-floating-cart-trigger {
	position: fixed;
	z-index: 9998;
	left: 22px;
	bottom: 24px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 56px;
	padding: 0 14px;
	border: 0;
	border-radius: 18px;
	background: var(--alsafa-cart-navy);
	color: #fff;
	font: inherit;
	font-weight: 800;
	box-shadow: 0 15px 40px rgba(16, 61, 96, 0.24);
	cursor: pointer;
	transition: transform 180ms ease, background 180ms ease;
}

.alsafa-floating-cart-trigger:hover,
.alsafa-floating-cart-trigger:focus-visible {
	transform: translateY(-3px);
	background: var(--alsafa-cart-blue);
}

.alsafa-floating-cart-trigger svg {
	width: 25px;
	height: 25px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.alsafa-floating-cart-trigger b {
	display: grid;
	place-items: center;
	min-width: 25px;
	height: 25px;
	padding: 0 5px;
	border-radius: 99px;
	background: var(--alsafa-cart-red);
	color: #fff;
	font-size: 0.75rem;
}

.alsafa-floating-cart-layer {
	position: fixed;
	z-index: 10020;
	inset: 0;
}

.alsafa-floating-cart-layer[hidden] {
	display: none;
}

.alsafa-floating-cart-backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: rgba(5, 26, 43, 0.54);
	cursor: pointer;
}

.alsafa-floating-cart-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	width: min(460px, 100%);
	flex-direction: column;
	outline: 0;
	background: #fff;
	box-shadow: 20px 0 60px rgba(5, 26, 43, 0.18);
	animation: alsafa-cart-panel-in 220ms ease-out;
}

.alsafa-floating-cart-panel > header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 20px;
	border-bottom: 1px solid var(--alsafa-cart-border);
}

.alsafa-floating-cart-panel header span {
	color: var(--alsafa-cart-red);
	font-size: 0.78rem;
	font-weight: 800;
}

.alsafa-floating-cart-panel h2 {
	margin: 2px 0 0;
	color: var(--alsafa-cart-navy);
	font-size: 1.45rem;
}

.alsafa-floating-cart-close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--alsafa-cart-border);
	border-radius: 50%;
	background: #fff;
	color: var(--alsafa-cart-navy);
	font-size: 1.65rem;
	cursor: pointer;
}

.alsafa-floating-cart-message {
	min-height: 0;
	padding: 0 20px;
	color: #176b3a;
	font-size: 0.85rem;
	font-weight: 700;
}

.alsafa-floating-cart-message:not(:empty) {
	padding-block: 10px;
	background: #edf9f2;
}

.alsafa-floating-cart-message.is-error {
	background: #fff0f1;
	color: #9a1824;
}

.alsafa-floating-cart-items {
	flex: 1;
	overflow: auto;
	padding: 4px 20px;
}

.alsafa-floating-cart-item {
	display: grid;
	grid-template-columns: 78px 1fr;
	gap: 13px;
	padding: 16px 0;
	border-bottom: 1px solid var(--alsafa-cart-border);
}

.alsafa-floating-cart-item img {
	width: 78px;
	height: 78px;
	padding: 4px;
	border-radius: 13px;
	background: #f4f8fb;
	object-fit: contain;
}

.alsafa-floating-cart-item > div {
	display: grid;
	align-content: start;
	gap: 5px;
	min-width: 0;
}

.alsafa-floating-cart-item a {
	overflow: hidden;
	color: var(--alsafa-cart-navy);
	font-weight: 800;
	line-height: 1.45;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.alsafa-floating-cart-item strong {
	color: var(--alsafa-cart-red);
	font-size: 0.9rem;
}

.alsafa-floating-cart-item-actions {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 4px;
}

.alsafa-floating-cart-item-actions button,
.alsafa-floating-cart-item-actions span {
	display: grid;
	place-items: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border: 1px solid var(--alsafa-cart-border);
	border-radius: 9px;
	background: #fff;
	color: var(--alsafa-cart-navy);
	font: inherit;
	font-weight: 800;
}

.alsafa-floating-cart-item-actions button {
	cursor: pointer;
}

.alsafa-floating-cart-item-actions button:last-child {
	margin-inline-start: auto;
	border-color: transparent;
	color: var(--alsafa-cart-red);
	font-size: 0.78rem;
}

.alsafa-floating-cart-empty {
	display: grid;
	place-items: center;
	min-height: 280px;
	color: var(--alsafa-cart-muted);
	text-align: center;
}

.alsafa-floating-cart-empty span {
	font-size: 2.5rem;
}

.alsafa-floating-cart-empty strong {
	margin-top: 8px;
	color: var(--alsafa-cart-navy);
	font-size: 1.2rem;
}

.alsafa-floating-cart-empty p {
	max-width: 280px;
	margin: 5px 0;
}

.alsafa-floating-cart-panel > footer {
	padding: 18px 20px max(18px, env(safe-area-inset-bottom));
	border-top: 1px solid var(--alsafa-cart-border);
	background: #fff;
}

.alsafa-floating-cart-panel footer > div {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 13px;
}

.alsafa-floating-cart-panel footer strong {
	color: var(--alsafa-cart-red);
	font-size: 1.12rem;
}

.alsafa-floating-cart-checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	border-radius: 13px;
	background: var(--alsafa-cart-blue);
	color: #fff !important;
	font-weight: 800;
	text-decoration: none;
}

.alsafa-floating-cart-continue {
	display: block;
	margin: 10px auto 0;
	border: 0;
	background: transparent;
	color: var(--alsafa-cart-blue);
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}

body.alsafa-cart-is-open {
	overflow: hidden;
}

@keyframes alsafa-cart-panel-in {
	from { transform: translateX(-100%); }
}

@media (max-width: 767px) {
	.alsafa-floating-cart-trigger {
		display: none;
	}

	.alsafa-floating-cart-panel {
		top: auto;
		right: 0;
		bottom: 0;
		width: 100%;
		max-height: 86vh;
		border-radius: 24px 24px 0 0;
		animation-name: alsafa-cart-sheet-in;
	}

	.alsafa-mobile-nav {
		position: fixed;
		z-index: 9997;
		right: 0;
		bottom: 0;
		left: 0;
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		min-height: 64px;
		padding-bottom: env(safe-area-inset-bottom);
		border-top: 1px solid var(--alsafa-cart-border);
		background: rgba(255, 255, 255, 0.98);
		box-shadow: 0 -8px 24px rgba(16, 61, 96, 0.1);
	}

	.alsafa-mobile-nav-link {
		position: relative;
		display: grid;
		place-items: center;
		align-content: center;
		gap: 2px;
		min-height: 64px;
		color: var(--alsafa-cart-muted);
		font-size: 0.68rem;
		text-decoration: none;
	}

	.alsafa-mobile-icon {
		width: 23px;
		height: 23px;
		fill: none;
		stroke: currentColor;
		stroke-linecap: round;
		stroke-linejoin: round;
		stroke-width: 1.8;
	}

	.alsafa-mobile-nav-link b {
		position: absolute;
		top: 5px;
		right: calc(50% - 18px);
	}
}

@keyframes alsafa-cart-sheet-in {
	from { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
	.alsafa-floating-cart-trigger,
	.alsafa-floating-cart-panel {
		animation: none;
		transition: none;
	}
}
