/**
 * COD Quote List — front-end styles.
 * Everything is scoped under .cqr- to stay out of the theme's way.
 */

:root {
	--cqr-accent: #2e7d32;
	--cqr-ink: #16181d;
	--cqr-muted: #667085;
	--cqr-line: #e3e6ea;
	--cqr-surface: #ffffff;
	--cqr-radius: 8px;
	--cqr-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
}

/* ------------------------------------------------------------ add button */

.cqr-add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 8px 0 0;
	padding: 9px 16px;
	border: 1px solid var(--cqr-accent);
	border-radius: var(--cqr-radius);
	background: transparent;
	color: var(--cqr-accent);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cqr-add:hover,
.cqr-add:focus-visible {
	background: var(--cqr-accent);
	color: #fff;
}

.cqr-add.is-added {
	background: var(--cqr-accent);
	border-color: var(--cqr-accent);
	color: #fff;
}

.cqr-add.is-added .cqr-icon {
	transform: rotate(45deg);
}

.cqr-add--loop {
	display: flex;
	width: calc(100% - 32px);
	flex-basis: calc(100% - 32px);
	box-sizing: border-box;
	margin: 18px auto 22px;
}

.cqr-add--single {
	margin: 4px 0 26px;
	padding: 13px 26px;
	font-size: 15px;
}

.cqr-icon {
	flex: none;
	transition: transform 0.15s ease;
}

/* --------------------------------------------------------- header button */

.cqr-header {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: var(--cqr-radius);
	color: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
}

.cqr-header:hover {
	color: var(--cqr-accent);
}

.cqr-header__count,
.cqr-fab__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--cqr-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.cqr-header__count.is-empty {
	background: var(--cqr-muted);
}

.cqr-header--icon {
	position: relative;
	padding: 6px;
	color: inherit;
}

.cqr-quick {
	margin-left: -10px;
}

/* Inside a cloned theme block, let the theme own the layout entirely:
   our own gap and padding would stack on top of its spacing. */
