/*
 * Shop on Deals - coupon store archive.
 *
 * Scoped to .sod-store-header and .sod-listing so nothing leaks into the rest of
 * the theme. Selectors stay single-class where possible; the few !important
 * declarations override Couponis' own high-specificity archive rules and are
 * marked where they appear.
 */

.sod-store-header {
	--sod-badge: #d81e5b;
	--sod-ink: #141a2e;
	--sod-soft: #5b6478;
	--sod-rule: #e6e4e0;
	--sod-ok: #0b7a5a;
	--sod-ok-bg: #e6f4ef;
}

/* ---------------------------------------------------------------- header */

.sod-store-header .white-block-content {
	padding: 26px 28px 22px;
}

.sod-sh {
	display: flex;
	align-items: center;
	gap: 26px;
	flex-wrap: wrap;
}

.sod-sh__logo {
	flex: 0 0 auto;
	width: 148px;
	height: 108px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 16px;
	border: 1px solid var(--sod-rule);
	border-radius: 12px;
	background: #fff;
}

.sod-sh__logo img {
	max-width: 100%;
	max-height: 76px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.sod-sh__main {
	flex: 1 1 300px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.sod-sh__title {
	margin: 0;
	font-size: 30px;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--sod-ink);
	text-wrap: balance;
}

/* ------------------------------------------------------------- rating */

.sod-rating {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--sod-soft);
}

.sod-stars {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	line-height: 1;
	font-size: 16px;
	letter-spacing: 2px;
}

.sod-stars__base {
	color: #d8d5d0;
}

.sod-stars__fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	color: #f0a53c;
	white-space: nowrap;
}

.sod-rating__score {
	color: var(--sod-ink);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.sod-sh__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.sod-sh__validated {
	margin: 0;
	font-size: 12.5px;
	color: var(--sod-ok);
	font-weight: 600;
}

.sod-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 11px;
	border-radius: 100px;
	border: 1px solid var(--sod-rule);
	background: #fbfaf8;
	font-size: 12.5px;
	line-height: 1.6;
	color: var(--sod-soft);
	font-variant-numeric: tabular-nums;
}

.sod-pill--ok {
	color: var(--sod-ok);
	background: var(--sod-ok-bg);
	border-color: transparent;
	font-weight: 600;
}

.sod-sh__best {
	font-size: 13px;
	color: var(--sod-soft);
}

.sod-sh__best strong {
	color: var(--sod-badge);
	font-weight: 800;
}

.sod-sh__cta {
	flex: 0 0 auto;
	margin-left: auto;
	align-self: center;
}

.sod-btn {
	display: block;
	min-width: 190px;
	padding: 16px 32px;
	border-radius: 8px;
	background: var(--sod-badge);
	color: #fff;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/*
 * The theme drops its grid/list toggle into the header with absolute
 * positioning, which lands it on top of the call to action. Put it back in
 * flow, under the row, where it does not collide.
 */
.sod-store-header .single-tax-action {
	position: static !important;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 12px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--sod-rule);
	top: auto !important;
	right: auto !important;
}

.sod-btn:hover,
.sod-btn:focus {
	background: #bb1a4f;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(216, 30, 91, 0.28);
}

.sod-btn:focus-visible {
	outline: 3px solid rgba(216, 30, 91, 0.4);
	outline-offset: 2px;
}

.sod-sh__desc {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--sod-rule);
	color: var(--sod-soft);
	font-size: 14.5px;
}

/* ------------------------------------------------------- discount badge */

/*
 * The badge is drawn from data attributes set on the column wrapper, so the
 * theme's own coupon card markup is not modified and keeps working if the theme
 * updates. Cards whose title states no figure simply get no badge.
 */
.sod-col {
	position: relative;
}

/*
 * The saving rides on the LOGO tile as a corner ribbon, so it reads as part of the
 * coupon image rather than floating over the card. Real markup rather than a CSS
 * attr() badge, because attr() cannot be read across elements and the ribbon has
 * to sit inside the logo's own box.
 */
.sod-logo-wrap {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.sod-ribbon {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 4;
	padding: 5px 11px 5px 9px;
	border-radius: 6px 0 8px 0;
	background: var(--sod-badge, #d81e5b);
	color: #fff;
	font-size: 12.5px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.01em;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
	box-shadow: 0 2px 6px rgba(216, 30, 91, 0.3);
}

/* Grid cards show a smaller logo, so the ribbon scales with it. */
.coupon-grid .sod-ribbon {
	font-size: 11.5px;
	padding: 4px 9px 4px 7px;
}

/* ----------------------------------------------- verified + terms */

/*
 * The verified marker sits inside the theme's existing coupon-top-meta row,
 * beside the exclusive badge and usage count. An earlier version gave it its own
 * full-width footer, which stranded a lone green chip on a divider whenever the
 * weekly usage figure was zero.
 */
.coupon-top-meta .sod-verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--sod-ok, #0b7a5a);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	line-height: 1;
}

/* Native <details> so open and close work without JavaScript and stay keyboard
   accessible. Only the marker is restyled. */
.sod-terms {
	margin-top: 8px;
}

.sod-terms__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	list-style: none;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--sod-soft, #5b6478);
	padding: 2px 0;
	border-radius: 4px;
	user-select: none;
}

.sod-terms__toggle::-webkit-details-marker {
	display: none;
}

/* A chevron that rotates on open, rather than a boxed +/- glyph. */
.sod-terms__toggle::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-left: 1px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.18s ease;
}

.sod-terms[open] .sod-terms__toggle::after {
	transform: translateY(1px) rotate(225deg);
}

.sod-terms__toggle:hover,
.sod-terms[open] .sod-terms__toggle {
	color: var(--sod-badge, #d81e5b);
}

.sod-terms__toggle:focus-visible {
	outline: 2px solid var(--sod-badge, #d81e5b);
	outline-offset: 2px;
}

.sod-terms__body {
	margin-top: 9px;
	padding: 13px 15px;
	background: #fbfaf8;
	border: 1px solid var(--sod-rule, #e6e4e0);
	border-left: 3px solid var(--sod-badge, #d81e5b);
	border-radius: 0 8px 8px 0;
	font-size: 12.5px;
	line-height: 1.65;
	color: var(--sod-soft, #5b6478);
	animation: sod-terms-in 0.18s ease;
}

@keyframes sod-terms-in {
	from { opacity: 0; transform: translateY(-3px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.sod-terms__body { animation: none; }
	.sod-terms__toggle::after { transition: none; }
}

.sod-terms__intro {
	font-weight: 600;
	color: var(--sod-ink, #141a2e);
	margin-bottom: 8px;
}

.sod-terms__list {
	margin: 0 0 10px;
	padding-left: 18px;
	list-style: disc;
}

.sod-terms__list li {
	margin: 0 0 4px;
}

.sod-terms__foot {
	margin: 0;
	padding-top: 9px;
	border-top: 1px solid var(--sod-rule, #e6e4e0);
	font-size: 11.5px;
	opacity: 0.9;
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 782px) {
	.sod-sh {
		gap: 16px;
	}

	.sod-sh__cta {
		flex: 1 1 100%;
		margin-left: 0;
	}

	.sod-btn {
		display: block;
		text-align: center;
	}

	.sod-sh__title {
		font-size: 21px;
	}

}

@media (prefers-reduced-motion: reduce) {
	.sod-btn {
		transition: none;
	}

	.sod-btn:hover,
	.sod-btn:focus {
		transform: none;
	}
}
