/* ALW Specials — popup, announcement bar, sticky tab and the Specials page.
   Everything is namespaced .alw-sp-* so nothing here can leak into the theme.
   Colours mirror alw-theme's custom properties, with hard fallbacks in case
   this ever renders outside that theme. */

.alw-sp-modal,
.alw-sp-banner,
.alw-sp-tab,
.alw-sp-list {
	--sp-navy: var(--navy, #1B2A4A);
	--sp-red:  var(--red,  #C8102E);
	--sp-gold: var(--gold, #D4A843);
	--sp-ink:  var(--ink,  #1d1d1f);
	--sp-muted: var(--muted, #6e6e73);
	--sp-line: var(--line, #e8e8ed);
	--sp-radius: var(--radius, 18px);
	--sp-accent: var(--sp-red);
}

.alw-sp-accent--navy { --sp-accent: var(--sp-navy); }
.alw-sp-accent--gold { --sp-accent: var(--sp-gold); }
.alw-sp-accent--red  { --sp-accent: var(--sp-red); }

/* The theme sets display on plenty of block elements; make sure [hidden] wins.
   (Same class of bug that made every modal in the sales app un-closable.) */
.alw-sp-modal[hidden],
.alw-sp-banner[hidden],
.alw-sp-tab[hidden] { display: none !important; }

/* ── Popup ─────────────────────────────────────────────────────────── */

.alw-sp-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.alw-sp-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 41, 0.55);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .22s ease;
}
.alw-sp-modal.is-open .alw-sp-modal__backdrop { opacity: 1; }

.alw-sp-modal__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 860px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	border-radius: var(--sp-radius);
	box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
	display: grid;
	grid-template-columns: 1fr 1fr;
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transition: opacity .22s ease, transform .22s ease;
}
.alw-sp-modal.is-open .alw-sp-modal__panel { opacity: 1; transform: none; }

/* No image = single column, narrower panel. */
.alw-sp-modal__panel:not(:has(.alw-sp-modal__media)) {
	grid-template-columns: 1fr;
	max-width: 520px;
}

.alw-sp-modal__media {
	background: var(--sp-navy);
	overflow: hidden;
	border-radius: var(--sp-radius) 0 0 var(--sp-radius);
}
.alw-sp-modal__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.alw-sp-modal__body { padding: 34px 32px 28px; }

.alw-sp-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 2;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: var(--sp-ink);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
	transition: background .15s ease, transform .15s ease;
}
.alw-sp-modal__close:hover { background: #fff; transform: scale(1.06); }
.alw-sp-modal__close:focus-visible { outline: 3px solid var(--sp-accent); outline-offset: 2px; }

/* ── Shared content bits (popup + cards) ───────────────────────────── */

.alw-sp-eyebrow {
	margin: 0 0 8px;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--sp-accent);
}

.alw-sp-headline,
.alw-sp-card__title {
	margin: 0 0 10px;
	font-size: 1.75rem;
	line-height: 1.15;
	font-weight: 700;
	color: var(--sp-navy);
}

.alw-sp-sub {
	margin: 0 0 14px;
	font-size: 1.02rem;
	color: var(--sp-muted);
	line-height: 1.45;
}

.alw-sp-copy { font-size: .96rem; color: var(--sp-ink); line-height: 1.55; }
.alw-sp-copy p { margin: 0 0 10px; }

.alw-sp-coupon {
	margin: 18px 0;
	padding: 14px 16px;
	border: 2px dashed var(--sp-accent);
	border-radius: 12px;
	background: rgba(200, 16, 46, .04);
	text-align: center;
}
.alw-sp-accent--navy .alw-sp-coupon { background: rgba(27, 42, 74, .05); }
.alw-sp-accent--gold .alw-sp-coupon { background: rgba(212, 168, 67, .1); }

.alw-sp-coupon__label {
	display: block;
	font-size: .72rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--sp-muted);
	margin-bottom: 4px;
}
.alw-sp-coupon__code {
	display: inline-flex;
	align-items: baseline;
	gap: 10px;
	border: 0;
	background: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 1.45rem;
	font-weight: 800;
	letter-spacing: .06em;
	color: var(--sp-navy);
	padding: 2px 6px;
	border-radius: 8px;
	transition: background .15s ease;
}
.alw-sp-coupon__code:hover { background: rgba(0, 0, 0, .05); }
.alw-sp-coupon__code.is-copied { color: #1e7d3e; }
.alw-sp-coupon__hint {
	font-size: .7rem;
	font-style: normal;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--sp-muted);
}
.alw-sp-coupon__note { margin: 6px 0 0; font-size: .82rem; color: var(--sp-muted); }

.alw-sp-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 18px;
}

