/* ==========================================================================
   Cookie consent notice (markup: inc/cookie-consent.php,
   logic: assets/js/cookie-consent.js)

   Non-modal: .av-cookie is a compact white panel fixed to the bottom edge
   only — no backdrop, nothing covers the rest of the page, so it stays
   scrollable, clickable and keyboard-accessible. Content follows the same
   container as the sections (--av-container + spacing-50 gutter).
   ≥900px: title + text on the left, «Отклонить» / «Принять» on the right.
   Narrower: text on top, buttons below (side by side down to 340px).
   Starts `hidden`; the script un-hides it, toggles .is-visible for the
   slide-in and .is-paused while a modal <dialog> (region) is open.
   z-index 95: above the back-to-top button (90), below the sticky header
   and its mobile menu (100). Modal <dialog>s are in the top layer anyway.
   ========================================================================== */

.av-cookie {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 95;
	box-sizing: border-box;
	max-height: 100%;
	overflow-y: auto;
	padding-block: 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); /* 16px */
	padding-inline: 1.25rem;                    /* 20px */
	border-top: 1px solid var(--av-hairline);
	background-color: #fff;
	box-shadow: 0 -2px 12px rgba(6, 17, 31, 0.06);
	color: var(--av-ink);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.av-cookie[hidden] {
	display: none;
}

.av-cookie.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* While the notice is shown the page gets matching space at its very end,
   so the last content (the footer's legal row) can still be scrolled above
   the panel and clicked. --av-cookie-h is the panel height, kept up to date
   by the script. */
.av-cookie-open body {
	padding-bottom: var(--av-cookie-h, 0px);
}

/* A modal <dialog> is open (e.g. the region chooser): step aside until it
   closes. visibility also takes the buttons out of the Tab order. */
.av-cookie.is-paused {
	visibility: hidden;
}

@media (min-width: 600px) {
	.av-cookie {
		padding-inline: var(--wp--preset--spacing--50);
	}
}

@media (min-width: 769px) {
	.av-cookie {
		padding-inline: max(
			calc(var(--wp--preset--spacing--50) * 3),
			calc((100% - var(--av-container)) / 2 + var(--wp--preset--spacing--50))
		);
	}
}

.av-cookie__title,
.av-cookie__text {
	margin: 0;
}

/* Small heading with the short red brand dash used across the site. */
.av-cookie__title {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	font-size: 0.9375rem;                       /* 15px */
	font-weight: 700;
	line-height: 1.3;
	color: var(--av-ink);
}

.av-cookie__title::before {
	content: "";
	flex: 0 0 auto;
	width: 1.25rem;
	height: 2px;
	background-color: var(--av-accent);
}

.av-cookie__text {
	margin-top: 0.25rem;                        /* 4px */
	font-size: 0.875rem;                        /* 14px */
	line-height: 1.45;
	color: #4f5d70;                             /* 6.6:1 on white */
}

.av-cookie__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;                                /* 8px */
	margin-top: 0.75rem;                        /* 12px */
}

.av-cookie__btn {
	box-sizing: border-box;
	min-height: 2.75rem;                        /* 44px */
	margin: 0;
	padding: 0 1rem;
	border: 1px solid transparent;
	border-radius: 2px;                         /* same as the site's buttons */
	font: inherit;
	font-size: 0.9375rem;                       /* 15px */
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.av-cookie__accept {
	border-color: var(--av-primary);
	background-color: var(--av-primary);
	color: #fff;
}

.av-cookie__accept:hover {
	border-color: var(--av-primary-hover);
	background-color: var(--av-primary-hover);
}

.av-cookie__decline {
	border-color: rgba(11, 31, 51, 0.35);
	background-color: #fff;
	color: var(--av-ink);
}

.av-cookie__decline:hover {
	border-color: var(--av-ink);
}

.av-cookie__btn:focus-visible {
	outline: 2px solid var(--av-primary);
	outline-offset: 3px;
}

/* Tablet: buttons keep their natural width, left-aligned under the text. */
@media (min-width: 600px) {
	.av-cookie__actions {
		display: flex;
		gap: 0.625rem;
	}

	.av-cookie__btn {
		min-width: 8.5rem;                      /* 136px */
		padding-inline: 1.5rem;
	}
}

/* Desktop: one compact row — text left, buttons right. */
@media (min-width: 900px) {
	.av-cookie {
		padding-block: 1.375rem calc(1.375rem + env(safe-area-inset-bottom, 0px)); /* 22px */
	}

	.av-cookie__inner {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 2rem;
	}

	.av-cookie__body {
		min-width: 0;
	}

	.av-cookie__actions {
		flex: 0 0 auto;
		margin-top: 0;
	}
}

/* Very narrow screens: the buttons stack at full width. */
@media (max-width: 339.98px) {
	.av-cookie__actions {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.av-cookie,
	.av-cookie__btn {
		transition: none;
	}
}
