/**
 * Collection Only for WooCommerce
 *
 * The notice reads as store information, not as a validation error. A warm
 * clay accent on a sand ground, anchored by a left rule that repeats at every
 * step of the funnel so it is recognised rather than re-read.
 *
 * Everything is scoped to .cofw-. No theme or CheckoutWC selector is touched.
 * Sizing is in em so the notice sits correctly in whatever type scale it lands in.
 */

.cofw-notice {
	--cofw-accent: #b4571f;
	--cofw-ground: #fbf6ef;
	--cofw-ink: #2a2422;
	--cofw-rule: 3px;

	box-sizing: border-box;
	/*
	 * The notice must never widen its container. Flatsome lays the product
	 * summary out as a flex item with min-width: auto, so anything unbreakable
	 * in here raises the column's min-content width and pushes it onto its own
	 * full-width row. Everything below keeps min-content small.
	 */
	max-width: 100%;
	min-width: 0;
	margin: 1em 0;
	padding: 0.75em 0.9em 0.8em;
	border-left: var(--cofw-rule) solid var(--cofw-accent);
	background: var(--cofw-ground);
	color: var(--cofw-ink);
	font-size: 0.95em;
	line-height: 1.5;
	overflow-wrap: break-word;
	text-align: left;
	word-wrap: break-word;
}

.cofw-notice * {
	box-sizing: border-box;
}

.cofw-notice__eyebrow {
	display: block;
	margin-bottom: 0.35em;
	color: var(--cofw-accent);
	font-size: 0.7em;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
}

.cofw-notice__text {
	max-width: 100%;
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 1em;
	line-height: inherit;
	overflow-wrap: break-word;
}

.cofw-notice__strong {
	font-weight: 700;
}

/*
 * The store name wraps. Holding it on one line reads better, but it is exactly
 * what breaks a narrow flex column, and the layout matters more.
 */
.cofw-notice__link {
	color: var(--cofw-accent);
	overflow-wrap: break-word;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	white-space: normal;
}

.cofw-notice__link:hover,
.cofw-notice__link:focus {
	color: var(--cofw-ink);
}

.cofw-notice__link:focus-visible {
	outline: 2px solid var(--cofw-accent);
	outline-offset: 2px;
}

.cofw-notice__pin {
	display: inline-block;
	margin-right: 0.3em;
	vertical-align: -0.12em;
}

/* Placement adjustments. */

.cofw-notice--product {
	margin: 1.25em 0 1.5em;
}

.cofw-notice--cart,
.cofw-notice--checkout,
.cofw-notice--order {
	margin: 0.6em 0 0.2em;
	padding: 0.55em 0.7em 0.6em;
	font-size: 0.85em;
}

/* Checkout and order review columns inherit bold and centring from some themes. */
.cofw-notice--checkout,
.cofw-notice--order {
	font-weight: 400;
	white-space: normal;
}

/* ------------------------------------------------------------------ *
 * Shipping total row
 *
 * Replaces the amount in the order totals. This is the line customers were
 * misreading as free delivery, so it carries the accent colour — the one place
 * in the totals block that is not a number.
 * ------------------------------------------------------------------ */

.cofw-shipping-total {
	display: inline-block;
	max-width: 22em;
	color: #b4571f;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: break-word;
	text-align: right;
	text-transform: none;
}

/* ------------------------------------------------------------------ *
 * Acknowledgement modal
 * ------------------------------------------------------------------ */

.cofw-modal {
	--cofw-accent: #b4571f;
	--cofw-ground: #fbf6ef;
	--cofw-ink: #2a2422;
	--cofw-muted: #6b615b;
	--cofw-line: #e6dccf;

	position: fixed;
	inset: 0;
	/* Above CheckoutWC's side cart (999999) and its own modals (1000000). */
	z-index: 1000001;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
	background: rgba(30, 24, 20, 0.55);
	opacity: 0;
	transition: opacity 180ms ease;
}

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

.cofw-modal.is-open {
	opacity: 1;
}

.cofw-modal__dialog {
	width: 100%;
	max-width: 34rem;
	max-height: 90vh;
	overflow-y: auto;
	padding: 1.5rem 1.25rem 1.25rem;
	border-top: 4px solid var(--cofw-accent);
	background: #fff;
	color: var(--cofw-ink);
	font-size: 16px;
	line-height: 1.55;
	text-align: left;
	transform: translateY(14px);
	transition: transform 220ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.cofw-modal.is-open .cofw-modal__dialog {
	transform: translateY(0);
}

.cofw-modal__eyebrow {
	display: block;
	margin-bottom: 0.5rem;
	color: var(--cofw-accent);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.cofw-modal__title {
	margin: 0 0 0.6rem;
	color: var(--cofw-ink);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.2;
}

.cofw-modal__body {
	margin: 0 0 1.1rem;
	color: var(--cofw-ink);
	font-size: 0.95rem;
}

.cofw-modal__link {
	color: var(--cofw-accent);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.cofw-modal__link:focus-visible {
	outline: 2px solid var(--cofw-accent);
	outline-offset: 2px;
}

/*
 * The signature: name the actual pieces. "An item in your cart" is not enough
 * information to make arrangements with; a photo and a name is.
 */
.cofw-modal__items {
	margin: 0 0 1.25rem;
	padding: 0.75rem 0.9rem;
	border-left: 3px solid var(--cofw-accent);
	background: var(--cofw-ground);
	list-style: none;
}

.cofw-modal__item {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin: 0;
	padding: 0.4rem 0;
}

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

.cofw-modal__thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: cover;
	background: #fff;
}

.cofw-modal__item-name {
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
}

.cofw-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	align-items: stretch;
}

.cofw-modal__confirm {
	display: block;
	width: 100%;
	padding: 0.85rem 1.25rem;
	border: 0;
	margin: 0;
	background: var(--cofw-accent);
	border-radius: 0;
	color: #fff;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.2;
	text-align: center;
	transition: background-color 140ms ease;
}

.cofw-modal__confirm:hover,
.cofw-modal__confirm:focus {
	background: #963f0e;
	color: #fff;
}

.cofw-modal__confirm:focus-visible {
	outline: 2px solid var(--cofw-ink);
	outline-offset: 2px;
}

.cofw-modal__dismiss {
	padding: 0.4rem;
	border: 0;
	background: none;
	color: var(--cofw-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 0.85rem;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.cofw-modal__dismiss:hover,
.cofw-modal__dismiss:focus {
	color: var(--cofw-ink);
}

.cofw-modal__dismiss:focus-visible {
	outline: 2px solid var(--cofw-accent);
	outline-offset: 2px;
}

@media (min-width: 600px) {
	.cofw-modal {
		align-items: center;
		padding: 1.5rem;
	}

	.cofw-modal__dialog {
		padding: 1.75rem 1.75rem 1.5rem;
	}

	.cofw-modal__actions {
		flex-direction: row-reverse;
		justify-content: flex-start;
		align-items: center;
		gap: 1rem;
	}

	.cofw-modal__confirm {
		width: auto;
	}
}

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

@media (prefers-reduced-motion: reduce) {
	.cofw-modal,
	.cofw-modal__dialog,
	.cofw-modal__confirm {
		transition: none;
	}

	.cofw-modal__dialog {
		transform: none;
	}
}

/* ------------------------------------------------------------------ */

.cofw-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	padding: 0;
	border: 0;
	margin: -1px;
	clip-path: inset(50%);
	white-space: nowrap;
}
