/*
 * Privento Cookie Consent — Frontend Styles v1.0.9
 */

:root {
  --prv-bg:              #ffffff;
  --prv-text:            #1a1a18;
  --prv-subtext:         #6b6b66;
  --prv-accept-bg:       #1a6b4a;
  --prv-accept-txt:      #ffffff;
  --prv-accept-hover:    #1b5f8f;
  --prv-reject-bg:       #f0ede8;
  --prv-reject-txt:      #1a1a18;
  --prv-reject-hover:    #e0ddd8;
  --prv-settings-bg:     transparent;
  --prv-settings-txt:    #6b6b66;
  --prv-settings-bdr:    #e0dfd8;
  --prv-settings-hover:  #1a6b4a;
  --prv-save-bg:         #f0ede8;
  --prv-save-txt:        #1a1a18;
  --prv-save-hover:      #e0ddd8;
  --prv-link:            #1a6b4a;
  --prv-radius:          10px;
  --prv-shadow:          0 -4px 40px rgba(0,0,0,.12);
  --prv-font:            inherit;
  --prv-size:            14px;
  --prv-z:               99999;
}

/* ── Overlay ───────────────────── */
#privento-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: calc(var(--prv-z) - 1);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
#privento-overlay.is-open { opacity: 1; pointer-events: all; }

/* ── Banner base ───────────────── */
.privento-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: var(--prv-z);
  padding: 16px 16px 0;
  display: flex; justify-content: center;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  font-family: var(--prv-font); font-size: var(--prv-size);
  color: var(--prv-text);
}
.privento-banner[aria-hidden="false"] { transform: translateY(0); }

/* Hide main buttons when panel is open */
.privento-banner.panel-open .privento-banner__actions { display: none; }

/* ── Modal ─────────────────────── */
.privento-banner--modal {
  top: 0; left: 0; right: 0; bottom: 0; padding: 0;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.4);
  transform: none; opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.privento-banner--modal[aria-hidden="false"] { opacity: 1; pointer-events: auto; }
.privento-banner--modal .privento-banner__inner {
  max-width: 680px;
  border-radius: var(--prv-radius);
  box-shadow: 0 8px 60px rgba(0,0,0,.18);
}

/* ── Corner ────────────────────── */
.privento-banner--corner {
  left: auto; right: 24px; bottom: 24px; padding: 0;
  transform: translateY(16px);
}
.privento-banner--corner[aria-hidden="false"] { transform: translateY(0); }
.privento-banner--corner .privento-banner__inner {
  max-width: 360px;
  border-radius: var(--prv-radius);
  box-shadow: 0 4px 32px rgba(0,0,0,.16);
  flex-direction: column;
}
.privento-banner--corner .privento-banner__actions { flex-direction: column; width: 100%; min-width: auto; }
.privento-banner--corner .privento-btn { width: 100%; }

/* ── Floating ──────────────────── */
.privento-banner--floating {
  top: 16px; bottom: auto; left: 50%; right: auto; padding: 0;
  transform: translateX(-50%) translateY(-16px);
}
.privento-banner--floating[aria-hidden="false"] { transform: translateX(-50%) translateY(0); }
.privento-banner--floating .privento-banner__inner {
  max-width: 780px; width: calc(100vw - 32px);
  border-radius: var(--prv-radius);
}

/* ── Inner card ────────────────── */
.privento-banner__inner {
  background: var(--prv-bg);
  border-radius: var(--prv-radius) var(--prv-radius) 0 0;
  box-shadow: var(--prv-shadow);
  padding: 24px 32px 20px;
  max-width: 720px; width: 100%;
  display: flex; align-items: flex-start;
  justify-content: space-between;
  gap: 4px 0; flex-wrap: wrap;
  box-sizing: border-box;
}

/* ── Content left ──────────────── */
.privento-banner__content { flex: 1; min-width: 200px; }

/* id-scoped + !important so theme heading rules
   (e.g. Elementor kit "body.elementor-kit-N h2") cannot override */
#privento-banner .privento-banner__title {
  margin: 0 0 6px;
  font-size: 26px !important;
  font-weight: 700; color: var(--prv-text);
  display: flex; align-items: center; gap: 8px;
  line-height: 1.3;
  text-align: left !important;
}

.privento-shield-icon { display: none !important; }

