/* CookiePile front-end styles. Logical properties throughout so RTL works without a second file.
 * Colors, radius and font size come from custom properties set in the plugin settings. */
.cookiepile-root {
	--cookiepile-shadow: 0 10px 40px rgba(15, 23, 42, .18);
	font-size: var(--cookiepile-font, 15px);
	line-height: 1.5;
	color: var(--cookiepile-fg, #1f2933);
}
.cookiepile-root *, .cookiepile-root *::before, .cookiepile-root *::after { box-sizing: border-box; }

/* Light and dark themes (Colors: Automatic, Light or Dark). Custom keeps the colors from the settings. */
.cookiepile-theme-light { --cookiepile-bg: #ffffff; --cookiepile-fg: #1f2933; --cookiepile-line: rgba(31, 41, 51, .14); --cookiepile-muted: #52606d; }
.cookiepile-theme-dark { --cookiepile-bg: #161b24; --cookiepile-fg: #e7ebf2; --cookiepile-line: rgba(255, 255, 255, .12); --cookiepile-muted: #a3adbd; --cookiepile-shadow: 0 16px 50px rgba(0, 0, 0, .55); }
.cookiepile-theme-dark .cookiepile-switch { background: #5d6a80; }

/* Logo */
.cookiepile-root .cookiepile-brand { display: flex; align-items: center; gap: 12px; margin-block-end: 6px; }
.cookiepile-root .cookiepile-logo { width: 40px; height: 40px; flex: none; object-fit: contain; border-radius: 8px; margin: 0; }
/* The cookie icon, drawn inline instead of loaded. Takes the accent color like the floating button. */
.cookiepile-root .cookiepile-logo-mark { display: flex; align-items: center; justify-content: center; border-radius: 0; color: var(--cookiepile-accent-line, var(--cookiepile-accent, #2f6f4f)); }
.cookiepile-root .cookiepile-logo-mark svg { width: 100%; height: 100%; display: block; }
.cookiepile-root .cookiepile-brand .cookiepile-title { margin: 0; }
html.cookiepile-lock { overflow: hidden; }

.cookiepile-backdrop {
	position: fixed; inset: 0; z-index: 2147483000;
	background: rgba(15, 23, 42, .45);
}

.cookiepile-banner, .cookiepile-prefs {
	position: fixed; z-index: 2147483001;
	background: var(--cookiepile-bg, #fff);
	color: var(--cookiepile-fg, #1f2933);
	box-shadow: var(--cookiepile-shadow);
	font-family: inherit;
}

/* Full-width bar */
.cookiepile-banner.cookiepile-layout-bar {
	inset-inline: 0;
	padding: 18px 24px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
}
.cookiepile-banner.cookiepile-layout-bar.cookiepile-pos-bottom { inset-block-end: 0; }
.cookiepile-banner.cookiepile-layout-bar.cookiepile-pos-top { inset-block-start: 0; }
.cookiepile-banner.cookiepile-layout-bar .cookiepile-inner { flex: 1 1 420px; }

/* Corner box */
.cookiepile-banner.cookiepile-layout-box {
	inset-block-end: 20px; inset-inline-start: 20px;
	width: min(420px, calc(100vw - 40px));
	padding: 20px;
	border-radius: var(--cookiepile-radius, 8px);
}

/* Center dialog (banner) and preferences */
.cookiepile-banner.cookiepile-layout-modal, .cookiepile-prefs {
	inset-block-start: 50%; inset-inline-start: 50%;
	transform: translate(-50%, -50%);
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: 24px;
	border-radius: var(--cookiepile-radius, 8px);
}
[dir="rtl"] .cookiepile-banner.cookiepile-layout-modal, [dir="rtl"] .cookiepile-prefs { transform: translate(50%, -50%); }

.cookiepile-root .cookiepile-title { margin: 0 0 6px; padding: 0; font-size: 1.15em; font-weight: 700; line-height: 1.3; color: var(--cookiepile-fg, #1f2933); font-family: inherit; letter-spacing: normal; text-transform: none; }
.cookiepile-root .cookiepile-message { margin: 0; color: var(--cookiepile-fg, #1f2933); }
.cookiepile-link { color: inherit; text-decoration: underline; }

.cookiepile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 14px; }
.cookiepile-root .cookiepile-btn:hover { filter: brightness(1.08); }
.cookiepile-actions-prefs { align-items: center; margin-block-start: 18px; }
.cookiepile-layout-bar .cookiepile-actions { margin-block-start: 0; }
/*
 * Hardened the way the switches and the floating button are, and for the same reason: a theme or a
 * page builder styles every button on the page, its stylesheet loads after ours, and a single
 * .wp-element-button or .elementor-button rule is enough to repaint ours. On a dark banner that was
 * not cosmetic: the theme's white button fill arrived while our own light text stayed, so the label
 * disappeared, and the hover fill did it on rollover even where the resting state survived. Every
 * state is pinned, because :hover and :focus are where theme rules usually live.
 */
.cookiepile-root button.cookiepile-btn.cookiepile-btn, .cookiepile-placeholder button.cookiepile-btn.cookiepile-btn,
.cookiepile-root button.cookiepile-btn.cookiepile-btn:hover, .cookiepile-placeholder button.cookiepile-btn.cookiepile-btn:hover,
.cookiepile-root button.cookiepile-btn.cookiepile-btn:focus, .cookiepile-placeholder button.cookiepile-btn.cookiepile-btn:focus,
.cookiepile-root button.cookiepile-btn.cookiepile-btn:active, .cookiepile-placeholder button.cookiepile-btn.cookiepile-btn:active {
	appearance: none; -webkit-appearance: none; box-sizing: border-box; cursor: pointer;
	margin: 0; padding: .6em 1.2em; min-height: 40px; width: auto; min-width: 0;
	text-transform: none; letter-spacing: normal; text-decoration: none; text-shadow: none;
	box-shadow: none; background-image: none; transform: none; opacity: 1;
	transition: filter .15s, background-color .15s;
	border-radius: var(--cookiepile-radius, 8px);
	font: inherit; font-weight: 600; line-height: 1.2;
	/* The accent itself, so a filled button is one flat color; JS swaps in a fitted copy only when
	 * the fill sits so close to the banner that the button would lose its shape. */
	border: 2px solid var(--cookiepile-accent-edge, var(--cookiepile-accent, #2f6f4f));
}
.cookiepile-root button.cookiepile-btn-primary.cookiepile-btn-primary, .cookiepile-placeholder button.cookiepile-btn-primary.cookiepile-btn-primary,
.cookiepile-root button.cookiepile-btn-primary.cookiepile-btn-primary:hover, .cookiepile-placeholder button.cookiepile-btn-primary.cookiepile-btn-primary:hover,
.cookiepile-root button.cookiepile-btn-primary.cookiepile-btn-primary:focus, .cookiepile-placeholder button.cookiepile-btn-primary.cookiepile-btn-primary:focus,
.cookiepile-root button.cookiepile-btn-primary.cookiepile-btn-primary:active, .cookiepile-placeholder button.cookiepile-btn-primary.cookiepile-btn-primary:active {
	background: var(--cookiepile-accent, #2f6f4f); color: var(--cookiepile-accent-fg, #fff);
}
.cookiepile-root button.cookiepile-btn-secondary.cookiepile-btn-secondary,
.cookiepile-root button.cookiepile-btn-secondary.cookiepile-btn-secondary:hover,
.cookiepile-root button.cookiepile-btn-secondary.cookiepile-btn-secondary:focus,
.cookiepile-root button.cookiepile-btn-secondary.cookiepile-btn-secondary:active {
	background: transparent; color: var(--cookiepile-fg, #1f2933);
}
/* The quiet button should read as the quiet one. On a dark banner an accent border made it a
 * sibling of the filled buttons instead of a step below them. */
.cookiepile-root.cookiepile-theme-dark button.cookiepile-btn-secondary.cookiepile-btn-secondary,
.cookiepile-root.cookiepile-theme-dark button.cookiepile-btn-secondary.cookiepile-btn-secondary:hover,
.cookiepile-root.cookiepile-theme-dark button.cookiepile-btn-secondary.cookiepile-btn-secondary:focus,
.cookiepile-root.cookiepile-theme-dark button.cookiepile-btn-secondary.cookiepile-btn-secondary:active {
	border-color: rgba(255, 255, 255, .34);
}
/*
 * Save sits alone on the start side and pushes Reject and Accept to the end. It has to out-rank the
 * hardened rules above ON EVERY STATE, not just at rest: those pin `margin: 0`, and the :hover one
 * ties on specificity and wins by coming later, so without the :hover selector here the two buttons
 * slid across the dialog the moment the pointer touched Save.
 */
.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save,
.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save:hover,
.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save:focus,
.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save:active {
	margin-inline-end: auto;
}
/* Rollover, ours rather than the theme's: a fill the label still reads against, on both themes. */
.cookiepile-root button.cookiepile-btn-secondary.cookiepile-btn-secondary:hover { background: rgba(127, 127, 127, .14); }
.cookiepile-root.cookiepile-theme-dark button.cookiepile-btn-secondary.cookiepile-btn-secondary:hover { background: rgba(255, 255, 255, .12); }
.cookiepile-btn:focus-visible, .cookiepile-close:focus-visible, .cookiepile-switch:focus-visible {
	outline: 3px solid var(--cookiepile-accent-line, var(--cookiepile-accent, #2f6f4f)); outline-offset: 2px;
}

.cookiepile-prefs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 8px; }
.cookiepile-close {
	appearance: none; background: transparent; border: 0; cursor: pointer;
	font-size: 28px; line-height: 1; color: inherit; padding: 4px 8px;
}
.cookiepile-cats { display: grid; gap: 10px; }
.cookiepile-cat { border: 1px solid var(--cookiepile-line, rgba(127, 127, 127, .3)); border-radius: var(--cookiepile-radius, 8px); padding: 12px 14px; }
.cookiepile-cat-top { display: flex; align-items: center; gap: 10px; }
.cookiepile-cat-label { font-weight: 600; flex: 1; cursor: pointer; }
.cookiepile-always { font-size: .85em; opacity: .75; }
.cookiepile-cat-desc { margin: 6px 0 0; font-size: .92em; opacity: .85; }

/* Vendor credit, only when the site owner has switched it on. Its own class, NOT cookiepile-brand:
 * that one is the logo and title row, and sharing it shrank and faded the title. */
.cookiepile-root .cookiepile-credit { margin-block-start: 14px; font-size: .82em; opacity: .6; }
.cookiepile-root .cookiepile-credit a {
	display: flex; align-items: center; justify-content: center; gap: 6px;
	color: inherit; text-decoration: none; border: 0; box-shadow: none;
}
.cookiepile-root .cookiepile-credit a:hover, .cookiepile-root .cookiepile-credit a:focus-visible { text-decoration: underline; }
.cookiepile-root .cookiepile-credit svg { flex: none; width: 1.25em; height: 1.25em; }
.cookiepile-switch {
	appearance: none; -webkit-appearance: none;
	width: 44px; height: 24px; border-radius: 24px; margin: 0;
	/* The off track is a control, not a groove: at the old #9aa5b1 it scored 2.5:1 on white and the
	 * dark one 2.3:1 on the dark panel, both under the 3:1 WCAG asks of a user interface component. */
	background: #7b8794; position: relative; cursor: pointer; flex: none;
	transition: background .15s;
}
.cookiepile-switch::after {
	content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px;
	width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s;
	/* The knob is white and an "on" track is light, so it needs an edge of its own to stay a knob. */
	box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.cookiepile-switch:checked { background: var(--cookiepile-accent-edge, var(--cookiepile-accent, #2f6f4f)); }
.cookiepile-switch:checked::after { inset-inline-start: 23px; }
.cookiepile-switch:disabled { opacity: .6; cursor: not-allowed; }
/* Hardened against theme and page-builder form and button styles (for example a kit rule on every input or button). */
.cookiepile-root input.cookiepile-switch.cookiepile-switch.cookiepile-switch,
.cookiepile-root input.cookiepile-switch.cookiepile-switch.cookiepile-switch:hover,
.cookiepile-root input.cookiepile-switch.cookiepile-switch.cookiepile-switch:focus {
	appearance: none; -webkit-appearance: none; box-sizing: border-box;
	width: 44px; height: 24px; min-height: 0; min-width: 0; max-width: none; padding: 0; margin: 0;
	border: 0; border-radius: 24px; background: #7b8794; background-image: none;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.cookiepile-root.cookiepile-theme-dark input.cookiepile-switch.cookiepile-switch.cookiepile-switch {
	background: #5d6a80; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
/* "Always on" is checked AND disabled. At .6 opacity on a dark banner it read as a switch that is off. */
.cookiepile-root.cookiepile-theme-dark input.cookiepile-switch.cookiepile-switch.cookiepile-switch:disabled { opacity: .85; }
/* On uses the accent exactly, like the filled buttons; the fitted copy stands in only when the
 * accent is so close to the banner that an on switch would read as an off one. */
.cookiepile-root input.cookiepile-switch.cookiepile-switch.cookiepile-switch:checked {
	background: var(--cookiepile-accent-edge, var(--cookiepile-accent, #2f6f4f));
}
.cookiepile-root button.cookiepile-close.cookiepile-close,
.cookiepile-root button.cookiepile-close.cookiepile-close:hover,
.cookiepile-root button.cookiepile-close.cookiepile-close:focus {
	appearance: none; background: transparent; background-image: none; border: 0; border-radius: var(--cookiepile-radius, 8px);
	box-shadow: none; color: inherit; font-size: 28px; font-weight: 400; line-height: 1; letter-spacing: normal; text-transform: none;
	padding: 4px 8px; margin: 0; min-height: 0; width: auto; opacity: .75;
}
.cookiepile-root button.cookiepile-close.cookiepile-close:hover { opacity: 1; }

.cookiepile-reopen {
	position: fixed; z-index: 2147482999; inset-block-end: 16px;
	width: 40px; height: 40px; border-radius: 50%; margin: 0;
	display: flex; align-items: center; justify-content: center;
	background: var(--cookiepile-bg, #fff); color: var(--cookiepile-accent-line, var(--cookiepile-accent, #2f6f4f));
	border: 1px solid var(--cookiepile-line, rgba(127, 127, 127, .35)); box-shadow: 0 3px 10px rgba(15, 23, 42, .16);
	cursor: pointer; padding: 0; opacity: .55; transition: opacity .2s, transform .2s;
}
.cookiepile-reopen:hover, .cookiepile-reopen:focus-visible { opacity: 1; transform: scale(1.06); }
.cookiepile-reopen:focus-visible { outline: 3px solid var(--cookiepile-accent-line, var(--cookiepile-accent, #2f6f4f)); outline-offset: 2px; }
/* Hardened against theme and page-builder button styles. */
button.cookiepile-reopen.cookiepile-reopen.cookiepile-reopen,
button.cookiepile-reopen.cookiepile-reopen.cookiepile-reopen:hover,
button.cookiepile-reopen.cookiepile-reopen.cookiepile-reopen:focus {
	width: 40px; height: 40px; min-height: 0; min-width: 0; border-radius: 50%; margin: 0;
	background: var(--cookiepile-bg, #fff); background-image: none; color: var(--cookiepile-accent-line, var(--cookiepile-accent, #2f6f4f));
	border: 1px solid var(--cookiepile-line, rgba(127, 127, 127, .35)); box-shadow: 0 3px 10px rgba(15, 23, 42, .16);
	padding: 0; font-size: 0; line-height: 1; text-transform: none; letter-spacing: normal;
}
/* Physical, not logical, and deliberately so. Everything else in this file mirrors with the text
 * because it IS text, but this setting is a person pointing at a corner of their screen. Logical
 * properties turned "Left" into the right-hand corner on every RTL site, which reads as a bug no
 * matter what the label says. */
.cookiepile-reopen.cookiepile-side-left { left: 16px; right: auto; }
.cookiepile-reopen.cookiepile-side-right { right: 16px; left: auto; }

.cookiepile-placeholder {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	box-sizing: border-box; width: 100%; min-height: 200px; padding: 20px; text-align: center;
	background: #f1f3f5; color: #1f2933; border-radius: 6px; font-size: 15px;
}
.cookiepile-placeholder p { margin: 0; }
html.cookiepile-site-dark .cookiepile-placeholder { background: #1b212c; color: #e7ebf2; }

@media (max-width: 600px) {
	.cookiepile-banner.cookiepile-layout-bar { padding: 16px; }
	.cookiepile-actions .cookiepile-btn { flex: 1 1 100%; }
	.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save,
	.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save:hover,
	.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save:focus,
	.cookiepile-root .cookiepile-actions-prefs button.cookiepile-btn-save.cookiepile-btn-save:active { margin-inline-end: 0; }
	.cookiepile-banner.cookiepile-layout-box { inset-inline: 10px; inset-block-end: 10px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
	.cookiepile-switch, .cookiepile-switch::after { transition: none; }
}
