/**
 * Merchandising layer: promo hero, offer band, journal entry point, quick view, and the shared
 * card inside the best-sellers rail. Loaded sitewide; small.
 */

/* ---------------------------------------------------------- promo hero -- */

.cn-hero--promo {
	background: var(--wp--preset--color--walnut);
}

.cn-promo__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}

.cn-promo__slide[hidden] {
	display: block;
}

.cn-promo__slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.9s ease;
}

.cn-promo__slide picture,
.cn-promo__slide picture img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cn-promo__code {
	display: inline-block;
	margin-bottom: 16px;
	padding: 8px 14px;
	border: 1px solid rgba(251, 246, 234, 0.55);
	color: var(--wp--preset--color--cream);
	font-size: 11.5px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.cn-promo__code strong {
	font-weight: 600;
}

.cn-promo__combine {
	display: block;
	margin-top: 6px;
	font-size: 0.9em;
	opacity: 0.85;
}

.cn-promo__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 20px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 10px;
}

.cn-promo__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--cream);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background var(--cn-ease);
}

.cn-promo__dot.is-active {
	background: var(--wp--preset--color--cream);
}

@media (prefers-reduced-motion: reduce) {
	.cn-promo__slide,
	.cn-promo__slide.is-active {
		transition: none;
	}
}

/* ---------------------------------------------------------- offer band -- */

.cn-offer-band {
	background: var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--oat);
}

.cn-offer-band__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 28px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 14px var(--cn-gutter);
	text-align: center;
}

.cn-offer-band__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 18px;
}

.cn-offer-band__code,
.cn-offer-band__timer {
	font-size: 12.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}

.cn-offer-band__code strong {
	color: var(--wp--preset--color--brass-light);
	font-weight: 600;
}

.cn-offer-band__cta {
	padding-bottom: 2px;
	border-bottom: 1px solid var(--wp--preset--color--brass-light);
	color: var(--wp--preset--color--oat);
	font-size: 12.5px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
}

.cn-offer-band__cta:hover {
	color: var(--wp--preset--color--brass-light);
}

/* ------------------------------------------------------------- journal -- */

.cn-journal {
	padding: clamp(64px, 7vw, 104px) var(--cn-gutter);
}

.cn-journal__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: clamp(28px, 3vw, 44px);
}

.cn-journal__title {
	margin: 8px 0 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(28px, 3vw, 42px);
	font-weight: 400;
	letter-spacing: -0.015em;
	line-height: 1.12;
	text-wrap: balance;
}

.cn-journal__all {
	flex: 0 0 auto;
	padding-bottom: 3px;
	border-bottom: 1px solid var(--cn-hairline);
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}

.cn-journal__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px 24px;
}

