/* ─── Cart Drawer — Glassmorphism Dark ───────────────────────────────────── */

.fidyat-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 9998;
	pointer-events: none;
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */

.fidyat-cart-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 8, 20, 0.65);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* ── Panel ────────────────────────────────────────────────────────────────── */

.fidyat-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: min(420px, 100vw);
	height: 100%;
	display: flex;
	flex-direction: column;

	/* Glass base */
	background:
		linear-gradient(160deg, rgba(149, 146, 255, 0.12) 0%, rgba(14, 14, 36, 0.00) 60%),
		rgba(14, 14, 36, 0.92);
	backdrop-filter: blur(32px) saturate(180%);
	-webkit-backdrop-filter: blur(32px) saturate(180%);

	/* Glass border — left edge glow */
	border-left: 1px solid rgba(149, 146, 255, 0.22);
	box-shadow:
		-8px 0 60px rgba(0, 0, 0, 0.55),
		inset 1px 0 0 rgba(255, 255, 255, 0.04);

	transform: translateX(100%);
	transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Open state ───────────────────────────────────────────────────────────── */

.fidyat-cart-drawer[aria-hidden="false"] {
	pointer-events: auto;
}

.fidyat-cart-drawer[aria-hidden="false"] .fidyat-cart-drawer__overlay {
	opacity: 1;
}

.fidyat-cart-drawer[aria-hidden="false"] .fidyat-cart-drawer__panel {
	transform: translateX(0);
}

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

/* ── Header ───────────────────────────────────────────────────────────────── */

.fidyat-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 18px;
	border-bottom: 1px solid rgba(149, 146, 255, 0.14);
	flex-shrink: 0;
	background: linear-gradient(180deg, rgba(149, 146, 255, 0.08) 0%, transparent 100%);
}

.fidyat-cart-drawer__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.01em;
	display: flex;
	align-items: center;
	gap: 10px;
}

.fidyat-cart-drawer__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--gradient-main, radial-gradient(circle at 50% 50%, #7875F8, #504CEE));
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(80, 76, 238, 0.5);
}

.fidyat-cart-drawer__count[hidden] { display: none; }

.fidyat-cart-drawer__close {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(149, 146, 255, 0.2);
	background: rgba(149, 146, 255, 0.08);
	border-radius: 50%;
	cursor: pointer;
	color: rgba(215, 214, 255, 0.7);
	transition: background 0.18s, border-color 0.18s, color 0.18s;
	flex-shrink: 0;
}

.fidyat-cart-drawer__close:hover {
	background: rgba(149, 146, 255, 0.18);
	border-color: rgba(149, 146, 255, 0.45);
	color: #fff;
}

/* ── Body / Scrollable items ──────────────────────────────────────────────── */

.fidyat-cart-drawer__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(149, 146, 255, 0.25) transparent;
}

.fidyat-cart-drawer__body::-webkit-scrollbar { width: 4px; }
.fidyat-cart-drawer__body::-webkit-scrollbar-track { background: transparent; }
.fidyat-cart-drawer__body::-webkit-scrollbar-thumb { background: rgba(149, 146, 255, 0.25); border-radius: 2px; }

.fidyat-cart-drawer__items {
	padding: 8px 0;
}

/* ── Cart items (custom mini-cart template) ───────────────────────────────── */

.fidyat-cart-item {
	display: grid;
	grid-template-columns: 72px 1fr 28px;
	gap: 0 12px;
	align-items: start;
	padding: 16px 20px;
	border-bottom: 1px solid rgba(149, 146, 255, 0.08);
	transition: background 0.15s;
	position: relative;
}

.fidyat-cart-item:last-child { border-bottom: none; }

.fidyat-cart-item:hover { background: rgba(149, 146, 255, 0.05); }

/* Thumbnail */
.fidyat-cart-item__thumb {
	width: 72px;
	height: 72px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgba(149, 146, 255, 0.18);
	flex-shrink: 0;
}

