/**
 * ZZF Cart Drawer — slide-out mini-cart panel (right side).
 *
 * All colors/radii resolve from theme.json token custom properties with
 * dark neutral fallbacks, so the drawer matches any client preset and
 * still looks correct if tokens are unavailable. No brand hex values.
 */

.zzf-drawer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	pointer-events: none;
	font-size: var(--wp--preset--font-size--s, 14px);
}

/* The scrim and the panel material are variable-driven with the previous
   values as fallbacks, so every existing preset renders exactly as before.
   A preset that wants a glass drawer sets --zzf-drawer-* (pastel-glass does
   this in the theme's glass.css); nothing here is preset-specific, which is
   the rule this file already follows for colour. */
.zzf-drawer__overlay {
	position: absolute;
	inset: 0;
	background: var(--zzf-drawer-scrim, rgba(0, 0, 0, 0.55));
	opacity: 0;
	transition: opacity 0.25s ease;
}

.zzf-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(420px, 92vw);
	display: flex;
	flex-direction: column;
	background: var(--zzf-drawer-fill, var(--wp--preset--color--surface, #17171a));
	color: var(--wp--preset--color--contrast, #f2f1ed);
	-webkit-backdrop-filter: var(--zzf-drawer-filter, none);
	backdrop-filter: var(--zzf-drawer-filter, none);
	border-left: 1px solid var(--zzf-drawer-line, var(--wp--preset--color--line, #2e2e33));
	box-shadow: var(--zzf-drawer-shadow, -24px 0 64px rgba(0, 0, 0, 0.45));
	transform: translateX(100%);
	transition: transform 0.25s ease;
	outline: none;
}

.zzf-drawer.is-open {
	pointer-events: auto;
}

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

.zzf-drawer.is-open .zzf-drawer__panel {
	transform: translateX(0);
}

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

body.zzf-drawer-lock {
	overflow: hidden;
}

/* Head — brand row above the label, so the drawer opens with the mark
   rather than a bare word. Stacks because the logo needs its own line;
   squeezing a lockup beside a label leaves neither enough room. */
.zzf-drawer__head {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--zzf-drawer-line, var(--wp--preset--color--line, #2e2e33));
}

.zzf-drawer__headtop {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 32px;   /* holds the row height when no logo is set */
}

.zzf-drawer__logo {
	display: block;
	width: auto;
	max-width: min(190px, 58%);
	max-height: 38px;
	height: auto;
	object-fit: contain;
	object-position: left center;
}

.zzf-drawer__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xs, 12px);
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted, #9a9aa1);
}

.zzf-drawer__close {
	appearance: none;
	background: transparent;
	border: 1px solid var(--wp--preset--color--line, #2e2e33);
	border-radius: 100px;
	width: 32px;
	height: 32px;
	line-height: 1;
	font-size: 18px;
	color: var(--wp--preset--color--contrast, #f2f1ed);
	cursor: pointer;
	padding: 0;
}

.zzf-drawer__close:hover,
.zzf-drawer__close:focus {
	border-color: var(--wp--preset--color--accent, #c4c4cc);
	color: var(--wp--preset--color--accent, #c4c4cc);
}

.zzf-drawer__close:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-2, #dedee4);
	outline-offset: 2px;
}

/* Content (this element is the Woo cart fragment target) */
.zzf-drawer__content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.zzf-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px 20px;
}

.zzf-drawer__empty {
	margin: 24px 0 16px;
	color: var(--wp--preset--color--muted, #9a9aa1);
	text-align: center;
}

.zzf-drawer__browse {
	display: block;
	text-align: center;
	color: var(--wp--preset--color--accent-2, #dedee4);
	text-decoration: none;
}

.zzf-drawer__browse:hover,
.zzf-drawer__browse:focus {
	text-decoration: underline;
}

.zzf-drawer__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.zzf-drawer__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
	border-bottom: 1px solid var(--wp--preset--color--line, #2e2e33);
}

.zzf-drawer__item:last-child {
	border-bottom: 0;
}

.zzf-drawer__item-thumb {
	flex: 0 0 auto;
	width: 56px;
}

.zzf-drawer__item-thumb img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: var(--wp--custom--zzf--radius-s, 8px);
	border: 1px solid var(--wp--preset--color--line, #2e2e33);
	background: var(--wp--preset--color--surface-2, #232327);
}

.zzf-drawer__item-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.zzf-drawer__item-name {
	color: var(--wp--preset--color--contrast, #f2f1ed);
	overflow-wrap: anywhere;
}

.zzf-drawer__item-name a {
	color: inherit;
	text-decoration: none;
}

.zzf-drawer__item-name a:hover,
.zzf-drawer__item-name a:focus {
	color: var(--wp--preset--color--accent-2, #dedee4);
}

.zzf-drawer__item-qty {
	color: var(--wp--preset--color--muted, #9a9aa1);
	font-size: var(--wp--preset--font-size--xs, 12px);
}

.zzf-drawer__item-qty .woocommerce-Price-amount {
	color: var(--wp--preset--color--contrast, #f2f1ed);
}

/* Foot */
.zzf-drawer__foot {
	flex: 0 0 auto;
	padding: 16px 20px 18px;
	border-top: 1px solid var(--wp--preset--color--line, #2e2e33);
	background: var(--wp--preset--color--surface-2, #232327);
}

.zzf-drawer__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 0 0 6px;
	font-weight: 600;
}

.zzf-drawer__subtotal-amount {
	color: var(--wp--preset--color--accent-2, #dedee4);
}

.zzf-drawer__note {
	margin: 0 0 14px;
	color: var(--wp--preset--color--muted, #9a9aa1);
	font-size: var(--wp--preset--font-size--xs, 12px);
}

.zzf-drawer__checkout {
	display: block;
	text-align: center;
	background: var(--wp--preset--color--accent, #c4c4cc);
	color: var(--wp--preset--color--base, #121214);
	border-radius: 100px;
	padding: 13px 26px;
	font-size: var(--wp--preset--font-size--xs, 12px);
	font-weight: 600;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	text-decoration: none;
}

.zzf-drawer__checkout:hover,
.zzf-drawer__checkout:focus {
	background: var(--wp--preset--color--accent-2, #dedee4);
	color: var(--wp--preset--color--base, #121214);
	text-decoration: none;
}

.zzf-drawer__checkout:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-2, #dedee4);
	outline-offset: 2px;
}

.zzf-drawer__view-cart {
	display: block;
	text-align: center;
	margin-top: 10px;
	color: var(--wp--preset--color--muted, #9a9aa1);
	font-size: var(--wp--preset--font-size--xs, 12px);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.zzf-drawer__view-cart:hover,
.zzf-drawer__view-cart:focus {
	color: var(--wp--preset--color--contrast, #f2f1ed);
}

.zzf-drawer__ruo {
	margin: 14px 0 0;
	color: var(--wp--preset--color--muted, #9a9aa1);
	font-size: 11px;
	line-height: 1.5;
	text-align: center;
}
