/**
 * Complianz cookie banner on mobile (like etabletka.sk): the banner sits in the middle of the screen,
 * the shop logo on top (includes/theme/inc/header-footer.php), readable text, "Odmietam" as a quiet
 * text button and "Súhlasím" as the last, larger button.
 * Desktop keeps Complianz's centred box. The breakpoint matches Complianz's own mobile layout
 * (max-width: 768px, buttons in a column).
 */
@media (max-width: 768px) {
	.cmplz-cookiebanner.cmplz-center {
		--cmplz_text_font_size: 17px;
		--cmplz_text_line_height: 1.6;
		/* Centred vertically (Complianz's top: 50%), 12px from the sides. */
		left: 12px;
		right: 12px;
		width: auto;
		max-height: calc(100vh - 24px);
		padding: 24px 20px 20px;
		grid-gap: 24px;
		/* Rows: logo, text (+ categories, scrolls when the screen is short), buttons. */
		grid-template-rows: auto minmax(0, 1fr) auto;
		transform: translateY(-50%);
	}

	/* Logo instead of the "Spravovať" title; the dividers and the document links (hidden by the
	   banner's custom CSS) only added empty space. */
	.cmplz-cookiebanner.cmplz-center .cmplz-header {
		display: block;
	}

	.cmplz-cookiebanner .cmplz-header .cmplz-title,
	.cmplz-cookiebanner .cmplz-divider,
	.cmplz-cookiebanner.cmplz-center .cmplz-documents {
		display: none;
	}

	.cmplz-cookiebanner .cmplz-logo img {
		display: block;
		height: 28px;
		width: auto;
		max-height: none;
	}

	/* The whole text is visible: no Complianz scroll box (max-height 55vh). It only scrolls when
	   the screen is too short for the banner (grid row minmax(0, 1fr) above). */
	.cmplz-cookiebanner.cmplz-center .cmplz-body {
		max-height: none;
	}

	.cmplz-cookiebanner.cmplz-center .cmplz-message,
	.cmplz-cookiebanner .cmplz-message p {
		margin: 0;
	}

	/* The theme's p line-height would override the banner's. */
	.cmplz-cookiebanner .cmplz-message p {
		line-height: inherit;
	}

	.cmplz-cookiebanner .cmplz-buttons {
		gap: 8px;
	}

	/* :not() only lifts specificity above Complianz's own button rule, which loads later. */
	.cmplz-cookiebanner .cmplz-buttons .cmplz-btn:not(.cmplz-accept) {
		height: 52px;
		font-size: 16px;
		font-weight: 700;
	}

	/* .cmplz-center: beats Complianz's own .cmplz-deny colours, which load later. */
	.cmplz-cookiebanner.cmplz-center .cmplz-buttons .cmplz-btn.cmplz-deny {
		height: 44px;
		background-color: transparent;
		border-color: transparent;
		color: #555;
	}

	.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-accept {
		order: 1;
		height: 60px;
		font-size: 18px;
		font-weight: 700;
	}

	/* The chat launcher (z-index 99999) would sit on top of the banner: keep it under the
	   soft cookie wall (z-index 9999) until the visitor answers. */
	body:has(.cmplz-cookiebanner.cmplz-show) .wa-mailbot-chat {
		z-index: 9998;
	}
}

/* Short phones (iPhone SE): smaller text, so it still fits without scrolling. */
@media (max-width: 768px) and (max-height: 600px) {
	.cmplz-cookiebanner.cmplz-center {
		--cmplz_text_font_size: 15px;
		--cmplz_text_line_height: 1.5;
		padding-top: 20px;
		grid-gap: 16px;
	}
}

/* Desktop stays as Complianz draws it: the logo column (100px) would overlap the "Spravovať" title. */
@media (min-width: 769px) {
	.cmplz-cookiebanner .cmplz-logo img {
		display: none;
	}
}