.cqr-quick .cqr-header--icon {
	display: inherit;
	gap: 0;
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

/* Icon-only variant used when the neighbouring header item runs in a row. */
.cqr-header--bare {
	align-self: center;
}

.cqr-icon-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cqr-icon-wrap .cqr-header__count {
	position: absolute;
	top: -8px;
	right: -10px;
}

.cqr-header__text {
	display: block;
	font-size: 13px;
	line-height: 1.2;
	text-align: center;
}

.cqr-header--icon .cqr-header__count {
	position: absolute;
	top: -2px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: var(--cqr-badge, #e02b2b);
	font-size: 11px;
}

.cqr-header--icon .cqr-header__count.is-empty {
	display: none;
}

/* ------------------------------------------------------- floating button */

.cqr-fab-wrap {
	position: fixed;
	z-index: 99990;
	display: flex;
	align-items: center;
	transition: transform 0.28s ease;
}

.cqr-fab-wrap[hidden] {
	display: none;
}

.cqr-fab-wrap--middle-right {
	top: 50%;
	right: 0;
	padding-right: 20px;
	transform: translateY(-50%);
}

.cqr-fab-wrap--middle-right.is-collapsed {
	transform: translateY(-50%) translateX(calc(100% - 22px));
}

.cqr-fab-wrap--bottom-right {
	right: 0;
	bottom: 20px;
	padding-right: 20px;
}

.cqr-fab-wrap--bottom-right.is-collapsed {
	transform: translateX(calc(100% - 22px));
}

.cqr-fab-wrap--bottom-left {
	left: 0;
	bottom: 20px;
	flex-direction: row-reverse;
	padding-left: 20px;
}

.cqr-fab-wrap--bottom-left.is-collapsed {
	transform: translateX(calc(-100% + 22px));
}

.cqr-fab {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 15px;
	border: 0;
	border-radius: 999px;
	background: var(--cqr-accent);
	box-shadow: var(--cqr-shadow);
	color: #fff;
	cursor: pointer;
}

.cqr-fab .cqr-fab__count {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background: var(--cqr-badge, #e02b2b);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
}

.cqr-fab .cqr-fab__count.is-empty {
	display: none;
}

/* ----------------------------------------------------------------- drawer */

.cqr-drawer {
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.cqr-drawer[hidden] {
	display: none;
}

.cqr-drawer__scrim {
	position: absolute;
	inset: 0;
	background: rgba(16, 24, 40, 0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.cqr-drawer.is-open .cqr-drawer__scrim {
	opacity: 1;
}

.cqr-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	width: min(420px, 100%);
	height: 100%;
	background: var(--cqr-surface);
	box-shadow: var(--cqr-shadow);
	transform: translateX(100%);
	transition: transform 0.25s ease;
}

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

.cqr-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--cqr-line);
}

.cqr-drawer__title {
	margin: 0;
	color: var(--cqr-ink);
	font-size: 17px;
	font-weight: 700;
}

.cqr-drawer__close {
	border: 0;
	background: none;
	color: var(--cqr-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

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

body.cqr-locked {
	overflow: hidden;
}

/* ------------------------------------------------------------ inline page */

.cqr-inline {
	max-width: 760px;
	margin: 0 auto;
}

.cqr-skeleton {
	height: 120px;
	border-radius: var(--cqr-radius);
	background: linear-gradient(90deg, #f1f3f5 25%, #e9ecef 37%, #f1f3f5 63%);
	background-size: 400% 100%;
	animation: cqr-shimmer 1.4s ease infinite;
}

@keyframes cqr-shimmer {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

/* ------------------------------------------------------------------- list */

.cqr-list__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.cqr-list__count {
	color: var(--cqr-muted);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.cqr-list {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.cqr-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cqr-line);
}

.cqr-item__media {
	flex: none;
	width: 56px;
	height: 56px;
	overflow: hidden;
	border: 1px solid var(--cqr-line);
	border-radius: 6px;
	background: #fafbfc;
}

.cqr-item__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cqr-item__placeholder {
	display: block;
	width: 100%;
	height: 100%;
}

.cqr-item__body {
	flex: 1;
	min-width: 0;
}

.cqr-item__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--cqr-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
}

.cqr-item__title:hover {
	color: var(--cqr-accent);
}

.cqr-item__sku {
	display: block;
	margin-top: 2px;
	color: var(--cqr-muted);
	font-size: 12px;
}

.cqr-item__side {
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	padding-top: 2px;
}

.cqr-qty {
	display: inline-flex;
	align-items: center;
	overflow: hidden;
	border: 1px solid var(--cqr-line);
	border-radius: 6px;
}

.cqr-list .cqr-qty__step {
	box-sizing: border-box;
	flex: none;
	width: 26px !important;
	min-width: 26px;
	height: 26px !important;
	min-height: 26px;
	margin: 0 !important;
	padding: 0 !important;
	border: 0;
	border-radius: 0;
	background: #f7f8f9;
	color: var(--cqr-ink);
	font-size: 14px;
	line-height: 1 !important;
	cursor: pointer;
}

.cqr-list .cqr-qty__step:hover {
	background: var(--cqr-line);
}

.cqr-list .cqr-qty__input {
	box-sizing: border-box;
	width: 40px !important;
	min-width: 40px;
	height: 26px !important;
	min-height: 26px;
	margin: 0 !important;
	padding: 0 2px !important;
	border: 0;
	border-left: 1px solid var(--cqr-line);
	border-right: 1px solid var(--cqr-line);
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	color: var(--cqr-ink);
	font-size: 13px;
	line-height: 1 !important;
	text-align: center;
	-moz-appearance: textfield;
}

.cqr-qty__input::-webkit-outer-spin-button,
.cqr-qty__input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.cqr-item__remove {
	border: 0;
	background: none;
	color: var(--cqr-muted);
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}

.cqr-item__remove:hover {
	color: #b42318;
}

/* ---------------------------------------------------------------- actions */

.cqr-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: center;
}

.cqr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 20px;
	border: 0;
	border-radius: var(--cqr-radius);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.cqr-btn--primary {
	width: 100%;
	background: var(--cqr-accent);
	color: #fff;
}

.cqr-btn--primary:hover {
	filter: brightness(0.93);
}

.cqr-btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

.cqr-link {
	border: 0;
	background: none;
	color: var(--cqr-accent);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.cqr-link--danger {
	color: var(--cqr-muted);
	font-size: 13px;
	font-weight: 500;
	text-decoration: underline;
}

/* ------------------------------------------------------------------- form */

.cqr-form {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--cqr-line);
}

.cqr-form__title {
	margin: 0 0 14px;
	color: var(--cqr-ink);
	font-size: 16px;
	font-weight: 700;
}

.cqr-field {
	margin-bottom: 14px;
}

.cqr-field label {
	display: block;
	margin-bottom: 5px;
	color: var(--cqr-ink);
	font-size: 13px;
	font-weight: 600;
}

.cqr-field__optional {
	color: var(--cqr-muted);
	font-weight: 400;
}

.cqr-field input,
.cqr-field textarea {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--cqr-line);
	border-radius: 6px;
	background: #fff;
	color: var(--cqr-ink);
	font-family: inherit;
	font-size: 15px;
}

.cqr-field input:focus,
.cqr-field textarea:focus {
	border-color: var(--cqr-accent);
	outline: 2px solid color-mix(in srgb, var(--cqr-accent) 25%, transparent);
	outline-offset: 1px;
}

.cqr-field__hint {
	display: block;
	margin-top: 4px;
	color: var(--cqr-muted);
	font-size: 12px;
}

.cqr-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.cqr-turnstile {
	min-height: 68px;
	margin-bottom: 14px;
}

.cqr-field.has-error input,
.cqr-field.has-error textarea {
	border-color: #b42318;
}

.cqr-field__error {
	display: block;
	margin-top: 4px;
	color: #b42318;
	font-size: 12px;
}

.cqr-form__error {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: 6px;
	background: #fef3f2;
	color: #b42318;
	font-size: 13px;
}

.cqr-form__error[hidden] {
	display: none;
}

/* ------------------------------------------------------- empty + success */

.cqr-empty {
	padding: 32px 8px;
	text-align: center;
}

.cqr-empty__title {
	margin: 0 0 6px;
	color: var(--cqr-ink);
	font-size: 15px;
	font-weight: 600;
}

.cqr-empty__hint {
	margin: 0;
	color: var(--cqr-muted);
	font-size: 14px;
}

.cqr-success {
	padding: 40px 8px 36px;
	text-align: center;
}

.cqr-success__icon {
	display: block;
	width: 58px;
	height: 58px;
	margin: 0 auto 18px;
}

.cqr-success__disc {
	fill: var(--cqr-accent);
	opacity: 0.12;
}

.cqr-success__check {
	fill: none;
	stroke: var(--cqr-accent);
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cqr-success__title {
	margin: 0 0 8px;
	color: var(--cqr-ink);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.cqr-success__body {
	max-width: 44ch;
	margin: 0 auto;
	color: var(--cqr-muted);
	font-size: 14px;
	line-height: 1.6;
}

/* Confirmation details: reference number and where the copy was sent. */
.cqr-success__meta {
	max-width: 360px;
	margin: 24px auto 0;
	padding: 2px 16px;
	border: 1px solid var(--cqr-line);
	border-radius: var(--cqr-radius);
	background: #fafbfc;
	text-align: left;
}

.cqr-success__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	padding: 11px 0;
}

.cqr-success__row + .cqr-success__row {
	border-top: 1px solid var(--cqr-line);
}

.cqr-success__meta dt {
	flex: none;
	color: var(--cqr-muted);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.cqr-success__meta dd {
	margin: 0;
	color: var(--cqr-ink);
	font-size: 13px;
	font-weight: 600;
	text-align: right;
	overflow-wrap: anywhere;
}

/* Keep the exit link from stretching the full width of the quote page,
   where the block is far wider than the drawer it also renders in. */
.cqr-success .cqr-success__action {
	width: auto;
	min-width: 220px;
	margin-top: 26px;
	color: #fff;
}

/* The mark draws itself in, but only where motion is welcome: the
   undecorated state above is already the finished state. */
@media (prefers-reduced-motion: no-preference) {
	.cqr-success__disc {
		transform-box: fill-box;
		transform-origin: center;
		animation: cqr-pop 0.34s ease-out both;
	}

	.cqr-success__check {
		stroke-dasharray: 36;
		stroke-dashoffset: 36;
		animation: cqr-draw 0.4s 0.2s ease-out forwards;
	}
}

@keyframes cqr-pop {
	from { transform: scale(0.55); opacity: 0; }
	to   { transform: scale(1); opacity: 0.12; }
}

@keyframes cqr-draw {
	to { stroke-dashoffset: 0; }
}

/* ------------------------------------------------------------------ toast */

.cqr-toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	z-index: 100000;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--cqr-ink);
	color: #fff;
	font-size: 14px;
	transform: translate(-50%, 16px);
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.cqr-toast.is-visible {
	transform: translate(-50%, 0);
	opacity: 1;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 480px) {
	.cqr-drawer__panel {
		width: 100%;
	}

	.cqr-item__title {
		font-size: 13px;
	}

	.cqr-fab-wrap--bottom-right,
	.cqr-fab-wrap--middle-right {
		padding-right: 14px;
	}

	.cqr-fab-wrap--bottom-left {
		padding-left: 14px;
	}

	.cqr-fab {
		padding: 12px 16px;
	}

}

@media (prefers-reduced-motion: reduce) {
	.cqr-drawer__panel,
	.cqr-drawer__scrim,
	.cqr-toast,
	.cqr-skeleton {
		transition: none;
		animation: none;
	}
}
