/* Retail Deals catalog — light product catalog tokens
   Source of truth: deals-catalog-demo.html (light). Sidebar layout from deals-layout-sidebar.html.
   Plugin-scoped so catalog stays light even if the site theme Additional CSS is dark. */

.rd-wrap {
	--rd-bg: #f6f7f9;
	--rd-card: #fff;
	--rd-text: #1a1a1a;
	--rd-muted: #6b7280;
	--rd-border: #e5e7eb;
	--rd-accent: #111827;
	--rd-price: #0f766e;
	--rd-chip: #f3f4f6;
	--rd-input: #fff;
	--rd-chip-text: #374151;
	--rd-img-grad: linear-gradient(145deg, #eef2f7, #f8fafc);
	box-sizing: border-box;
	color: var(--rd-text);
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	margin: 0 0 2rem;
	background: var(--rd-bg);
	padding: clamp(0.75rem, 2vw, 1.25rem);
	border-radius: 14px;
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
	color-scheme: light;
	isolation: isolate;
}

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

.rd-header {
	background: var(--rd-card);
	border: 1px solid var(--rd-border);
	border-radius: 12px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.25rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: flex-start;
	justify-content: space-between;
}

.rd-title {
	margin: 0;
	font-size: clamp(1.1rem, 2.5vw, 1.25rem);
	line-height: 1.3;
	color: var(--rd-text);
	font-weight: 700;
}

.rd-note {
	margin: 0.3rem 0 0;
	color: var(--rd-muted);
	font-size: 0.85rem;
	width: 100%;
}

.rd-shell {
	max-width: 1240px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
	gap: clamp(1rem, 2.5vw, 1.5rem);
	align-items: start;
	width: 100%;
}

.rd-aside {
	position: sticky;
	top: 1rem;
	background: var(--rd-card);
	border: 1px solid var(--rd-border);
	border-radius: 12px;
	padding: 1rem;
	min-width: 0;
}

.rd-aside-title {
	margin: 0 0 1rem;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rd-muted);
	font-weight: 600;
}

.rd-aside label {
	display: block;
	font-size: 0.84rem;
}

.rd-checks {
	display: grid;
	gap: 0.55rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--rd-border);
	max-height: min(280px, 40vh);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.rd-checks label {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	color: #374151;
	cursor: pointer;
	min-height: 28px;
	padding: 0.15rem 0;
	touch-action: manipulation;
}

.rd-checks input {
	accent-color: var(--rd-accent);
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
}

.rd-field {
	margin-top: 1rem;
}

.rd-field-label {
	color: var(--rd-muted);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 0.4rem;
}

.rd-aside input[type="search"],
.rd-aside input[type="number"],
.rd-meta select,
.rd-wrap input[type="search"],
.rd-wrap input[type="number"],
.rd-wrap select {
	width: 100%;
	padding: 0.55rem 0.65rem;
	border: 1px solid var(--rd-border);
	border-radius: 8px;
	background: var(--rd-input);
	font: inherit;
	color: var(--rd-text);
	min-height: 40px;
	touch-action: manipulation;
}

.rd-aside input[type="search"]::placeholder,
.rd-aside input[type="number"]::placeholder {
	color: var(--rd-muted);
}

.rd-price-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.45rem;
}

.rd-reset {
	width: 100%;
	margin-top: 1rem;
	padding: 0.55rem;
	border: 1px solid var(--rd-border);
	border-radius: 8px;
	background: #fff;
	color: var(--rd-accent);
	font: inherit;
	cursor: pointer;
	min-height: 40px;
	touch-action: manipulation;
}

.rd-reset:hover {
	background: var(--rd-chip);
}

.rd-main {
	min-width: 0;
}

.rd-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
	color: var(--rd-muted);
	font-size: 0.9rem;
}

.rd-meta select {
	width: auto;
	min-width: 8rem;
}

.rd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	gap: clamp(0.75rem, 2vw, 1rem);
	width: 100%;
}

.rd-product {
	background: var(--rd-card);
	border: 1px solid var(--rd-border);
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-width: 0;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
	text-decoration: none;
	color: inherit;
	height: 100%;
}

a.rd-product:hover,
.rd-product:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
	color: inherit;
	text-decoration: none;
}

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

.rd-img {
	aspect-ratio: 1;
	background: var(--rd-img-grad);
	display: grid;
	place-items: center;
	color: var(--rd-muted);
	font-size: 0.8rem;
	border-bottom: 1px solid var(--rd-border);
	position: relative;
	overflow: hidden;
}

.rd-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.rd-img-placeholder {
	font-size: 2.2rem;
	line-height: 1;
}

.rd-badge {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	background: var(--rd-accent);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 600;
	padding: 0.2rem 0.45rem;
	border-radius: 6px;
	z-index: 1;
	max-width: calc(100% - 1.2rem);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rd-body {
	padding: 0.85rem 0.9rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	flex: 1;
	min-width: 0;
}

.rd-retailer {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rd-muted);
	font-weight: 600;
}

.rd-name {
	font-size: 0.95rem;
	font-weight: 650;
	line-height: 1.3;
	margin: 0;
	color: var(--rd-text);
	overflow-wrap: anywhere;
	word-break: break-word;
}

.rd-name a {
	color: inherit;
	text-decoration: none;
}

