/**
 * ECP shared bottom-sheet primitives (Filters + Quick-add)
 *
 * Reuses Filters class names:
 *   .ecp-drawer-overlay, .ecp-mobile-drawer, .ecp-mobile-drawer__*, .ecp-btn--*
 *
 * Quick-add modifiers (.ecp-qa-*) force the sheet to work on desktop too
 * (Filters only enable drawers inside @media max-width:767).
 */

:root {
	--ecp-drawer-max-h: 85dvh;
	--ecp-transition: 200ms ease;
	--ecp-hover: var(--ecp-navy, #2a3a52);
	--ecp-navy-hover: #1e2c3d;
	--ecp-text: #2a2118;
	--ecp-text-muted: #7a6f64;
}

/* Overlay — all viewports for quick-add */
.ecp-drawer-overlay.ecp-qa-overlay {
	display: block !important;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 10060;
	opacity: 0;
	pointer-events: none;
	transition: opacity 220ms ease;
}
.ecp-drawer-overlay.ecp-qa-overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}
.ecp-drawer-overlay.ecp-qa-overlay[hidden] {
	display: none !important;
}

/* Bottom sheet — all viewports for quick-add */
.ecp-mobile-drawer.ecp-qa-sheet {
	display: flex !important;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	top: auto;
	z-index: 10061;
	width: 100%;
	max-width: 100%;
	max-height: var(--ecp-drawer-max-h, 85dvh);
	background: #fff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
	flex-direction: column;
	overflow: hidden;
	transform: translateY(110%);
	transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
	-webkit-overflow-scrolling: touch;
	pointer-events: none;
}
.ecp-mobile-drawer.ecp-qa-sheet.is-open {
	transform: translateY(0);
	pointer-events: auto;
}
.ecp-mobile-drawer.ecp-qa-sheet[hidden] {
	display: none !important;
}

.ecp-qa-sheet .ecp-mobile-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.1rem 1.25rem 0.9rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	flex-shrink: 0;
	background: #fff;
}
.ecp-qa-sheet .ecp-mobile-drawer__title {
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ecp-text, #2a2118);
	font-family: 'Lato', sans-serif;
}
.ecp-qa-sheet .ecp-mobile-drawer__close {
	background: none !important;
	border: none !important;
	cursor: pointer;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--ecp-text-muted, #7a6f64) !important;
	padding: 0.25rem 0.35rem;
	box-shadow: none !important;
}
.ecp-qa-sheet .ecp-mobile-drawer__close:hover {
	color: var(--ecp-text, #2a2118) !important;
}
.ecp-qa-sheet .ecp-mobile-drawer__body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 1rem 1.25rem 0.75rem;
	flex: 1 1 auto;
	overscroll-behavior: contain;
}
.ecp-qa-sheet .ecp-mobile-drawer__footer {
	display: flex;
	gap: 0.75rem;
	padding: 0.9rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	flex-shrink: 0;
	background: #fff;
	position: sticky;
	bottom: 0;
}

.ecp-qa-sheet .ecp-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1rem;
	border-radius: 2px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	border: 1px solid transparent;
	font-family: 'Lato', sans-serif;
	transition: background 200ms ease, opacity 200ms ease;
}
.ecp-qa-sheet .ecp-btn--primary {
	background: var(--ecp-hover, #2a3a52) !important;
	border-color: var(--ecp-hover, #2a3a52) !important;
	color: #fff !important;
}
.ecp-qa-sheet .ecp-btn--primary:hover:not(:disabled) {
	background: var(--ecp-navy-hover, #1e2c3d) !important;
}
.ecp-qa-sheet .ecp-btn--primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.ecp-qa-section { margin-bottom: 1.15rem; }
.ecp-qa-section__label {
	display: block;
	font-family: 'Lato', sans-serif;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ecp-text-muted, #7a6f64);
	margin: 0 0 0.65rem;
}
.ecp-qa-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ecp-qa-chip {
	appearance: none;
	background: #f5f1eb !important;
	border: 1.5px solid transparent !important;
	border-radius: 6px !important;
	padding: 0.55rem 1rem !important;
	font-family: 'Lato', sans-serif !important;
	font-size: 0.85rem !important;
	font-weight: 600 !important;
	color: var(--ecp-text, #2a2118) !important;
	cursor: pointer;
	line-height: 1.2 !important;
	box-shadow: none !important;
}
.ecp-qa-chip:hover { border-color: rgba(42, 58, 82, 0.35) !important; }
.ecp-qa-chip.is-selected {
	border-color: var(--ecp-hover, #2a3a52) !important;
	background: #fff !important;
	color: var(--ecp-hover, #2a3a52) !important;
}
.ecp-qa-chip__price {
	display: block;
	font-size: 0.72rem;
	font-weight: 500;
	color: var(--ecp-text-muted, #7a6f64);
	margin-top: 0.15rem;
}
.ecp-qa-chip.is-selected .ecp-qa-chip__price { color: var(--ecp-hover, #2a3a52); }

/* Set-of-4 / offerSetOf4: stacked full-width qty rows (label left, price right) */
.ecp-qa-qty-stack {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.ecp-qa-qty-row {
	appearance: none;
	display: flex !important;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0.75rem 1rem !important;
	font-family: 'Lato', sans-serif !important;
	font-size: 0.9rem !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	color: var(--ecp-text, #2a2118) !important;
	background: #f0ece6 !important;
	border: 1.5px solid rgba(42, 58, 82, 0.28) !important;
	border-radius: 6px !important;
	cursor: pointer;
	box-shadow: none !important;
	text-align: left;
}
.ecp-qa-qty-row:hover {
	border-color: rgba(42, 58, 82, 0.45) !important;
}
.ecp-qa-qty-row.is-selected {
	background: #fff !important;
	border-color: #2a3a52 !important;
	color: #2a3a52 !important;
}
.ecp-qa-qty-row__label {
	flex: 0 1 auto;
}
.ecp-qa-qty-row__price {
	flex: 0 0 auto;
	font-weight: 600 !important;
	font-variant-numeric: tabular-nums;
	color: inherit;
}
.ecp-qa-product {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin: 0 0 1rem;
}
.ecp-qa-product-thumb {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
	background: #f5f1eb;
	display: block;
}
.ecp-qa-product-text {
	min-width: 0;
	flex: 1 1 auto;
}
.ecp-qa-product-name {
	font-family: 'Merriweather', Georgia, serif;
	font-size: 1rem;
	color: #2a3a52;
	margin: 0 0 0.35rem;
}
.ecp-qa-product-meta {
	font-family: 'Lato', sans-serif;
	font-size: 0.85rem;
	color: #888;
	margin: 0;
}
.ecp-qa-product + .ecp-qa-section {
	margin-top: 0.15rem;
}
body.ecp-qa-sheet-open { overflow: hidden; }

@media (min-width: 768px) {
	.ecp-mobile-drawer.ecp-qa-sheet {
		left: 50%;
		right: auto;
		width: min(420px, 100%);
		transform: translate(-50%, 110%);
		border-radius: 16px 16px 0 0;
	}
	.ecp-mobile-drawer.ecp-qa-sheet.is-open {
		transform: translate(-50%, 0);
	}
}
