/* Deals Popup
   White cards on a light strip, near black type, serif section headings
   under a short red rule, outlined red buttons. */

.affdp {
	--affdp-accent: #E01B22;
	--affdp-dark: #141414;
	--affdp-bg: #FFFFFF;
	--affdp-panel: #F7F7F7;
	--affdp-text: #1A1A1A;
	--affdp-muted: #6b6b6b;
	--affdp-line: #e4e4e4;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	box-sizing: border-box;
	color: var(--affdp-text);
	font-size: 16px;
	line-height: 1.55;
}

.affdp[hidden] {
	display: none;
}

.affdp *,
.affdp *::before,
.affdp *::after {
	box-sizing: border-box;
}

.affdp-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 20, 0.62);
	opacity: 0;
	transition: opacity var(--affdp-fx, 360ms) ease;
}

.affdp.is-open .affdp-backdrop {
	opacity: 1;
}

/* ---------- shell ---------- */

.affdp-modal {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 34px 32px 24px;
	background: var(--affdp-bg);
	border: 1px solid var(--affdp-line);
	border-top: 5px solid var(--affdp-accent);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	opacity: 0;
	transform: translateY(28px);
	transition: opacity var(--affdp-fx, 360ms) cubic-bezier(0.2, 0.7, 0.2, 1), transform var(--affdp-fx, 360ms) cubic-bezier(0.2, 0.7, 0.2, 1);
}

.affdp--fx-fade .affdp-modal {
	transform: none;
}

.affdp--fx-slide-up .affdp-modal {
	transform: translateY(36px);
}

.affdp--fx-slide-down .affdp-modal {
	transform: translateY(-36px);
}

.affdp--fx-slide-left .affdp-modal {
	transform: translateX(-48px);
}

.affdp--fx-slide-right .affdp-modal {
	transform: translateX(48px);
}

.affdp--fx-zoom .affdp-modal {
	transform: scale(0.92);
}

.affdp--fx-none .affdp-modal,
.affdp--fx-none .affdp-backdrop {
	transition: none;
}

.affdp.is-open .affdp-modal {
	opacity: 1;
	transform: none;
}

/* ---------- close ---------- */

.affdp-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	color: var(--affdp-dark);
	background: #fff;
	border: 1px solid var(--affdp-line);
	border-radius: 50%;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.affdp-close:hover,
.affdp-close:focus-visible {
	background: var(--affdp-accent);
	border-color: var(--affdp-accent);
	color: #fff;
	outline: none;
}

.affdp-close:focus-visible {
	box-shadow: 0 0 0 3px rgba(224, 27, 34, 0.28);
}

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

.affdp-head {
	text-align: center;
	margin-bottom: 26px;
}

.affdp .affdp-title {
	margin: 0 0 12px;
	padding: 0;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(1.45rem, 1.1rem + 1.3vw, 1.95rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--affdp-dark);
	border: 0;
}

.affdp-rule {
	display: block;
	width: 58px;
	height: 3px;
	margin: 0 auto 14px;
	background: var(--affdp-accent);
}

.affdp .affdp-sub {
	max-width: 46em;
	margin: 0 auto;
	padding: 0;
	font-size: 0.93rem;
	color: var(--affdp-muted);
}

/* ---------- deal cards ---------- */

.affdp-panels {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.affdp .affdp-panel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	text-decoration: none;
	color: var(--affdp-text);
	background: #fff;
	border: 1px solid var(--affdp-line);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: border-color 170ms ease, box-shadow 170ms ease;
}

.affdp .affdp-panel:hover,
.affdp .affdp-panel:focus-visible {
	border-color: var(--affdp-accent);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
	outline: none;
}

.affdp-panel-label {
	display: block;
	padding: 11px 16px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--affdp-dark);
	background: var(--affdp-panel);
	border-bottom: 1px solid var(--affdp-line);
}

.affdp-panel--optics .affdp-panel-label {
	color: var(--affdp-accent);
}

.affdp-panel-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f1f1f1;
}

.affdp-panel-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 380ms ease;
}

.affdp .affdp-panel:hover .affdp-panel-media img {
	transform: scale(1.04);
}

.affdp-panel-placeholder {
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(45deg, #f1f1f1, #f1f1f1 10px, #ececec 10px, #ececec 20px);
}

.affdp-panel-body {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 16px 16px 18px;
}

.affdp-panel-title {
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--affdp-dark);
}

.affdp-panel-blurb {
	font-size: 0.86rem;
	color: var(--affdp-muted);
	margin-bottom: 10px;
}

.affdp-btn {
	align-self: flex-start;
	margin-top: auto;
	padding: 9px 18px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--affdp-accent);
	background: #fff;
	border: 1px solid var(--affdp-accent);
	border-radius: 3px;
	transition: background 160ms ease, color 160ms ease;
}

.affdp-btn i {
	font-style: normal;
	margin-left: 4px;
}

.affdp .affdp-panel:hover .affdp-btn,
.affdp .affdp-panel:focus-visible .affdp-btn {
	background: var(--affdp-accent);
	color: #fff;
}

/* ---------- optics strip ---------- */

.affdp-strip {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--affdp-line);
}

.affdp-strip-label {
	display: block;
	margin-bottom: 10px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--affdp-muted);
}

.affdp .affdp-strip-list {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	overflow-x: auto;
	margin: 0;
	padding: 0 0 4px;
	list-style: none;
	scrollbar-width: thin;
}

.affdp .affdp-strip-list li {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	list-style: none;
}

.affdp .affdp-strip-list img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	display: block;
	border: 1px solid var(--affdp-line);
	transition: border-color 150ms ease;
}

.affdp .affdp-strip-list img:hover {
	border-color: var(--affdp-accent);
}

/* ---------- note ---------- */

.affdp .affdp-note {
	margin: 18px 0 0;
	padding: 0;
	font-size: 0.72rem;
	line-height: 1.5;
	color: #8a8a8a;
	text-align: center;
}

/* ---------- settings screen copy ---------- */

.affdp--demo {
	z-index: 100000;
}

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

@media (max-width: 660px) {
	.affdp {
		padding: 0;
		align-items: flex-end;
	}

	.affdp-modal {
		max-width: none;
		max-height: 92vh;
		padding: 28px 18px 18px;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
	}

	.affdp-panels {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.affdp-panel-media {
		aspect-ratio: 21 / 9;
	}
}

@media (prefers-reduced-motion: reduce) {
	.affdp-modal,
	.affdp-backdrop,
	.affdp-panel,
	.affdp-panel-media img {
		transition: none !important;
		transform: none !important;
	}
}

/* ---------- single designed image ---------- */

.affdp--image .affdp-modal {
	width: auto;
	max-width: min(820px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	padding: 0;
	overflow: visible;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.affdp--image .affdp-close {
	top: 8px;
	right: 8px;
	z-index: 2;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.affdp--image .affdp-banner {
	display: block;
	line-height: 0;
}

.affdp--image .affdp-banner img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(820px, calc(100vw - 32px));
	max-height: calc(100vh - 64px);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.affdp--image .affdp-banner-empty {
	margin: 0;
	padding: 40px 28px;
	background: #fff;
	color: #1a1a1a;
	text-align: center;
}

@media (max-width: 660px) {
	.affdp--image {
		align-items: center;
		padding: 16px;
	}

	.affdp--image .affdp-modal {
		max-width: calc(100vw - 32px);
		max-height: calc(100vh - 32px);
		padding: 0;
		border: 0;
	}

	.affdp--image .affdp-banner img {
		max-width: calc(100vw - 32px);
		max-height: calc(100vh - 48px);
	}
}
