/**
 * Кафе Мечта — банерът за бисквитки на CookieYes в стила на темата.
 *
 * Само CSS върху .cky-*: текстовете, бутоните (кои има) и цветовете в
 * настройките на CookieYes остават източникът. Бутоните са с еднаква
 * тежест — „Отказвам“ не е по-слаб от „Приемам“ (GDPR). Банерът и иконката
 * стоят над лентата долу (--km-dock от shop.js), не върху „Поръчай“.
 * Зарежда се само когато CookieYes е включен (functions.php).
 *
 * @package kafemechta
 */

/* ---------------------------------------------------------------
 * Банерът
 * ------------------------------------------------------------- */

.cky-consent-container,
.cky-modal {
	position: fixed;
}

.cky-consent-container.cky-banner-bottom {
	right: 16px;
	bottom: calc(16px + var(--km-dock, 0px)) !important;
	left: 16px !important;
	width: auto !important;
	max-width: 1180px;
	margin-inline: auto;
	font-family: var(--wp--preset--font-family--onest);
}

.cky-consent-container .cky-consent-bar {
	padding: 20px 24px !important;
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: var(--wp--custom--radius--md, 22px);
	background: var(--wp--preset--color--paper) !important;
	box-shadow: 0 18px 50px rgba(30, 18, 11, 0.18) !important;
}

.cky-consent-container :is(.cky-notice .cky-title, .cky-notice-des, .cky-notice-btn-wrapper) {
	padding-inline: 0 !important;
}

.cky-consent-container .cky-notice .cky-title {
	margin: 0 0 6px;
	font-family: var(--wp--preset--font-family--unbounded);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wp--preset--color--espresso) !important;
}

.cky-consent-container .cky-notice-des,
.cky-consent-container .cky-notice-des p {
	font-size: 14px !important;
	line-height: 1.55;
	color: var(--wp--preset--color--muted) !important;
}

.cky-consent-container .cky-notice-des a.cky-policy {
	border: 0 !important;
	font-weight: 600;
	color: var(--wp--preset--color--mechta-cta) !important;
	text-underline-offset: 3px;
}

.cky-consent-container .cky-notice-btn-wrapper {
	gap: 10px;
	margin-left: 24px;
}

/* Бутоните — в банера и в прозореца с настройките: еднакви хапчета. */
.cky-consent-container .cky-btn,
.cky-modal .cky-prefrence-btn-wrapper .cky-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin: 0 !important;
	padding: 10px 22px !important;
	border: 1.5px solid var(--wp--preset--color--espresso) !important;
	border-radius: 999px !important;
	background: transparent !important;
	font-family: var(--wp--preset--font-family--onest);
	font-size: 15px !important;
	font-weight: 600;
	line-height: 1.2 !important;
	color: var(--wp--preset--color--espresso) !important;
	opacity: 1 !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}

/* „отхвърляне“ → „Отхвърляне“, докато текстът в CookieYes е с малка буква. */
.cky-consent-container .cky-btn::first-letter,
.cky-modal .cky-btn::first-letter {
	text-transform: uppercase;
}

.cky-consent-container .cky-btn:hover,
.cky-modal .cky-prefrence-btn-wrapper .cky-btn:hover {
	background: var(--wp--preset--color--espresso) !important;
	color: var(--wp--preset--color--crema) !important;
}

.cky-consent-container .cky-btn:focus-visible,
.cky-modal .cky-btn:focus-visible {
	outline: 2px solid var(--wp--preset--color--mechta-cta) !important;
	outline-offset: 3px;
}

/* Отказвам · Настройки · Приемам — в този ред и на телефон (CookieYes
 * слага „Приемам“ най-горе). */
.cky-consent-container .cky-btn-reject,
.cky-modal .cky-prefrence-btn-wrapper .cky-btn-reject {
	order: 1 !important;
}

.cky-consent-container .cky-btn-customize,
.cky-modal .cky-prefrence-btn-wrapper .cky-btn-preferences {
	order: 2 !important;
}

.cky-consent-container .cky-btn-accept,
.cky-modal .cky-prefrence-btn-wrapper .cky-btn-accept {
	order: 3 !important;
}

