/*
 * WDM Consent: CookieConsent v3 skinned for veikals.vengo.lv — the vengo
 * theme's own tokens, so the banner reads as part of the shop and not as a
 * third-party widget.
 *
 * Values come from the theme (wp-content/themes/vengo/theme.json): Poppins,
 * primary #393262, white card on #E6E6E6 border, text #323232 on #6C6C6C body
 * copy, links #005CA9, buttons 16px/500 pills (--wp--custom--button--radius:
 * 999px), cards 12px (--radius-card).
 *
 * Keep --cc-btn-border-radius small: CookieConsent also uses it for the
 * category boxes in the preferences panel, and a pill radius there turns an
 * expanded box into an ellipse that clips the cookie table. Pills are applied
 * to the buttons directly below.
 */
#cc-main {
	/* The preset var when global styles are loaded; the theme.json stack when
	   only the theme's own CSS is. */
	--cc-font-family: var(--wp--preset--font-family--poppins, Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif);
	--cc-modal-border-radius: 12px;
	--cc-btn-border-radius: 8px;
	--cc-modal-transition-duration: .25s;
	--cc-link-color: #005ca9;
	--cc-overlay-bg: rgba(0, 0, 0, .5);
	--cc-z-index: 2147483000;
	--cc-modal-margin: 40px;

	--cc-bg: #fff;
	--cc-primary-color: #323232;
	--cc-secondary-color: #6c6c6c;

	--cc-btn-primary-bg: #393262;
	--cc-btn-primary-color: #fff;
	--cc-btn-primary-border-color: #393262;
	--cc-btn-primary-hover-bg: #2c2650;
	--cc-btn-primary-hover-color: #fff;
	--cc-btn-primary-hover-border-color: #2c2650;

	--cc-btn-secondary-bg: #f8f8f8;
	--cc-btn-secondary-color: #323232;
	--cc-btn-secondary-border-color: #e6e6e6;
	--cc-btn-secondary-hover-bg: #f1f1f1;
	--cc-btn-secondary-hover-color: #323232;
	--cc-btn-secondary-hover-border-color: #dadada;

	--cc-separator-border-color: #e6e6e6;

	--cc-toggle-on-bg: #393262;
	--cc-toggle-off-bg: #878484; /* 3.4:1 on white: visible control outline (WCAG 1.4.11) */
	--cc-toggle-on-knob-bg: #fff;
	--cc-toggle-off-knob-bg: #fff;
	--cc-toggle-enabled-icon-color: #393262;
	--cc-toggle-disabled-icon-color: #878484;
	--cc-toggle-readonly-bg: #d2cbff;
	--cc-toggle-readonly-knob-bg: #fff;
	--cc-toggle-readonly-knob-icon-color: #393262;

	--cc-section-category-border: #e6e6e6;
	--cc-cookie-category-block-bg: #fff;
	--cc-cookie-category-block-border: #e6e6e6;
	--cc-cookie-category-block-hover-bg: #f8f8f8;
	--cc-cookie-category-block-hover-border: #dadada;
	--cc-cookie-category-expanded-block-bg: #fff;
	--cc-cookie-category-expanded-block-hover-bg: #f8f8f8;

	--cc-footer-bg: #fff;
	--cc-footer-color: #323232;
	--cc-footer-border-color: #e6e6e6;

	--cc-webkit-scrollbar-bg: #dadada;
	--cc-webkit-scrollbar-hover-bg: #878484;
}

/* Boxes: the theme's card border + a soft upward shadow. */
#cc-main .cm,
#cc-main .pm {
	border: 1px solid #e6e6e6;
	box-shadow: 0 -1px 10px rgba(50, 50, 50, .14);
}

/* Type. */
#cc-main .cm__title,
#cc-main .pm__title {
	font-size: 18px;
	font-weight: 600;
	color: #323232;
}

#cc-main .cm__desc,
#cc-main .pm__section-desc,
#cc-main .pm__section > .pm__section-desc-wrapper {
	font-size: 14px;
	line-height: 1.5;
	color: #6c6c6c;
}

#cc-main .pm__section-title {
	font-size: 15px;
	font-weight: 600;
}

/* Buttons: the theme's pills (--wp--custom--button--radius) at 500, 14px so
   three of them fit one row of the banner. */
#cc-main .cm__btn,
#cc-main .pm__btn {
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	min-height: 40px;
	padding: 10px 18px;
}

#cc-main .cm__btn + .cm__btn,
#cc-main .cm__btn-group + .cm__btn-group,
#cc-main .pm__btn + .pm__btn,
#cc-main .pm__btn-group + .pm__btn-group {
	margin-top: 0;
}

/* Desktop: one row, Customise · Reject · Accept — the accepting button last,
   nearest the page. */