.fidyat-cart-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Details column */
.fidyat-cart-item__details {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.fidyat-cart-item__name {
	font-size: 0.85rem;
	font-weight: 600;
	color: rgba(215, 214, 255, 0.9);
	text-decoration: none;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.15s;
}

.fidyat-cart-item__name:hover { color: #fff; }

.fidyat-cart-item__unit-price {
	font-size: 0.78rem;
	color: rgba(215, 214, 255, 0.45);
}

/* Bottom row: qty controls + subtotal */
.fidyat-cart-item__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 6px;
}

/* Qty stepper */
.fidyat-cart-item__qty {
	display: flex;
	align-items: center;
	gap: 0;
	background: rgba(149, 146, 255, 0.08);
	border: 1px solid rgba(149, 146, 255, 0.18);
	border-radius: 8px;
	overflow: hidden;
}

.fidyat-qty-btn {
	width: 28px;
	height: 28px;
	background: none;
	border: none;
	color: rgba(215, 214, 255, 0.7);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
	flex-shrink: 0;
}

.fidyat-qty-btn:hover:not(:disabled) {
	background: rgba(149, 146, 255, 0.18);
	color: #fff;
}

.fidyat-qty-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.fidyat-qty-val {
	min-width: 26px;
	width: 36px;
	text-align: center;
	font-size: 0.82rem;
	font-weight: 700;
	color: rgba(215, 214, 255, 0.9);
	background: none;
	border: none;
	outline: none;
	padding: 0;
	-moz-appearance: textfield;
}

.fidyat-qty-val::-webkit-outer-spin-button,
.fidyat-qty-val::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.fidyat-qty-val:focus {
	background: rgba(149, 146, 255, 0.12);
	border-radius: 4px;
}

/* Subtotal */
.fidyat-cart-item__subtotal {
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
}

.fidyat-cart-item__subtotal .woocommerce-Price-amount { color: inherit; }

/* Remove button */
.fidyat-cart-item__remove {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(149, 146, 255, 0.06);
	border: 1px solid rgba(149, 146, 255, 0.15);
	border-radius: 6px;
	cursor: pointer;
	color: rgba(215, 214, 255, 0.4);
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	flex-shrink: 0;
	align-self: start;
	margin-top: 2px;
}

.fidyat-cart-item__remove:hover {
	background: rgba(220, 53, 69, 0.18);
	border-color: rgba(220, 53, 69, 0.45);
	color: #ff6b7a;
}

/* Loading state */
.fidyat-cart-item.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Empty state */
.fidyat-cart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 24px;
	gap: 14px;
	color: rgba(215, 214, 255, 0.45);
	text-align: center;
}

.fidyat-cart-empty p {
	font-size: 0.9rem;
	margin: 0;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.fidyat-cart-drawer__footer {
	flex-shrink: 0;
	padding: 20px 24px;
	border-top: 1px solid rgba(149, 146, 255, 0.14);
	background:
		linear-gradient(0deg, rgba(80, 76, 238, 0.08) 0%, transparent 100%),
		rgba(8, 8, 20, 0.4);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.fidyat-cart-drawer__totals {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.fidyat-cart-drawer__totals-label {
	font-size: 0.9rem;
	font-weight: 600;
	color: rgba(215, 214, 255, 0.7);
	letter-spacing: 0.02em;
}

.fidyat-cart-drawer__total {
	font-size: 1.25rem;
	font-weight: 800;
	color: #fff;
	letter-spacing: -0.01em;
}

.fidyat-cart-drawer__total .woocommerce-Price-amount {
	color: inherit;
}

/* Checkout button */
.fidyat-cart-drawer__checkout {
	width: 100%;
	justify-content: center;
	gap: 10px;
	padding: 15px 20px;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	border-radius: var(--radius-md, 1rem);
	background: var(--gradient-main, radial-gradient(circle at 50% 50%, #7875F8, #504CEE));
	box-shadow: 0 4px 20px rgba(80, 76, 238, 0.45);
	transition: box-shadow 0.2s, transform 0.15s, filter 0.2s;
}

.fidyat-cart-drawer__checkout:hover {
	filter: brightness(1.1);
	box-shadow: 0 6px 28px rgba(80, 76, 238, 0.6);
	transform: translateY(-1px);
}

.fidyat-cart-drawer__checkout:active {
	transform: translateY(0);
}

/* ── Cart trigger button (header) — match user-btn style ─────────────────── */

.fidyat-header__cart-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	padding: var(--space-1, 4px);
	color: var(--color-text-muted, rgba(215, 214, 255, 0.65));
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-radius: var(--radius-pill, 999px);
	transition: color var(--motion-fast, 0.15s), background var(--motion-fast, 0.15s);
	position: relative;
}

.fidyat-header__cart-btn:hover,
.fidyat-header__cart-btn:focus-visible {
	color: var(--color-lite, #504CEE);
	background: rgba(80, 76, 238, 0.10);
}

/* Badge */
.fidyat-cart-icon__badge {
	position: absolute;
	top: -3px;
	left: -3px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: var(--gradient-main, radial-gradient(circle at 50% 50%, #7875F8, #504CEE));
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	pointer-events: none;
	box-shadow: 0 1px 6px rgba(80, 76, 238, 0.55);
}

.fidyat-cart-icon__badge[hidden] { display: none; }
