/* Zľavy a kupóny: stránka (page-zlavy-a-kupony.php), záložka s panelom na celom webe, kódy v košíku.
   PHP: includes/theme/inc/discounts.php, JS: assets/js/discounts.js. */

:root {
	--disc-brand: var(--nd-c-brand, #5b2d82);
	--disc-tint: var(--nd-c-brand-tint, #f4eef9);
	--disc-ink: var(--nd-c-head, #1d1d1f);
	--disc-muted: var(--nd-c-muted, #6b6b73);
	--disc-line: var(--nd-c-line, #e4e4ea);
	--disc-soft: var(--nd-c-surface-muted, #f6f6f8);
	--disc-hot: var(--nd-c-sale, #ea7e1e);
	--disc-ok: #1b7f4b;
	--disc-r: 12px;
}

.disc-ico {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	vertical-align: -3px;
}

/* ---------- Stránka ---------- */
.disc-page {
	display: block;
	flex: 1 0 100%;
	width: 100%;
	padding-bottom: 72px;
	color: var(--disc-ink);
}

.disc-hero {
	padding: 32px 0 28px;
	background: linear-gradient(135deg, var(--disc-tint), #fff 70%);
	border-bottom: 1px solid var(--disc-line);
}

.disc-hero__kicker {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--disc-brand);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.disc-hero h1 {
	margin: 0 0 8px;
	font-size: clamp(30px, 4vw, 44px);
	line-height: 1.1;
}

.disc-hero__sub {
	max-width: 62ch;
	margin: 0;
	font-size: 17px;
}

.disc-sec {
	padding: 36px 0 0;
	scroll-margin-top: 64px;
}

/* Kontajner témy zarovnáva deti doľava – obsah na plnú šírku. */
.disc-sec .wa-container > * {
	align-self: stretch;
	width: 100%;
}

.disc-sec h2 {
	margin: 0 0 14px;
	font-size: 24px;
}

.disc-code {
	display: flex;
	align-items: stretch;
	max-width: 240px;
	border: 2px dashed var(--disc-brand);
	border-radius: 8px;
	overflow: hidden;
}

.disc-code code {
	flex: 1;
	padding: 6px 10px;
	background: var(--disc-tint);
	color: var(--disc-ink);
	font: 800 15px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: 0.04em;
}

.disc-copy {
	padding: 0 12px;
	border: 0;
	background: var(--disc-brand);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.disc-copy.is-done,
.disc-chips .disc-chip.is-done {
	opacity: 1;
	background: var(--disc-ok);
	border-color: var(--disc-ok);
	color: #fff;
}

.disc-code--sm code {
	padding: 5px 9px;
	font-size: 14px;
}

.disc-code--static {
	border-style: solid;
}

.disc-code--static span {
	display: flex;
	align-items: center;
	padding: 0 10px;
	background: var(--disc-brand);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.disc-link {
	display: block;
	margin-top: 6px;
	color: var(--disc-brand) !important;
	font-weight: 700;
	text-decoration: none !important;
}

.disc-link:hover {
	text-decoration: underline !important;
}

.disc-badge {
	display: inline-block;
	margin-bottom: 6px;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	white-space: nowrap;
}

.disc-badge--code {
	background: var(--disc-brand);
	color: #fff;
}

.disc-badge--auto {
	background: #e3f4ea;
	color: var(--disc-ok);
}

.disc-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--disc-line);
	border-radius: var(--disc-r);
}

.disc-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 14px;
}

.disc-table th,
.disc-table td {
	padding: 12px 14px;
	border: 0;
	border-bottom: 1px solid var(--disc-line);
	text-align: left;
	vertical-align: top;
}

.disc-table thead th {
	background: var(--disc-soft);
	color: var(--disc-muted);
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.disc-table tbody th {
	min-width: 180px;
	font-weight: 600;
}

.disc-table td:nth-child(4) {
	min-width: 110px;
}

.disc-table tbody th b {
	color: var(--disc-hot);
}

.disc-table td small {
	display: block;
	color: var(--disc-muted);
}

.disc-table tbody tr:last-child > * {
	border-bottom: 0;
}

.disc-tiers {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.disc-tiers li {
	display: grid;
	padding: 4px 8px;
	border-radius: 8px;
	background: var(--disc-soft);
	font-size: 12px;
	text-align: center;
}

.disc-tiers b {
	color: var(--disc-brand);
	font-size: 14px;
}

.disc-rules {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: disc;
}

.disc-rules li {
	position: relative;
	padding: 12px 14px 12px 50px;
	border-radius: 10px;
	background: var(--disc-soft);
	counter-increment: disc;
}

.disc-rules li::before {
	content: counter(disc);
	position: absolute;
	top: 10px;
	left: 14px;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 999px;
	background: var(--disc-brand);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
}

.disc-rules li[hidden],
.disc-table [hidden] {
	display: none;
}

.disc-faq details {
	border-bottom: 1px solid var(--disc-line);
}

.disc-faq summary {
	padding: 14px 0;
	font-weight: 700;
	cursor: pointer;
}

.disc-faq p {
	margin: 0 0 14px;
	color: var(--disc-muted);
}

/* ---------- Kódy v košíku ---------- */
.disc-chips {
	display: grid;
	flex-basis: 100%;
	gap: 8px;
	width: 100%;
	margin: 10px 0 0;
	padding: 12px;
	border-radius: 10px;
	background: var(--disc-tint);
	font-size: 14px;
	text-align: left;
}

.disc-chips p {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.disc-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.disc-chip {
	padding: 5px 10px;
	border: 1.5px dashed var(--disc-brand);
	border-radius: 999px;
	background: #fff;
	color: var(--disc-brand);
	font: 800 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
	cursor: pointer;
}

.disc-chip:hover {
	background: var(--disc-brand);
	color: #fff;
}

.disc-chip[hidden] {
	display: none;
}

/* ---------- Záložka a panel (vľavo; na mobile úzka vpravo, chat je vpravo dole) ---------- */
.disc-tab {
	position: fixed;
	top: 50%;
	left: 0;
	z-index: 9990;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 8px;
	border: 0;
	border-radius: 0 12px 12px 0;
	background: var(--disc-hot);
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	transform: translateY(-50%);
}

.disc-tab span {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
}

.disc-tab b {
	display: grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	border-radius: 999px;
	background: #fff;
	color: var(--disc-hot);
	font-size: 12px;
}

.disc-backdrop {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	background: rgba(0, 0, 0, 0.4);
}

.disc-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483647; /* ako odznak Heureky; JS panel presunie na koniec stránky */
	width: min(420px, 92vw);
	overflow-y: auto;
	background: #fff;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
	color: var(--disc-ink);
}

.disc-drawer[hidden],
.disc-backdrop[hidden],
.disc-list li[hidden] {
	display: none;
}

.disc-lock,
.disc-lock body {
	overflow: hidden;
}

.disc-drawer__in {
	display: grid;
	gap: 10px;
	padding: 18px;
}

.disc-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.disc-drawer h2 {
	margin: 0;
	font-size: 22px;
}

.disc-drawer h3 {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 0;
	font-size: 15px;
}

.disc-drawer__x {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: var(--disc-soft);
	color: var(--disc-ink);
	font-size: 22px;
	cursor: pointer;
}

.disc-list {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.disc-list li {
	display: grid;
	grid-template-columns: 74px 1fr;
	align-items: center;
	gap: 6px 10px;
	padding: 10px;
	border: 1px solid var(--disc-line);
	border-radius: 10px;
}

.disc-list__amt {
	color: var(--disc-hot);
	font-size: 16px;
	font-weight: 800;
}

.disc-list__txt {
	font-size: 14px;
	font-weight: 600;
}

.disc-list__txt small {
	display: block;
	color: var(--disc-muted);
	font-weight: 400;
}

.disc-list .disc-code {
	grid-column: 1 / -1;
	max-width: none;
}

.disc-drawer__note {
	margin: 0;
	color: var(--disc-muted);
	font-size: 13px;
}

.disc-btn {
	display: block;
	margin-top: 6px;
	padding: 12px;
	border-radius: 10px;
	background: var(--disc-brand);
	color: #fff !important;
	font-weight: 800;
	text-align: center;
	text-decoration: none !important;
}

@media (max-width: 720px) {
	.disc-hero {
		padding: 24px 0 20px;
	}

	/* Tabuľka ako karty: názov stĺpca nad hodnotou. */
	.disc-table thead {
		display: none;
	}

	.disc-table,
	.disc-table tbody,
	.disc-table tr,
	.disc-table th,
	.disc-table td {
		display: block;
		width: 100%;
	}

	.disc-table tr {
		border-bottom: 1px solid var(--disc-line);
	}

	.disc-table th,
	.disc-table td {
		padding: 6px 14px;
		border: 0;
	}

	.disc-table tbody th {
		padding-top: 14px;
		font-size: 16px;
	}

	.disc-table td::before {
		content: attr(data-th);
		display: block;
		color: var(--disc-muted);
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
	}

	.disc-table tbody tr:last-child td:last-child {
		padding-bottom: 14px;
	}

	.disc-table tr[hidden] {
		display: none;
	}

	/* Úzka záložka vpravo: menší text, % a počet; panel sa otvorí sprava. */
	.disc-tab {
		right: 0;
		left: auto;
		gap: 3px;
		padding: 5px 2px;
		border-radius: 6px 0 0 6px;
		box-shadow: -4px 4px 14px rgba(0, 0, 0, 0.18);
	}

	.disc-tab span {
		font-size: 10px;
		line-height: 1;
		letter-spacing: 0.02em;
	}

	.disc-tab svg {
		width: 12px;
		height: 12px;
	}

	.disc-tab b {
		min-width: 14px;
		height: 14px;
		font-size: 9px;
	}

	.disc-drawer {
		right: 0;
		left: auto;
	}
}

@media print {
	.disc-tab,
	.disc-drawer,
	.disc-backdrop {
		display: none !important;
	}
}