/* Телефон: лист долу, текстът се превърта, трите бутона на един ред. */
@media (max-width: 768px) {
	.cky-consent-container.cky-banner-bottom {
		right: 8px;
		bottom: calc(8px + var(--km-dock, 0px)) !important;
		left: 8px !important;
		max-height: calc(100vh - 16px - var(--km-dock, 0px));
		overflow-y: auto;
	}

	.cky-consent-container .cky-consent-bar {
		padding: 16px !important;
		border-radius: 20px;
	}

	.cky-consent-container .cky-notice-group {
		display: block;
	}

	.cky-consent-container .cky-notice .cky-title {
		font-size: 15px;
	}

	.cky-consent-container .cky-notice-des {
		max-height: 26vh;
		overflow-y: auto !important;
	}

	.cky-consent-container .cky-notice-des,
	.cky-consent-container .cky-notice-des p {
		font-size: 13.5px !important;
		line-height: 1.5;
	}

	.cky-consent-container .cky-notice-btn-wrapper {
		display: grid !important;
		grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
		gap: 8px;
		margin: 14px 0 0 !important;
	}

	.cky-consent-container .cky-notice-btn-wrapper .cky-btn {
		width: auto !important;
		min-height: 44px;
		padding: 10px 8px !important;
		font-size: 14px !important;
		white-space: nowrap;
	}
}

/* ---------------------------------------------------------------
 * Иконката долу вляво (повторно отваряне)
 * ------------------------------------------------------------- */

.cky-btn-revisit-wrapper {
	/* fixed още преди CookieYes да вмъкне своя CSS — иначе за миг е блок от
	 * 44 px в началото на страницата и всичко подскача (CLS). */
	position: fixed !important;
	bottom: calc(16px + var(--km-dock, 0px)) !important;
	left: 16px !important;
	z-index: 45 !important; /* под менюто и мини-количката, не над тях */
	width: 44px !important;
	height: 44px !important;
	background: var(--wp--preset--color--espresso) !important;
	box-shadow: 0 6px 18px rgba(30, 18, 11, 0.25);
}

.cky-btn-revisit-wrapper .cky-btn-revisit {
	width: 100%;
	height: 100%;
}

.cky-btn-revisit-wrapper .cky-btn-revisit img {
	width: 24px !important;
	height: 24px !important;
}

/* С лента долу (продукт, количка, поръчка) иконката не се показва — там
 * важи лентата; настройките са и във футъра („Настройки за бисквитки“). */
html.km-docked .cky-btn-revisit-wrapper {
	display: none !important;
}

/* ---------------------------------------------------------------
 * Прозорецът с настройките
 * ------------------------------------------------------------- */

.cky-modal {
	border-radius: var(--wp--custom--radius--md, 22px) !important;
	font-family: var(--wp--preset--font-family--onest);
}

.cky-modal .cky-preference-center {
	border-radius: inherit;
	background: var(--wp--preset--color--paper) !important;
	color: var(--wp--preset--color--espresso) !important;
}

.cky-modal .cky-preference-title {
	font-family: var(--wp--preset--font-family--unbounded);
	font-size: 17px !important;
	font-weight: 600 !important;
	color: var(--wp--preset--color--espresso) !important;
}

.cky-modal :is(.cky-preference-content-wrapper, .cky-accordion-header-des, .cky-accordion-header-des p) {
	color: var(--wp--preset--color--muted) !important;
}

.cky-modal .cky-accordion-btn {
	font-weight: 600 !important;
	color: var(--wp--preset--color--espresso) !important;
}

.cky-modal .cky-accordion-btn::first-letter {
	text-transform: uppercase;
}

.cky-modal .cky-always-active {
	color: var(--wp--custom--state--success, #2e6b3f) !important;
}

.cky-modal .cky-switch input[type="checkbox"]:checked {
	background: var(--wp--preset--color--mechta-cta) !important;
}

.cky-modal .cky-show-desc-btn {
	font-weight: 600;
	color: var(--wp--preset--color--mechta-cta) !important;
}

.cky-modal .cky-preference-header .cky-btn-close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
}

.cky-modal .cky-prefrence-btn-wrapper {
	gap: 10px;
}

@media (max-width: 576px) {
	.cky-modal .cky-prefrence-btn-wrapper .cky-btn {
		width: 100%;
	}
}