.privento-banner__text {
  margin: 0 0 8px;
  font-size: var(--prv-size);
  color: var(--prv-subtext); line-height: 1.6;
  text-align: left !important;
}

.privento-policy-link {
  display: inline-block;
  font-size: calc(var(--prv-size) - 2px);
  color: var(--prv-link); text-decoration: underline;
}
.privento-policy-link:hover { opacity: .75; }

/* ── Actions right ─────────────── */
.privento-banner__actions {
  display: flex; flex-direction: column;
  gap: 8px; flex-shrink: 0;
  align-items: stretch; min-width: 160px;
}

.privento-banner__details { width: 100%; flex-basis: 100%; }

/* ── Settings window ───────────────────────────────
   The settings open as their own centered dialog rather than growing the
   consent card, which cannot hold them: the card is fixed, so anything past
   the edge of the screen is unreachable, and inside a 360px corner card the
   cookie details have no room. Only the category list scrolls; the footer
   buttons stay put. */
#privento-banner.panel-open .privento-banner__details {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: min(85vh, 760px);
  padding: 20px 24px;
  background: var(--prv-bg);
  border-radius: var(--prv-radius);
  box-shadow: 0 12px 48px rgba(0,0,0,.24);
  display: flex; flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  box-sizing: border-box;
}
#privento-banner.panel-open .privento-settings-panel {
  display: flex; flex-direction: column;
  min-height: 0;
}
.privento-panel-scroll { min-height: 0; }
#privento-banner.panel-open .privento-panel-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 0 -24px; padding: 0 24px;
}

/* The consent card carries the headline, and it is hidden while the window is
   open — without a title of its own the window has no heading at all. */
.privento-panel-title { display: none; }
#privento-banner.panel-open .privento-panel-title {
  display: block;
  margin: 0 0 14px;
  font-size: calc(var(--prv-size) + 4px);
  font-weight: 700;
  color: var(--prv-text);
  line-height: 1.3;
}

/* A transformed ancestor would make the fixed window position against the
   card instead of the viewport, so the card drops its slide transform while
   the window is open — and hides, since the window replaces it. */
#privento-banner.panel-open {
  transform: none;
  /* Without this the window slides in from the card's offset, since it is
     positioned against a still-animating ancestor. */
  transition: none;
  pointer-events: none;
}
#privento-banner.panel-open .privento-banner__inner {
  background: transparent;
  box-shadow: none;
  padding: 0;
  max-height: none;
}
#privento-banner.panel-open .privento-banner__content { display: none; }

#privento-banner { outline: none; }
#privento-banner .privento-settings-panel { background: var(--prv-bg, #fff); }

/* Corner cards are column-flex in a fixed box, so a long body text would grow
   the card past the top of the screen where nothing can scroll it back. */
.privento-banner--corner .privento-banner__inner,
.privento-banner--corner_left .privento-banner__inner {
  flex-wrap: nowrap;
  max-height: calc(100vh - 48px);
}
.privento-banner--corner .privento-banner__content,
.privento-banner--corner_left .privento-banner__content { flex: 0 0 auto; }

/* Corner/floating "hidden" only shifts the card 16px, leaving it visible and
   clickable — it must also fade out and drop pointer events. */
.privento-banner--corner,
.privento-banner--corner_left,
.privento-banner--floating {
  transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .25s ease, visibility .25s ease;
}
.privento-banner--corner[aria-hidden="true"],
.privento-banner--corner_left[aria-hidden="true"],
.privento-banner--floating[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Settings panel ────────────── */
.privento-settings-panel { display: none; }
.privento-settings-panel.is-open { display: block; }

.privento-category {
  border: 1px solid #f0ede8; border-radius: 8px;
  margin-bottom: 8px; overflow: hidden;
}
.privento-category__header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 18px; gap: 12px;
}
.privento-category__name {
  font-size: var(--prv-size); font-weight: 600; color: var(--prv-text);
}
.privento-badge--always {
  font-size: 11px; font-weight: 600; color: #1a6b4a; white-space: nowrap;
}

/* Toggle */
.privento-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.privento-toggle__input { position: absolute; opacity: 0; width: 0; height: 0; }
.privento-toggle__label {
  position: absolute; inset: 0; border-radius: 99px;
  background: #e0dfd8; cursor: pointer; transition: background .2s;
}
.privento-toggle__label::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s;
}
.privento-toggle__input:checked + .privento-toggle__label { background: var(--prv-accept-bg); }
.privento-toggle__input:checked + .privento-toggle__label::after { transform: translateX(20px); }

