/* WPStack GDPR — consent banner + preferences modal + blocked-embed placeholders.
   Scoped under #wpstack-gdpr / .wpstack-gdpr-modal so nothing leaks into the theme. */

.wpstack-gdpr, .wpstack-gdpr *,
.wpstack-gdpr-modal, .wpstack-gdpr-modal * { box-sizing: border-box; }

.wpstack-gdpr {
  --gdpr-accent: #4f46e5;
  --gdpr-bg: #ffffff;
  --gdpr-ink: #1f2937;
  --gdpr-muted: #6b7280;
  --gdpr-line: #e5e7eb;
  position: fixed;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--gdpr-ink);
}
.wpstack-gdpr.is-dark { --gdpr-bg:#111827; --gdpr-ink:#f3f4f6; --gdpr-muted:#9ca3af; --gdpr-line:#374151; }

/* ── Bar layout (full width, top or bottom) ── */
.wpstack-gdpr.gdpr-layout-bar { left: 0; right: 0; }
.wpstack-gdpr.gdpr-layout-bar.gdpr-pos-bottom { bottom: 0; }
.wpstack-gdpr.gdpr-layout-bar.gdpr-pos-top { top: 0; }
.wpstack-gdpr.gdpr-layout-bar .gdpr-banner {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
}
.wpstack-gdpr.gdpr-layout-bar {
  background: var(--gdpr-bg);
  border-top: 1px solid var(--gdpr-line);
  box-shadow: 0 -8px 30px -12px rgba(0,0,0,.18);
}
.wpstack-gdpr.gdpr-layout-bar.gdpr-pos-top { border-top: 0; border-bottom: 1px solid var(--gdpr-line); box-shadow: 0 8px 30px -12px rgba(0,0,0,.18); }
.wpstack-gdpr.gdpr-layout-bar .gdpr-banner-text { flex: 1; min-width: 260px; }
.wpstack-gdpr.gdpr-layout-bar .gdpr-banner-actions { flex: 0 0 auto; }

/* ── Box layout (floating card, corner) ── */
.wpstack-gdpr.gdpr-layout-box {
  max-width: 380px; width: calc(100% - 32px);
  background: var(--gdpr-bg);
  border: 1px solid var(--gdpr-line);
  border-radius: 14px;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,.28);
}
.wpstack-gdpr.gdpr-layout-box.gdpr-pos-bottom-left { bottom: 20px; left: 20px; }
.wpstack-gdpr.gdpr-layout-box.gdpr-pos-bottom-right { bottom: 20px; right: 20px; }
.wpstack-gdpr.gdpr-layout-box.gdpr-pos-bottom { bottom: 20px; left: 20px; }
.wpstack-gdpr.gdpr-layout-box .gdpr-banner { padding: 22px; }
.wpstack-gdpr.gdpr-layout-box .gdpr-banner-actions { margin-top: 16px; }

.gdpr-title { margin: 0 0 5px; font-size: 16px; font-weight: 700; color: var(--gdpr-ink); }
.gdpr-msg { margin: 0; color: var(--gdpr-muted); font-size: 13.5px; }
.gdpr-policy-link { color: var(--gdpr-accent); text-decoration: underline; }
.gdpr-banner-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Buttons ── */
.gdpr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 13.5px/1 inherit; padding: 11px 18px; border-radius: var(--gdpr-radius, 9px);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}

/* button size (height) */
.gdpr-btnsize-small .gdpr-btn { padding: 8px 14px; font-size: 12.5px; }
.gdpr-btnsize-large .gdpr-btn { padding: 15px 24px; font-size: 15px; }