.alw-sp-btn {
	display: inline-block;
	padding: 13px 26px;
	border: 0;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.alw-sp-btn--primary {
	background: var(--sp-accent);
	color: #fff;
	box-shadow: 0 6px 18px rgba(200, 16, 46, .25);
}
.alw-sp-accent--navy .alw-sp-btn--primary { box-shadow: 0 6px 18px rgba(27, 42, 74, .25); }
.alw-sp-accent--gold .alw-sp-btn--primary { color: var(--sp-navy); box-shadow: 0 6px 18px rgba(212, 168, 67, .3); }
.alw-sp-btn--primary:hover { transform: translateY(-1px); color: #fff; }
.alw-sp-accent--gold .alw-sp-btn--primary:hover { color: var(--sp-navy); }

.alw-sp-btn--quiet {
	background: transparent;
	color: var(--sp-muted);
	padding: 13px 10px;
	font-weight: 500;
}
.alw-sp-btn--quiet:hover { color: var(--sp-ink); text-decoration: underline; }
.alw-sp-btn:focus-visible { outline: 3px solid var(--sp-navy); outline-offset: 2px; }

.alw-sp-ends {
	margin: 14px 0 0;
	font-size: .82rem;
	font-weight: 600;
	color: var(--sp-accent);
}
.alw-sp-actions .alw-sp-ends { margin: 0; }

.alw-sp-fine { margin: 12px 0 0; font-size: .76rem; color: var(--sp-muted); line-height: 1.4; }

.alw-sp-seeall { margin: 16px 0 0; font-size: .85rem; }
.alw-sp-seeall a { color: var(--sp-muted); text-decoration: underline; }
.alw-sp-seeall a:hover { color: var(--sp-navy); }

body.alw-sp-locked { overflow: hidden; }

/* ── Sticky tab ────────────────────────────────────────────────────── */

.alw-sp-tab {
	position: fixed;
	left: 0;
	bottom: 28px;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px 12px 14px;
	border: 0;
	border-radius: 0 999px 999px 0;
	background: var(--sp-red);
	color: #fff;
	font-family: inherit;
	font-size: .92rem;
	font-weight: 700;
	letter-spacing: .02em;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
	transition: transform .18s ease, background .18s ease;
}
.alw-sp-tab:hover { transform: translateX(3px); background: var(--red-dark, #a50d25); }
.alw-sp-tab:focus-visible { outline: 3px solid var(--sp-navy); outline-offset: 3px; }
.alw-sp-tab__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	font-size: .8rem;
	font-weight: 800;
}

/* ── Announcement bar ──────────────────────────────────────────────── */

.alw-sp-banner {
	position: relative;
	z-index: 1000;
	background: var(--sp-accent);
	color: #fff;
}
.alw-sp-accent--gold.alw-sp-banner { color: var(--sp-navy); }

.alw-sp-banner__inner {
	max-width: var(--maxw, 1200px);
	margin: 0 auto;
	padding: 10px 48px 10px 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
	font-size: .92rem;
}
.alw-sp-banner__text { margin: 0; }
.alw-sp-banner__text strong { letter-spacing: .1em; text-transform: uppercase; font-size: .76rem; margin-right: 6px; }
.alw-sp-banner__code {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 10px;
	border: 1px dashed currentColor;
	border-radius: 6px;
	font-weight: 800;
	letter-spacing: .06em;
}
.alw-sp-banner__cta {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	white-space: nowrap;
}
.alw-sp-banner__close {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .18);
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.alw-sp-banner__close:hover { background: rgba(255, 255, 255, .3); }

/* ── Specials page ─────────────────────────────────────────────────── */

.alw-sp-list { display: grid; gap: 28px; margin: 8px 0 40px; }

.alw-sp-card {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 0;
	border: 1px solid var(--sp-line);
	border-radius: var(--sp-radius);
	overflow: hidden;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}
.alw-sp-card:not(:has(.alw-sp-card__media)) { grid-template-columns: 1fr; }
.alw-sp-card::before {
	content: "";
	grid-column: 1 / -1;
	height: 5px;
	background: var(--sp-accent);
}
.alw-sp-card__media { grid-column: 1; }
.alw-sp-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.alw-sp-card__body { padding: 28px 30px; }

.alw-sp-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 16px;
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--sp-line);
}
.alw-sp-product { display: block; text-decoration: none; color: inherit; text-align: center; }
.alw-sp-product__img img { width: 100%; height: auto; border-radius: 10px; display: block; }
.alw-sp-product__name {
	display: block;
	margin-top: 8px;
	font-size: .82rem;
	line-height: 1.3;
	color: var(--sp-ink);
}
.alw-sp-product__price { display: block; font-size: .82rem; font-weight: 700; color: var(--sp-navy); }
.alw-sp-product:hover .alw-sp-product__name { color: var(--sp-accent); }

.alw-sp-empty {
	padding: 40px 0 60px;
	text-align: center;
	color: var(--sp-muted);
}
.alw-sp-empty h2 { color: var(--sp-navy); margin-bottom: 8px; }

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 782px) {
	.alw-sp-modal { padding: 12px; }
	.alw-sp-modal__panel,
	.alw-sp-modal__panel:not(:has(.alw-sp-modal__media)) {
		grid-template-columns: 1fr;
		max-width: 460px;
	}
	.alw-sp-modal__media {
		border-radius: var(--sp-radius) var(--sp-radius) 0 0;
		max-height: 170px;
	}
	.alw-sp-modal__body { padding: 24px 22px 22px; }
	.alw-sp-headline, .alw-sp-card__title { font-size: 1.45rem; }
	.alw-sp-actions { flex-direction: column; align-items: stretch; }
	.alw-sp-btn { text-align: center; }

	.alw-sp-card { grid-template-columns: 1fr; }
	.alw-sp-card__media { max-height: 200px; }
	.alw-sp-card__body { padding: 22px 20px; }

	.alw-sp-tab { bottom: 16px; padding: 10px 14px 10px 11px; font-size: .84rem; }
	.alw-sp-banner__inner { padding: 9px 44px 9px 14px; font-size: .84rem; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.alw-sp-modal__panel,
	.alw-sp-modal__backdrop,
	.alw-sp-btn,
	.alw-sp-tab { transition: none; }
	.alw-sp-modal__panel { transform: none; }
}