@media (min-width: 641px) {
	#cc-main .cm__btns {
		display: flex;
		flex-direction: row-reverse;
		gap: 10px;
		padding-top: 16px;
		padding-bottom: 20px;
	}

	/* Three equal buttons: the Accept/Reject group gets twice the share of
	   the single Customise group. */
	#cc-main .cm__btn-group {
		display: flex;
		flex: 2 1 0;
		flex-direction: row-reverse;
		gap: 10px;
		margin: 0;
	}

	#cc-main .cm__btn-group:last-child {
		flex: 1 1 0;
	}

	#cc-main .cm__btn {
		flex: 1 1 0;
		margin: 0 !important;
		padding-left: 8px;
		padding-right: 8px;
		white-space: nowrap;
		width: auto;
	}

	/* Banner and panel sizes in CSS px. The vengo theme renders at 1:1 (no
	   page zoom), so these are what the visitor sees. */
	#cc-main .cm--box {
		max-width: 440px;
		width: 440px;
	}

	#cc-main .pm--box {
		max-width: 845px;
	}

	/* Preferences footer: Reject · Save · Accept in one row. The library puts
	   Accept+Reject and Save in separate groups, so the groups are flattened. */
	#cc-main .pm__footer {
		display: flex;
		gap: 10px;
	}

	#cc-main .pm__btn-group {
		display: contents;
	}

	#cc-main .pm__btn {
		flex: 1 1 0;
		margin: 0 !important;
		white-space: nowrap;
	}

	#cc-main .pm__btn[data-role="necessary"] { order: 1; }
	#cc-main .pm__btn[data-role="save"] { order: 2; }
	#cc-main .pm__btn[data-role="all"] { order: 3; }
}

/* No separator lines inside the banner: the card border carries it. */
#cc-main .cm__btns,
#cc-main .cm__footer {
	border-top: 0;
}

/* Plain × close button. */
#cc-main .pm__close-btn {
	background: transparent;
	border: 0;
}

#cc-main .pm__close-btn:hover {
	background: #f6f6f6;
}

#cc-main .pm__close-btn svg {
	stroke: #323232;
}

/* Phones: full-width sheet at the bottom, stacked buttons, Accept first. */
@media (max-width: 640px) {
	#cc-main {
		--cc-modal-margin: 0px;
	}

	#cc-main .cm--box {
		border-radius: 12px 12px 0 0;
		max-width: none;
		width: 100%;
	}

	/* !important: the library's own ≤640px rule puts the separator back with
	   one, and the banner has no divider lines on desktop either. */
	#cc-main .cm__btns {
		display: flex;
		flex-direction: column;
		gap: 10px;
		border-top: 0 !important;
	}

	#cc-main .cm__btn-group {
		display: flex;
		flex-direction: column;
		gap: 10px;
		margin: 0;
	}

	#cc-main .cm__btn {
		margin: 0 !important;
	}
}

#cc-main a,
#cc-main .cc__link {
	color: #005ca9;
	text-decoration: underline;
	text-underline-offset: 2px;
}

#cc-main .cm__footer {
	font-size: 13px;
}

/* Cookie tables inside the preferences panel. */
#cc-main .pm__table th,
#cc-main .pm__table td {
	font-size: 13px;
	color: #323232;
}

#cc-main .pm__table small {
	color: #6c6c6c;
}

#cc-main .wdm-cc-id {
	margin: 1.25em 0 0;
	font-size: 12px;
	color: #6c6c6c;
	word-break: break-all;
}

/* Footer link rendered by [wdm_cookie_settings] / the theme footer. */
.wdm-cookie-settings-link {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

/* [wdm_cookie_table] on the privacy / cookie policy page. */
.wdm-cookie-table-wrap { overflow-x: auto; margin: 0 0 2em; }
.wdm-cookie-table { width: 100%; border-collapse: collapse; font-size: .95em; }
.wdm-cookie-table th,
.wdm-cookie-table td { text-align: left; vertical-align: top; padding: .6em .8em; border-bottom: 1px solid rgba(0, 0, 0, .12); }
.wdm-cookie-table th { font-weight: 700; }
.wdm-cookie-table code { word-break: break-all; }

/* Floating "Cookie settings" button: appears once a choice has been made. */
.wdm-cc-float {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482000;
	display: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #e6e6e6;
	border-radius: 50%;
	background: #fff;
	color: #393262;
	box-shadow: 0 2px 10px rgba(50, 50, 50, .18);
	cursor: pointer;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease, box-shadow .15s ease;
}
.wdm-cc-done .wdm-cc-float { display: inline-flex !important; } /* inline display:none hides it until the CSS has loaded */
.wdm-cc-float:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(50, 50, 50, .22); }
.wdm-cc-float:focus-visible { outline: 2px solid #393262; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .wdm-cc-float { transition: none; } .wdm-cc-float:hover { transform: none; } }