/* button position presets — the 3 arrangements */
.gdpr-btnpos-right .gdpr-banner-actions { justify-content: flex-end; }
.gdpr-btnpos-center .gdpr-banner-actions { flex: 1 1 100%; justify-content: center; }
.gdpr-btnpos-stack .gdpr-banner-actions { flex: 1 1 100%; flex-direction: column; align-items: stretch; }
.gdpr-btnpos-stack .gdpr-banner-actions .gdpr-btn { width: 100%; }
.gdpr-btn-primary { background: var(--gdpr-accent); color: #fff; }
.gdpr-btn-primary:hover { filter: brightness(.94); transform: translateY(-1px); }
.gdpr-btn-ghost { background: transparent; color: var(--gdpr-ink); border-color: var(--gdpr-line); }
.gdpr-btn-ghost:hover { border-color: var(--gdpr-muted); }

/* ── Preferences modal ── */
.wpstack-gdpr-modal {
  --gdpr-accent: #4f46e5;
  --gdpr-bg: #ffffff; --gdpr-ink:#1f2937; --gdpr-muted:#6b7280; --gdpr-line:#e5e7eb;
  position: fixed; inset: 0; z-index: 1000000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wpstack-gdpr-modal.is-dark { --gdpr-bg:#111827; --gdpr-ink:#f3f4f6; --gdpr-muted:#9ca3af; --gdpr-line:#374151; }
.gdpr-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.gdpr-modal-card {
  position: relative; width: 100%; max-width: 540px; max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--gdpr-bg); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); color: var(--gdpr-ink);
}
.gdpr-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--gdpr-line); }
.gdpr-modal-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.gdpr-modal-close { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--gdpr-muted); cursor: pointer; padding: 0 4px; }
.gdpr-modal-close:hover { color: var(--gdpr-ink); }
.gdpr-modal-body { padding: 20px 24px; overflow-y: auto; }
.gdpr-modal-intro { margin: 0 0 16px; color: var(--gdpr-muted); font-size: 13.5px; }
.gdpr-cats { display: flex; flex-direction: column; gap: 4px; }
.gdpr-cat { padding: 14px 0; border-top: 1px solid var(--gdpr-line); }
.gdpr-cat:first-child { border-top: 0; }
.gdpr-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gdpr-cat-name { font-weight: 700; font-size: 14px; }
.gdpr-cat-desc { margin: 6px 0 0; color: var(--gdpr-muted); font-size: 12.5px; }
.gdpr-cat-desc em { font-style: normal; color: var(--gdpr-accent); font-weight: 600; }
.gdpr-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--gdpr-line); background: color-mix(in srgb, var(--gdpr-ink) 3%, transparent); }
.gdpr-modal-actions .gdpr-btn-primary { margin-left: auto; }

/* ── Toggle switch ── */
.gdpr-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.gdpr-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.gdpr-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background .18s; }
.gdpr-slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.gdpr-switch input:checked + .gdpr-slider { background: var(--gdpr-accent); }
.gdpr-switch input:checked + .gdpr-slider::before { transform: translateX(18px); }
.gdpr-switch input:disabled + .gdpr-slider { opacity: .6; }

/* ── Blocked-embed placeholder (built by banner.js) ── */
.wpstack-gdpr-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 10px; min-height: 180px; padding: 24px;
  background: #f3f4f6; border: 1px dashed #cbd5e1; border-radius: 10px; color: #4b5563;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13.5px;
}
.wpstack-gdpr-ph button {
  font: 600 13px inherit; padding: 9px 16px; border-radius: 8px; border: 0;
  background: #4f46e5; color: #fff; cursor: pointer;
}
.wpstack-gdpr-ph button:hover { filter: brightness(.94); }