/* Panel footer */
.privento-panel-footer {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #f0ede8;
}
.privento-panel-policy-link {
  font-size: 12px; color: #9e9e99; text-decoration: none; margin-left: auto;
}
.privento-panel-policy-link:hover { color: var(--prv-link) !important; }

/* ── Buttons ───────────────────── */
/* Scoped to #privento-banner to beat theme button:hover overrides */
#privento-banner .privento-btn,
.privento-panel-footer .privento-btn {
  padding: 10px 20px;
  border-radius: var(--prv-radius);
  font-size: var(--prv-size); font-weight: 600;
  cursor: pointer; border: none; white-space: nowrap;
  font-family: var(--prv-font); text-align: center; line-height: 1.3;
  transition: background .15s, color .15s, border-color .15s;
}
#privento-banner .privento-btn--accept,
.privento-panel-footer .privento-btn--accept {
  background: var(--prv-accept-bg) !important; color: var(--prv-accept-txt) !important;
}
#privento-banner .privento-btn--accept:hover,
.privento-panel-footer .privento-btn--accept:hover {
  background: var(--prv-accept-hover) !important; color: var(--prv-accept-txt) !important;
}
#privento-banner .privento-btn--reject,
.privento-panel-footer .privento-btn--reject {
  background: var(--prv-reject-bg) !important; color: var(--prv-reject-txt) !important;
}
#privento-banner .privento-btn--reject:hover,
.privento-panel-footer .privento-btn--reject:hover {
  background: var(--prv-reject-hover) !important; color: var(--prv-reject-txt) !important;
}
#privento-banner .privento-btn--settings,
.privento-panel-footer .privento-btn--settings {
  background: var(--prv-settings-bg) !important;
  color: var(--prv-settings-txt) !important;
  border: 1px solid var(--prv-settings-bdr) !important;
}
#privento-banner .privento-btn--settings:hover,
.privento-panel-footer .privento-btn--settings:hover {
  background: var(--prv-settings-hover) !important;
  color: var(--prv-settings-txt) !important;
  text-decoration: none !important;
}
#privento-banner .privento-btn--save,
.privento-panel-footer .privento-btn--save {
  background: var(--prv-save-bg) !important; color: var(--prv-save-txt) !important;
}
#privento-banner .privento-btn--save:hover,
.privento-panel-footer .privento-btn--save:hover {
  background: var(--prv-save-hover) !important; color: var(--prv-save-txt) !important;
}