.cn-journal__link {
	display: flex;
	flex-direction: column;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.cn-journal__media {
	aspect-ratio: 4 / 3;
}

.cn-journal__name {
	margin: 4px 0 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 22px;
	font-weight: 400;
	line-height: 1.2;
	text-wrap: balance;
}

.cn-journal__link:hover .cn-journal__name {
	color: var(--wp--preset--color--walnut);
}

.cn-journal__excerpt {
	margin: 0;
	color: var(--wp--preset--color--ink-soft);
	font-size: 14.5px;
	line-height: 1.6;
}

.cn-journal__meta {
	color: var(--wp--preset--color--ink-muted);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* -------------------------------------------------- rail with the card -- */

.cn-rail__item {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0 0 24px;
}

.cn-rail__item .cn-rail__rank {
	padding: 0;
	font-size: 20px;
}

.cn-rail__item .cn-card__plate {
	aspect-ratio: 1;
}

/* ---------------------------------------------------------- quick view -- */

.cn-card__quick {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	display: none;
	padding: 12px;
	border: 0;
	background: rgba(251, 246, 234, 0.94);
	color: var(--wp--preset--color--warm-ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 11.5px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity var(--cn-ease), transform var(--cn-ease);
}

@media (hover: hover) and (min-width: 768px) {
	.cn-card__quick {
		display: block;
	}

	.cn-card:hover .cn-card__quick,
	.cn-card:focus-within .cn-card__quick {
		opacity: 1;
		transform: none;
	}
}

.cn-card__quick:hover {
	background: var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--oat);
}

.cn-qv-modal {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

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

.cn-qv-modal__scrim {
	position: absolute;
	inset: 0;
	background: rgba(41, 36, 32, 0.55);
}

.cn-qv-dialog {
	position: relative;
	width: min(940px, 100%);
	max-height: 90vh;
	overflow: auto;
	background: var(--wp--preset--color--oat);
	box-shadow: 0 24px 80px rgba(41, 36, 32, 0.28);
}

.cn-qv-dialog__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(251, 246, 234, 0.9);
	color: var(--wp--preset--color--warm-ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.cn-qv-dialog__body {
	min-height: 200px;
}

.cn-qv-dialog__loading {
	padding: 48px;
	color: var(--wp--preset--color--ink-muted);
	text-align: center;
}

.cn-qv {
	display: grid;
	grid-template-columns: 1fr 1fr;
}

.cn-qv__media {
	aspect-ratio: 4 / 5;
	background: var(--wp--preset--color--oat-shade);
	overflow: hidden;
}

.cn-qv__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 40px 40px 32px;
}

.cn-qv__name {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 26px;
	font-weight: 400;
	line-height: 1.15;
	text-wrap: balance;
}

.cn-qv__price {
	font-family: var(--wp--preset--font-family--display);
	font-size: 22px;
}

.cn-qv__price del {
	margin-right: 8px;
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
}

.cn-qv__price ins {
	text-decoration: none;
}

.cn-qv__lede,
.cn-qv__facts {
	margin: 0;
	color: var(--wp--preset--color--ink-soft);
	font-size: 14.5px;
	line-height: 1.6;
}

.cn-qv__facts {
	color: var(--wp--preset--color--ink-muted);
	font-size: 13px;
}

.cn-qv__form {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}

.cn-qv__qty {
	width: 72px;
	height: 52px;
	padding: 0 10px;
	border: 1px solid var(--wp--preset--color--warm-ink);
	background: transparent;
	font: inherit;
	text-align: center;
}

.cn-qv__atc {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 20px;
	border: 0;
	background: var(--wp--preset--color--honey-brass);
	color: var(--wp--preset--color--ivory);
	font-family: var(--wp--preset--font-family--body);
	font-size: 13px;
	letter-spacing: 0.14em;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
}

/* Outside the quantity form the button is a child of the column body, where
   `flex: 1` sized its height from zero and left a thin strip. */
.cn-qv__body > .cn-qv__atc {
	flex: 0 0 auto;
}

.cn-qv__atc:hover {
	background: var(--wp--preset--color--brass-deep);
}

.cn-qv__soldout {
	margin: 8px 0 0;
	color: var(--wp--preset--color--ink-muted);
}

.cn-qv__more {
	align-self: flex-start;
	margin-top: 4px;
}

/* ------------------------------------------------------------ your casa -- */

a.cn-ugc__figure {
	display: block;
}

/* -------------------------------------------------------------- mobile -- */

@media (max-width: 1023px) {
	.cn-journal__grid {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.cn-journal__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.cn-offer-band__inner {
		flex-direction: column;
		gap: 6px;
		padding: 12px var(--cn-gutter);
	}

	.cn-offer-band__title {
		font-size: 16px;
	}

	.cn-rail__item {
		flex-basis: 78vw;
	}

	.cn-qv-modal {
		align-items: flex-end;
		padding: 0;
	}

	.cn-qv-dialog {
		max-height: 92vh;
	}

	.cn-qv {
		grid-template-columns: 1fr;
	}

	.cn-qv__media {
		aspect-ratio: 4 / 3;
	}

	.cn-qv__body {
		padding: 22px 20px 28px;
	}

	.cn-qv__name {
		font-size: 22px;
	}
}

/*
 * A phone shows one whole card and a slice of the next, so the rail reads as a row that continues
 * rather than as a card that has been cut. The gutter and the gap come off the viewport first,
 * leaving 46px of the following card at the edge.
 */
@media (max-width: 767px) {
	.cn-rail__item {
		flex-basis: calc(100% - 46px);
	}
}
