/* ============================================================
   Cart drawer (mini-cart) — Make Art
   Globally available; opens from header cart icon.
   ============================================================ */

#drawer-overlay {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, .4);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 998;
	opacity: 0;
	transition: opacity .25s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
#drawer-overlay.open { opacity: 1; }

.cart-drawer {
	position: fixed;
	top: 0; bottom: 0;
	/* LTR default: pinned to LEFT, slides in from off-screen-left */
	left: 0; right: auto;
	width: min(420px, 100vw);
	background: #fff;
	box-shadow: var(--shadow-lg);
	transform: translateX(-100%);
	transition: transform .3s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
	z-index: 999;
	display: flex; flex-direction: column;
	font-family: var(--sans);
	color: var(--ink);
	overflow: hidden;
}
/* RTL: pin to RIGHT edge, slide in from off-screen-right.
   `inset-inline-*` was unreliable here (translated to left:0 in some
   browser/locale combos so the drawer sat at the LEFT). Use explicit
   left/right + dir-scoped selector instead. */
[dir="rtl"] .cart-drawer,
.rtl .cart-drawer {
	left: auto; right: 0;
	transform: translateX(100%);
}
.cart-drawer.open { transform: translateX(0); }

/* Header */
.drawer-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid var(--line-soft);
	background: var(--bg-soft);
	flex-shrink: 0;
}
.drawer-title {
	font-family: var(--serif);
	font-size: 18px;
	font-weight: 700;
	color: var(--ink);
	display: flex; align-items: center; gap: 10px;
}
.drawer-count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 26px; height: 26px; padding: 0 8px;
	background: var(--orange);
	color: #fff;
	border-radius: var(--radius-full);
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 700;
}
.drawer-close {
	display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-full);
	color: var(--ink);
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.drawer-close:hover { background: var(--bg-soft); border-color: var(--ink-muted); transform: scale(1.05); }
.drawer-close:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Free-shipping nudge */
.drawer-shipping-bar {
	padding: 14px 22px;
	background: linear-gradient(135deg, var(--orange-light), #fdf6ec);
	border-bottom: 1px solid var(--line-soft);
	flex-shrink: 0;
}
.drawer-shipping-text {
	display: flex; align-items: center; justify-content: space-between;
	gap: 10px;
	font-size: 13px;
	color: var(--ink);
	margin-bottom: 8px;
}
.drawer-shipping-text .highlight { color: var(--orange); font-weight: 700; }
.shipping-track {
	height: 6px;
	background: rgba(255, 255, 255, .6);
	border-radius: var(--radius-full);
	overflow: hidden;
}
.shipping-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--orange) 0%, #f59658 100%);
	border-radius: var(--radius-full);
	transition: width .3s var(--ease-out, ease-out);
}

/* Items list — scrollable */
.drawer-items {
	flex: 1;
	overflow-y: auto;
	padding: 16px 22px;
	display: flex; flex-direction: column;
	gap: 14px;
	scrollbar-width: thin;
}
.drawer-items::-webkit-scrollbar { width: 6px; }
.drawer-items::-webkit-scrollbar-thumb {
	background: var(--line);
	border-radius: var(--radius-full);
}

.drawer-item {
	display: grid;
	grid-template-columns: 80px 1fr auto;
	grid-template-rows: auto;
	gap: 12px;
	padding: 12px;
	background: var(--bg-soft);
	border: 1px solid var(--line-soft);
	border-radius: var(--radius-lg);
	align-items: start;
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.drawer-item:hover {
	border-color: var(--orange);
	transform: translateY(-1px);
	box-shadow: var(--shadow-sm);
}

.drawer-item-img {
	position: relative;
	display: block;
	width: 80px; height: 80px;
	border-radius: var(--radius-md);
	background: #fff;
	border: 1px solid var(--line-soft);
	overflow: hidden;
	flex-shrink: 0;
}
.drawer-item-img img {
	width: 100%; height: 100%;
	object-fit: contain;
	background: var(--bg);
	display: block;
}
.drawer-item-badge {
	position: absolute;
	top: 4px;
	inset-inline-end: 4px;
	background: var(--ink);
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .04em;
	padding: 3px 6px;
	border-radius: var(--radius-sm);
	text-transform: uppercase;
}
.drawer-item-badge--custom {
	background: var(--orange);
}

.drawer-item-info {
	display: flex; flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.drawer-item-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--ink);
	text-decoration: none;
	transition: color .15s ease;
}
.drawer-item-name:hover { color: var(--orange); }
.drawer-item-eng {
	font-size: 12px;
	color: var(--orange);
	font-weight: 600;
	font-style: italic;
}
.drawer-item-meta {
	font-size: 11px;
	color: var(--ink-muted);
	letter-spacing: .02em;
}