/* ── Floating button ───────────── */
.privento-floating-btn {
  position: fixed; z-index: calc(var(--prv-z) - 10);
  background: var(--prv-floating-bg, #fff);
  border: 1px solid rgba(0,0,0,.12); border-radius: 50%;
  width: 40px; height: 40px; padding: 0;
  color: var(--prv-floating-txt, #9e9e99);
  cursor: pointer; box-shadow: 0 2px 16px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.privento-floating-btn:hover,
.privento-floating-btn:focus,
.privento-floating-btn:active {
  color: var(--prv-floating-hover, #1a6b4a) !important;
  border-color: var(--prv-floating-hover, #1a6b4a) !important;
  background: var(--prv-floating-bg, #fff) !important;
  text-decoration: none !important;
  transform: scale(1.08);
}
.privento-floating-btn:active { transform: scale(0.96); }
.privento-floating-btn svg { width: 22px; height: 22px; }
.privento-floating-btn--bottom_left  { bottom: 20px; left: 20px; }
.privento-floating-btn--bottom_right { bottom: 20px; right: 20px; }

/* ── Mobile ────────────────────── */
@media (max-width: 560px) {
  .privento-banner__inner { padding: 18px 16px 14px; border-radius: 12px 12px 0 0; flex-direction: column; }
  .privento-banner__actions { flex-direction: row; flex-wrap: wrap; width: 100%; min-width: auto; }
  .privento-banner__actions .privento-btn { flex: 1; min-width: 100px; }
  .privento-panel-footer { flex-direction: column; }
  .privento-panel-footer .privento-btn { width: 100%; }
  .privento-panel-policy-link { margin-left: 0; }
  .privento-cookie-row { grid-template-columns: 1fr; gap: 0; }
}

/* ── Theme override reset ──────────────────────────────────────────────────
   Neutralise any theme rule like button:hover { background: #c36; color:#fff }
   The !important on individual button rules above takes precedence, but this
   resets the inherited values first so transitions work correctly.
   ─────────────────────────────────────────────────────────────────────── */
#privento-banner button,
#privento-banner button:focus,
#privento-banner button:hover,
.privento-panel-footer button,
.privento-panel-footer button:focus,
.privento-panel-footer button:hover {
  text-decoration: none !important;
}

/* ── Category accordion ────────────────────────── */
.privento-category__header {
  cursor: pointer;
  user-select: none;
}
.privento-category__chevron {
  color: var(--prv-subtext, #6b6b66);
  flex-shrink: 0;
  transition: transform .2s ease;
  display: flex;
  align-items: center;
}
.privento-category.is-open .privento-category__chevron {
  transform: rotate(180deg);
}

/* Body — hidden by default, shown when open */
.privento-category__body {
  display: none;
  padding: 0 18px 14px;
  border-top: 1px solid #f0ede8;
}
.privento-category.is-open .privento-category__body {
  display: block;
}

.privento-category__desc {
  font-size: calc(var(--prv-size, 14px) - 1px);
  color: var(--prv-subtext, #6b6b66);
  line-height: 1.6;
  margin: 12px 0 12px;
}

/* Cookie list */
.privento-cookie-list {
  background: #f9f9f7;
  border-radius: 8px;
  padding: 4px 16px;
}

.privento-cookie-item {
  padding: 12px 0;
  border-bottom: 1px solid #eeece8;
}
.privento-cookie-item:last-child { border-bottom: none; }

.privento-cookie-row {
  display: grid;
  /* minmax(0,…) instead of 1fr: a long unbreakable cookie name sets the track's
     min-content width and pushes the value column outside the card. */
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 4px 12px;
  margin-bottom: 4px;
  font-size: calc(var(--prv-size, 14px) - 1px);
  line-height: 1.5;
}
.privento-cookie-row:last-child { margin-bottom: 0; }

.privento-cookie-label {
  font-weight: 700;
  color: var(--prv-text, #1a1a18);
  white-space: nowrap;
}
.privento-cookie-value {
  color: var(--prv-subtext, #6b6b66);
  overflow-wrap: anywhere;
}

/* ── Corner Left ───────────────────────────────── */
.privento-banner--corner_left {
  left: 24px; right: auto; bottom: 24px; padding: 0;
  transform: translateY(16px);
}
.privento-banner--corner_left[aria-hidden="false"] { transform: translateY(0); }
.privento-banner--corner_left .privento-banner__inner {
  max-width: 360px;
  border-radius: var(--prv-radius);
  box-shadow: 0 4px 32px rgba(0,0,0,.16);
  flex-direction: column;
}
.privento-banner--corner_left .privento-banner__actions {
  flex-direction: column; width: 100%; min-width: auto;
}
.privento-banner--corner_left .privento-btn { width: 100%; }

/* ── WCAG / Accessibility ──────────────────────── */
/* High specificity to beat theme outline:none/0 rules */

/* WCAG mode — keyboard focus only (:focus-visible) */
#privento-banner.privento--wcag .privento-btn:focus-visible {
  outline: 3px solid #2179b6 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px rgba(33,121,182,.3) !important;
}
#privento-banner.privento--wcag .privento-toggle__input:focus-visible + .privento-toggle__label {
  outline: 3px solid #2179b6 !important;
  outline-offset: 2px !important;
}

/* Focus ring mode — all :focus states, more prominent */
#privento-banner.privento--focus-ring .privento-btn:focus,
#privento-banner.privento--focus-ring .privento-btn:focus-visible {
  outline: 3px solid #2179b6 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(33,121,182,.35) !important;
}
#privento-banner.privento--focus-ring .privento-toggle__input:focus + .privento-toggle__label {
  outline: 3px solid #2179b6 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(33,121,182,.25) !important;
}
/* Keyboard only, even in focus-ring mode: the header is a whole row, so a
   plain :focus ring stays behind after every mouse click on a category. */
#privento-banner.privento--focus-ring .privento-category__header:focus-visible {
  outline: 2px solid #2179b6 !important;
  outline-offset: -2px !important;
}
