/*
 * Cookie consent banner — class-softsaver-consent.php prints it, consent.js
 * drives it.
 *
 * Colours are the child theme's tokens (couponis-child/style.css), each with
 * its value as a fallback so the banner keeps its contrast under any theme:
 *   text      #e7e8ee on #13142f  14.7:1
 *   link      #8a92ff on #13142f   6.5:1  (the accent #3541f5 would be 2.8:1)
 *   buttons   #13142f on #ffffff  18.0:1 (15.9:1 on hover), edge against the card 18.0:1
 *   focus     #ccdbfb ring on #13142f  12.9:1, the theme's ring on night bands
 * Both buttons share one class: neither answer is the "primary" one.
 */

.ss-consent {
	display: none;
	position: fixed;
	z-index: 1030; /* over the page and the back-to-top button, under Bootstrap modals (1040+) */
	left: 16px;
	right: 16px;
	bottom: 16px;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	max-width: 960px;
	margin: 0 auto;
	padding: 16px 20px;
	border: 1px solid var(--ss-night-edge, rgba(255, 255, 255, 0.1));
	border-radius: var(--ss-radius-card, 16px);
	background: var(--ss-night, #13142f);
	color: var(--ss-on-night, #e7e8ee);
	box-shadow: 0 20px 50px -12px rgba(0, 1, 34, 0.55);
	font-family: var(--ss-font-text, 'Open Sans', 'Segoe UI', system-ui, -apple-system, sans-serif);
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
}

/* The head script adds the class for a visitor with no stored answer, and
   consent.js for "Cookie settings". */
.asd-consent-ask .ss-consent {
	display: block;
	animation: ss-consent-in 0.2s ease-out;
}

@keyframes ss-consent-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

/* Room under the page while the banner is up, so the last coupon button can
   be scrolled clear of it. consent.js measures the banner. */
.asd-consent-ask body {
	padding-bottom: var(--asd-consent-space, 0px);
}

.ss-consent__body {
	display: flex;
	align-items: center;
	gap: 16px 24px;
}

.ss-consent__text {
	flex: 1 1 auto;
	margin: 0;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.ss-consent .ss-consent__link,
.ss-consent .ss-consent__link:visited {
	color: #8a92ff;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.ss-consent .ss-consent__link:hover {
	color: #ffffff;
}

/* Two equal columns: the longer label ("Akzeptieren") widens both buttons,
   never just its own. */
.ss-consent__actions {
	display: grid;
	flex: none;
	grid-template-columns: repeat(2, minmax(128px, 1fr));
	gap: 12px;
}

.ss-consent .ss-consent__button {
	min-width: 0;
	min-height: 44px;
	margin: 0;
	padding: 10px 20px;
	border: 1px solid var(--ss-paper, #ffffff);
	border-radius: var(--ss-radius, 10px);
	background: var(--ss-paper, #ffffff);
	color: var(--ss-night, #13142f);
	font-family: var(--ss-font-head, 'Sora', 'Segoe UI', system-ui, -apple-system, sans-serif);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
}

.ss-consent .ss-consent__button:hover {
	background: var(--ss-blue-wash, #eef0ff);
	border-color: var(--ss-blue-wash, #eef0ff);
}

/* The theme's keyboard ring, in the colour it uses on night bands. */
.ss-consent .ss-consent__button:focus-visible,
.ss-consent .ss-consent__link:focus-visible,
.ss-consent:focus-visible {
	outline: 2px solid var(--ss-on-night-muted, #ccdbfb);
	outline-offset: 2px;
}

.ss-consent:focus:not(:focus-visible) {
	outline: 0;
}

/* Phones: text above, the two buttons side by side and equally wide. */
@media (max-width: 767px) {
	.ss-consent {
		left: 8px;
		right: 8px;
		bottom: 8px;
		bottom: calc(8px + env(safe-area-inset-bottom, 0px));
		padding: 14px 14px 12px;
		border-radius: 14px;
		font-size: 13px;
		line-height: 1.45;
	}

	.ss-consent__body {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.ss-consent__actions {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.ss-consent .ss-consent__button {
		padding: 10px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.asd-consent-ask .ss-consent {
		animation: none;
	}
}

/* "Cookie settings" in the footer menu: a button dressed as its neighbours.
   Shown only once the head script has run — without it nothing can open. */
.ss-consent-menu-item,
.ss-consent-fallback {
	display: none;
}

.asd-consent-js .ss-consent-menu-item {
	display: inline-block;
}

.asd-consent-js .ss-consent-fallback {
	display: block;
	margin: 0;
	padding: 12px 16px;
	text-align: center;
}

.ss-consent-open {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	cursor: pointer;
}

.ss-consent-open:hover {
	color: var(--ss-blue, #3541f5);
}

/* Visually hidden, still read. The theme's .screen-reader-text is
   display: none, which would silence the status line. */
.ss-consent-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