.drawer-item-actions {
	display: flex; align-items: center; gap: 8px;
	margin-top: 4px;
}
.drawer-qty-ctrl {
	display: inline-flex;
	align-items: center;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius-full);
	overflow: hidden;
}
.drawer-qty-btn {
	width: 28px; height: 28px;
	background: transparent;
	border: 0;
	color: var(--ink-soft);
	font-size: 16px;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
	display: flex; align-items: center; justify-content: center;
}
.drawer-qty-btn:hover { background: var(--bg-soft); color: var(--ink); }
.drawer-qty-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.drawer-qty-btn:disabled { opacity: .5; cursor: not-allowed; }
.drawer-qty-val {
	min-width: 24px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink);
}
.drawer-item-remove {
	display: flex; align-items: center; justify-content: center;
	width: 28px; height: 28px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius-full);
	color: var(--ink-muted);
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	text-decoration: none;
}
.drawer-item-remove:hover {
	background: #fde7e7;
	color: #c14444;
	border-color: #f4baba;
}
.drawer-item-remove:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.drawer-item-price {
	font-size: 14px;
	font-weight: 700;
	color: var(--ink);
	white-space: nowrap;
	align-self: start;
	margin-top: 4px;
}

/* Footer */
.drawer-footer {
	flex-shrink: 0;
	padding: 18px 22px 22px;
	border-top: 1px solid var(--line-soft);
	background: #fff;
	box-shadow: 0 -4px 12px -4px rgba(0, 0, 0, .04);
}
.drawer-totals {
	display: flex; align-items: center; justify-content: space-between;
	margin-bottom: 14px;
}
.drawer-totals-label {
	font-size: 14px;
	color: var(--ink-soft);
	font-weight: 500;
}
.drawer-totals-amount {
	font-family: var(--serif);
	font-size: 22px;
	font-weight: 700;
	color: var(--ink);
}
.drawer-checkout-btn {
	display: flex; align-items: center; justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 20px;
	background: var(--orange);
	color: #fff;
	border: 0;
	border-radius: var(--radius-full);
	font-family: var(--sans);
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	min-height: 48px;
	box-shadow: 0 6px 16px -6px rgba(237, 106, 38, .45);
	transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.drawer-checkout-btn:hover {
	background: #d65a16;
	transform: translateY(-1px);
	box-shadow: 0 10px 22px -6px rgba(237, 106, 38, .55);
}
.drawer-checkout-btn:active { transform: scale(.98); }
.drawer-checkout-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[dir="rtl"] .drawer-checkout-btn svg { transform: scaleX(-1); }

.drawer-cart-btn {
	display: block;
	text-align: center;
	margin-top: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-soft);
	text-decoration: none;
	padding: 10px;
}
.drawer-cart-btn:hover { color: var(--orange); }

/* Empty state */
.drawer-empty {
	flex: 1;
	display: flex; flex-direction: column;
	align-items: center; justify-content: center;
	padding: 32px 22px;
	text-align: center;
	gap: 12px;
}
.drawer-empty svg { color: var(--ink-muted); margin-bottom: 8px; }
.drawer-empty p {
	font-family: var(--serif);
	font-size: 18px;
	font-weight: 700;
	color: var(--ink);
	margin: 0;
}
.drawer-empty small {
	font-size: 13px;
	color: var(--ink-soft);
	display: block;
	margin-bottom: 16px;
}
.drawer-empty .btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 12px 22px;
	background: var(--orange);
	color: #fff;
	border-radius: var(--radius-full);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: background-color .15s ease, transform .15s ease;
}
.drawer-empty .btn:hover { background: #d65a16; transform: translateY(-1px); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.cart-drawer,
	#drawer-overlay,
	.drawer-checkout-btn,
	.drawer-item {
		transition: none !important;
	}
}

/* Mobile: full-width drawer */
@media (max-width: 480px) {
	.cart-drawer { width: 100vw; }
}