/* ── Cookie-policy shortcode table ── */
.wpstack-gdpr-cookies { font-size: 14px; }
.wpstack-gdpr-cookies-cat { margin: 24px 0 4px; font-size: 17px; }
.wpstack-gdpr-cookies-desc { margin: 0 0 12px; color: #6b7280; font-size: 13.5px; }
.wpstack-gdpr-cookies-note { margin: 0 0 12px; color: #6b7280; font-size: 13px; font-style: italic; }
.wpstack-gdpr-cookies-table { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: 13.5px; }
.wpstack-gdpr-cookies-table th, .wpstack-gdpr-cookies-table td { text-align: left; padding: 9px 12px; border: 1px solid #e5e7eb; vertical-align: top; }
.wpstack-gdpr-cookies-table th { background: #f9fafb; font-weight: 700; }
.wpstack-gdpr-manage {
  display: inline-flex; align-items: center; font: 600 13.5px inherit;
  padding: 9px 16px; border-radius: 9px; border: 1px solid #d1d5db;
  background: #fff; color: #1f2937; cursor: pointer;
}
.wpstack-gdpr-manage:hover { border-color: #9ca3af; }

@media (max-width: 600px) {
  .wpstack-gdpr.gdpr-layout-bar .gdpr-banner { flex-direction: column; align-items: stretch; gap: 14px; }
  .wpstack-gdpr.gdpr-layout-bar .gdpr-banner-actions { flex-direction: column; }
  .wpstack-gdpr.gdpr-layout-bar .gdpr-btn { width: 100%; }
  .gdpr-modal-actions { flex-direction: column; }
  .gdpr-modal-actions .gdpr-btn-primary { margin-left: 0; }
  .gdpr-btn { width: 100%; }
}

/* ===== Force the banner button styling over theme / page-builder (Elementor) rules =====
   Themes and Elementor apply their own high-specificity/!important button styles that bleed
   into the banner. These id-scoped, !important rules keep our own look no matter what. */
#wpstack-gdpr .gdpr-btn, #wpstack-gdpr-modal .gdpr-btn {
  -webkit-appearance: none !important; appearance: none !important;
  font: 600 13.5px/1 inherit !important; text-transform: none !important; letter-spacing: normal !important;
  text-decoration: none !important; text-shadow: none !important; margin: 0 !important; min-height: 0 !important;
  padding: 11px 18px !important; border: 1px solid transparent !important;
  border-radius: var(--gdpr-radius, 9px) !important; box-shadow: none !important;
  background-image: none !important; cursor: pointer !important; outline: none !important;
}
#wpstack-gdpr .gdpr-btn-primary, #wpstack-gdpr-modal .gdpr-btn-primary {
  background: var(--gdpr-accent) !important; color: #fff !important; border-color: var(--gdpr-accent) !important;
}
#wpstack-gdpr .gdpr-btn-primary:hover, #wpstack-gdpr-modal .gdpr-btn-primary:hover { filter: brightness(.94); }
#wpstack-gdpr .gdpr-btn-ghost, #wpstack-gdpr-modal .gdpr-btn-ghost {
  background: transparent !important; color: var(--gdpr-ink) !important; border-color: var(--gdpr-line) !important;
}
#wpstack-gdpr .gdpr-btn-ghost:hover, #wpstack-gdpr-modal .gdpr-btn-ghost:hover {
  background: transparent !important; color: var(--gdpr-ink) !important; border-color: var(--gdpr-muted) !important;
}
/* size + stacked width kept above theme rules too */
#wpstack-gdpr.gdpr-btnsize-small .gdpr-btn, #wpstack-gdpr-modal.gdpr-btnsize-small .gdpr-btn { padding: 8px 14px !important; font-size: 12.5px !important; }
#wpstack-gdpr.gdpr-btnsize-large .gdpr-btn, #wpstack-gdpr-modal.gdpr-btnsize-large .gdpr-btn { padding: 15px 24px !important; font-size: 15px !important; }
#wpstack-gdpr.gdpr-btnpos-stack .gdpr-banner-actions .gdpr-btn { width: 100% !important; }
@media (max-width: 600px) {
  #wpstack-gdpr.gdpr-layout-bar .gdpr-btn { width: 100% !important; }
}

/* Modal close (×) — plain icon button, forced over theme/Elementor button styling */
#wpstack-gdpr-modal .gdpr-modal-close {
  -webkit-appearance: none !important; appearance: none !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  background: none !important; background-image: none !important; border: 0 !important;
  box-shadow: none !important; text-shadow: none !important; border-radius: 8px !important;
  width: 34px !important; height: 34px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
  font-size: 24px !important; line-height: 1 !important; font-weight: 400 !important;
  color: var(--gdpr-muted) !important; cursor: pointer !important;
}
#wpstack-gdpr-modal .gdpr-modal-close:hover {
  background: color-mix(in srgb, var(--gdpr-ink) 8%, transparent) !important; color: var(--gdpr-ink) !important;
}
/* ── Floating "manage consent" re-open widget (forced over theme/Elementor) ── */
#wpstack-gdpr-reopen {
  position: fixed !important; z-index: 999998; bottom: 20px;
  width: 46px !important; height: 46px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  -webkit-appearance: none !important; appearance: none !important;
  background: #fff !important; background-image: none !important; color: var(--gdpr-accent, #4f46e5) !important;
  border: 1px solid rgba(0,0,0,.08) !important; border-radius: 50% !important;
  box-shadow: 0 6px 20px -6px rgba(0,0,0,.35) !important; cursor: pointer !important;
  transition: transform .15s, box-shadow .15s !important;
}
#wpstack-gdpr-reopen[hidden] { display: none !important; }
#wpstack-gdpr-reopen.gdpr-reopen-bottom-left { left: 20px; right: auto; }
#wpstack-gdpr-reopen.gdpr-reopen-bottom-right { right: 20px; left: auto; }
#wpstack-gdpr-reopen:hover { transform: translateY(-2px) !important; box-shadow: 0 10px 26px -6px rgba(0,0,0,.42) !important; }
#wpstack-gdpr-reopen.is-dark { background: #1f2937 !important; border-color: rgba(255,255,255,.14) !important; }
#wpstack-gdpr-reopen svg { width: 24px !important; height: 24px !important; }
