/* Scoped to product-image quick actions; no changes to the existing cart design. */
ul.products li.product.cpqh-ready {
	position: relative;
}

ul.products li.product .cpqh-layer {
	position: absolute;
	z-index: 3;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--cpqh-image-height, auto);
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	pointer-events: none;
	background: linear-gradient(to top, rgba(26, 24, 20, .19), transparent 35%);
	opacity: 0;
	transform: translateY(7px);
	transition: opacity .24s ease, transform .24s ease;
}

ul.products li.product.cpqh-ready:hover .cpqh-layer,
ul.products li.product.cpqh-ready:focus-within .cpqh-layer {
	opacity: 1;
	transform: translateY(0);
}

ul.products li.product .cpqh-action {
	pointer-events: auto;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: min(100%, 208px);
	min-height: 44px;
	padding: 9px 15px;
	border: 1px solid #a77b43;
	border-radius: 7px;
	background: #191919;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
	color: #fff !important;
	font-family: Montserrat, Helvetica, Arial, sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .025em;
	text-align: center;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background .2s ease, box-shadow .2s ease, border-color .2s ease;
}

ul.products li.product .cpqh-action:hover,
ul.products li.product .cpqh-action:focus-visible {
	background: #9d6b2a;
	border-color: #9d6b2a;
	box-shadow: 0 9px 24px rgba(0, 0, 0, .22);
	color: #fff !important;
}

ul.products li.product .cpqh-action svg {
	flex: 0 0 18px;
}

ul.products li.product .cpqh-action.cpqh-busy {
	opacity: .7;
	cursor: progress;
}

ul.products li.product .cpqh-action.cpqh-added {
	background: #304633;
	border-color: #304633;
}

ul.products li.product .cpqh-feedback {
	position: absolute;
	bottom: 64px;
	left: 12px;
	right: 12px;
	padding: 7px 10px;
	border-radius: 5px;
	background: #fff;
	color: #7c1f20;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .13);
	pointer-events: none;
}

/* A compact control on photos, with a full-sized touch target. */
@media (hover: none), (pointer: coarse), (max-width: 767px) {
	ul.products li.product.cpqh-ready .cpqh-layer {
		opacity: 1;
		transform: none;
		justify-content: flex-end;
		padding: 9px;
		background: none;
	}
	ul.products li.product .cpqh-action {
		position: relative;
		flex: 0 0 44px;
		width: 44px;
		height: 44px;
		min-height: 44px;
		gap: 0;
		padding: 0;
		border-radius: 50%;
		border-color: #b49365;
		background: #fffdf9;
		box-shadow: 0 3px 12px rgba(36, 27, 16, .17);
		color: #402f1a !important;
	}
	ul.products li.product .cpqh-action:hover,
	ul.products li.product .cpqh-action:focus-visible {
		background: #f9f1e5;
		border-color: #98703c;
		color: #402f1a !important;
	}
	ul.products li.product .cpqh-action svg {
		width: 20px;
		height: 20px;
		flex: 0 0 20px;
	}
	ul.products li.product .cpqh-action.cpqh-select {
		background: #292622;
		border-color: #b49365;
		color: #fff !important;
	}
	ul.products li.product .cpqh-action.cpqh-select:hover,
	ul.products li.product .cpqh-action.cpqh-select:focus-visible {
		background: #69502e;
		color: #fff !important;
	}
	ul.products li.product .cpqh-action .cpqh-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
	ul.products li.product .cpqh-action.cpqh-busy svg,
	ul.products li.product .cpqh-action.cpqh-added svg {
		visibility: hidden;
	}
	ul.products li.product .cpqh-action.cpqh-busy::after {
		content: '';
		position: absolute;
		width: 18px;
		height: 18px;
		border: 2px solid currentColor;
		border-right-color: transparent;
		border-radius: 50%;
		animation: cpqh-spin .75s linear infinite;
	}
	ul.products li.product .cpqh-action.cpqh-added,
	ul.products li.product .cpqh-action.cpqh-added:hover {
		background: #304633;
		border-color: #304633;
		color: #fff !important;
	}
	ul.products li.product .cpqh-action.cpqh-added::after {
		content: '✓';
		position: absolute;
		font-size: 22px;
		font-weight: 600;
		line-height: 1;
	}
}

@keyframes cpqh-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	ul.products li.product .cpqh-layer,
	ul.products li.product .cpqh-action {
		transition: none;
	}
	ul.products li.product .cpqh-action.cpqh-busy::after {
		animation-duration: 2s;
	}
}

body.cpqh-modal-open {
	overflow: hidden;
}

.cpqh-modal[hidden] {
	display: none !important;
}

.cpqh-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	place-items: center;
	padding: 16px;
	box-sizing: border-box;
	font-family: Montserrat, Helvetica, Arial, sans-serif;
}

.cpqh-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 16, 16, .62);
	backdrop-filter: blur(3px);
}