.rd-name a:hover {
	text-decoration: underline;
}

.rd-price {
	font-size: 1.15rem;
	font-weight: 750;
	color: var(--rd-price);
	margin-top: 0.15rem;
}

.rd-price.rd-na {
	color: var(--rd-muted);
	font-size: 0.95rem;
	font-weight: 600;
}

.rd-sku,
.rd-seen {
	font-size: 0.75rem;
	color: var(--rd-muted);
}

.rd-sku code,
.rd-code {
	background: var(--rd-chip);
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
	color: var(--rd-chip-text);
	font-size: 0.72rem;
	word-break: break-all;
}

.rd-foot {
	margin-top: auto;
	padding-top: 0.55rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.rd-btn {
	display: inline-block;
	padding: 0.45rem 0.75rem;
	border-radius: 8px;
	background: var(--rd-accent);
	color: #fff !important;
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none !important;
	white-space: nowrap;
	min-height: 36px;
	line-height: 1.4;
	touch-action: manipulation;
	border: none;
	cursor: pointer;
}

.rd-btn:hover {
	opacity: 0.92;
}

.rd-btn.rd-ghost {
	background: #fff;
	color: var(--rd-accent) !important;
	border: 1px solid var(--rd-border);
}

.rd-empty {
	grid-column: 1 / -1;
	background: var(--rd-card);
	border: 1px dashed var(--rd-border);
	padding: 2rem 1rem;
	text-align: center;
	color: var(--rd-muted);
	border-radius: 12px;
}

.rd-muted {
	color: var(--rd-muted);
	font-size: 0.84rem;
}

/* —— Single / detail view —— */
.rd-detail {
	max-width: 960px;
	margin: 0 auto;
}

.rd-detail-back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 1rem;
	color: var(--rd-muted);
	text-decoration: none;
	font-size: 0.9rem;
	min-height: 36px;
}

.rd-detail-back:hover {
	color: var(--rd-accent);
}

.rd-detail-card {
	background: var(--rd-card);
	border: 1px solid var(--rd-border);
	border-radius: 14px;
	overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
	gap: 0;
}

.rd-detail-media {
	background: var(--rd-img-grad);
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	border-right: 1px solid var(--rd-border);
	position: relative;
	min-height: 200px;
}

.rd-detail-media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.rd-detail-body {
	padding: clamp(1rem, 3vw, 1.5rem);
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-width: 0;
}

.rd-detail-title {
	margin: 0;
	font-size: clamp(1.15rem, 3vw, 1.45rem);
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.rd-detail-price {
	font-size: clamp(1.35rem, 3vw, 1.6rem);
	font-weight: 750;
	color: var(--rd-price);
}

.rd-detail-price.rd-na {
	color: var(--rd-muted);
	font-size: 1.1rem;
}

.rd-dl {
	display: grid;
	grid-template-columns: minmax(6.5rem, 8rem) minmax(0, 1fr);
	gap: 0.4rem 0.75rem;
	margin: 0.5rem 0 0;
	font-size: 0.88rem;
}

.rd-dl dt {
	margin: 0;
	color: var(--rd-muted);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding-top: 0.15rem;
}

.rd-dl dd {
	margin: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.rd-dl a {
	color: var(--rd-accent);
	word-break: break-all;
}

.rd-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.rd-history {
	margin-top: 1.5rem;
	background: var(--rd-card);
	border: 1px solid var(--rd-border);
	border-radius: 14px;
	padding: clamp(1rem, 3vw, 1.25rem);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.rd-history h2 {
	margin: 0 0 0.85rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.rd-history-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	min-width: 420px;
}

.rd-history-table th,
.rd-history-table td {
	text-align: left;
	padding: 0.55rem 0.65rem;
	border-bottom: 1px solid var(--rd-border);
	vertical-align: top;
}

.rd-history-table th {
	color: var(--rd-muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 600;
	background: var(--rd-chip);
}

.rd-history-table code {
	background: var(--rd-chip);
	padding: 0.1rem 0.35rem;
	border-radius: 4px;
	color: var(--rd-chip-text);
	font-size: 0.72rem;
	word-break: break-all;
}

.rd-history-empty {
	color: var(--rd-muted);
	font-size: 0.9rem;
	margin: 0;
}

/* Responsive breakpoints */
@media (max-width: 900px) {
	.rd-detail-card {
		grid-template-columns: 1fr;
	}

	.rd-detail-media {
		border-right: none;
		border-bottom: 1px solid var(--rd-border);
		max-height: 360px;
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 720px) {
	.rd-wrap {
		padding: 0.75rem;
		border-radius: 10px;
	}

	.rd-shell {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.rd-aside {
		position: static;
	}

	.rd-checks {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		max-height: none;
	}

	.rd-grid {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
	}

	.rd-dl {
		grid-template-columns: 1fr;
		gap: 0.15rem 0;
	}

	.rd-dl dt {
		padding-top: 0.5rem;
	}
}

@media (max-width: 420px) {
	.rd-checks {
		grid-template-columns: 1fr;
	}

	.rd-grid {
		grid-template-columns: 1fr;
	}

	.rd-price-fields {
		grid-template-columns: 1fr;
	}

	.rd-meta {
		flex-direction: column;
		align-items: stretch;
	}

	.rd-meta select {
		width: 100%;
	}
}