.cpqh-dialog {
	position: relative;
	width: min(100%, 780px);
	max-height: min(90vh, 690px);
	display: grid;
	grid-template-columns: minmax(200px, 39%) 1fr;
	background: #fff;
	border: 1px solid #d7c4a8;
	border-radius: 12px;
	box-shadow: 0 24px 65px rgba(0, 0, 0, .25);
	overflow: auto;
	color: #242424;
}

.cpqh-modal-close {
	position: absolute;
	right: 16px;
	top: 13px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: 1px solid #e4e0dc;
	border-radius: 50%;
	background: #fff;
	color: #292929;
	font: 400 28px/1 Arial, sans-serif;
	cursor: pointer;
}

.cpqh-modal-close:hover,
.cpqh-modal-close:focus-visible {
	border-color: #9d6b2a;
	color: #9d6b2a;
}

.cpqh-modal-media {
	display: grid;
	place-items: center;
	padding: 32px;
	background: #faf9f7;
}

.cpqh-modal-image {
	display: block;
	max-width: 100%;
	max-height: 360px;
	object-fit: contain;
}

.cpqh-modal-image[hidden] {
	display: none;
}

.cpqh-modal-content {
	padding: 48px 36px 32px;
}

.cpqh-eyebrow {
	color: #9d6b2a;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .17em;
}

.cpqh-modal .cpqh-modal-title {
	margin: 10px 38px 11px 0;
	color: #1c1c1c;
	font: 700 23px/1.25 Montserrat, Helvetica, Arial, sans-serif;
}

.cpqh-modal-prompt {
	margin: 0 0 15px;
	font-size: 13px;
	font-weight: 600;
	color: #626262;
}

.cpqh-options {
	display: grid;
	gap: 9px;
	max-height: 270px;
	overflow: auto;
	padding: 2px 3px 2px 1px;
}

.cpqh-modal .cpqh-variation-choice {
	width: 100%;
	min-height: 56px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 5px 12px;
	padding: 12px 14px;
	border: 1px solid #dedad4;
	border-radius: 7px;
	background: #fff;
	color: #292929;
	text-align: left;
	font: 600 13px/1.35 Montserrat, Helvetica, Arial, sans-serif;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease;
}

.cpqh-modal .cpqh-variation-choice:hover,
.cpqh-modal .cpqh-variation-choice:focus-visible,
.cpqh-modal .cpqh-variation-choice.cpqh-selected {
	border-color: #9d6b2a;
	background: #faf6ef;
}

.cpqh-modal .cpqh-variation-choice:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.cpqh-variation-price {
	color: #b72f69;
	font-weight: 700;
}

.cpqh-variation-choice small {
	width: 100%;
	color: #777;
	font-size: 11px;
}

.cpqh-modal-bottom {
	display: flex;
	align-items: end;
	gap: 12px;
	margin-top: 20px;
}

.cpqh-qty-label {
	display: grid;
	gap: 5px;
	color: #606060;
	font-size: 11px;
	font-weight: 700;
}

.cpqh-modal .cpqh-qty {
	box-sizing: border-box;
	width: 76px;
	height: 45px;
	padding: 8px;
	border: 1px solid #dedad4;
	border-radius: 6px;
	background: #fff;
	color: #202020;
	font: 600 14px Montserrat, Helvetica, Arial, sans-serif;
	text-align: center;
}

.cpqh-modal .cpqh-modal-add {
	flex: 1;
	min-height: 45px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 10px 15px;
	border: 1px solid #9d6b2a;
	border-radius: 7px;
	background: #191919;
	color: #fff;
	font: 700 12px Montserrat, Helvetica, Arial, sans-serif;
	cursor: pointer;
}

.cpqh-modal .cpqh-modal-add:hover:not(:disabled),
.cpqh-modal .cpqh-modal-add:focus-visible:not(:disabled) {
	background: #9d6b2a;
	color: #fff;
}

.cpqh-modal .cpqh-modal-add:disabled {
	opacity: .48;
	cursor: not-allowed;
}

.cpqh-modal-status {
	min-height: 17px;
	margin: 11px 0 2px;
	color: #a02529;
	font-size: 11px;
	line-height: 1.4;
}

.cpqh-modal .cpqh-modal-product-link {
	color: #73501f;
	font-size: 11px;
	font-weight: 700;
	text-decoration: underline;
}

@media (max-width: 650px) {
	.cpqh-dialog {
		grid-template-columns: 1fr;
		max-height: 92vh;
	}
	.cpqh-modal-media {
		padding: 15px;
		min-height: 120px;
		max-height: 175px;
	}
	.cpqh-modal-image {
		max-height: 145px;
	}
	.cpqh-modal-content {
		padding: 23px 20px 24px;
	}
	.cpqh-modal .cpqh-modal-title {
		font-size: 19px;
	}
	.cpqh-options {
		max-height: 210px;
	}
}
