/**
 * Darealmop_Gdpr — Banner Styles
 *
 * Theme-agnostic. All visual tokens are CSS custom properties that fall
 * through to neutral defaults. Themes re-skin by setting their own values
 * on :root (or any ancestor of .dm-gdpr-banner).
 *
 * Structural patterns (positions, ::before-isolated backdrop blur,
 * always-in-DOM transform-based animations) are baked in; the look is not.
 *
 *   ─ Surfaces ───────────────────────────────────────────────────────
 *   --dm-gdpr-bg            background (panel)
 *   --dm-gdpr-bg-elevated   slightly raised surface (settings panel)
 *   --dm-gdpr-text          primary text
 *   --dm-gdpr-text-muted    secondary / description text
 *   --dm-gdpr-accent        primary CTA fill + accent links
 *   --dm-gdpr-accent-text   text colour on accent fills
 *   --dm-gdpr-accent-hover  CTA hover fill (defaults to --dm-gdpr-accent)
 *   --dm-gdpr-border        borders / dividers
 *   --dm-gdpr-shadow        banner box-shadow
 *
 *   ─ Geometry & typography ──────────────────────────────────────────
 *   --dm-gdpr-radius        corner radius (set 0 for a hard streetwear look)
 *   --dm-gdpr-font          font family
 *   --dm-gdpr-title-size    title font-size (default 16px)
 *   --dm-gdpr-title-weight  title font-weight (default 700)
 *   --dm-gdpr-title-tracking  title letter-spacing (default normal)
 *   --dm-gdpr-title-transform title text-transform (default none)
 *   --dm-gdpr-msg-size      message font-size
 *   --dm-gdpr-btn-size      button font-size
 *   --dm-gdpr-btn-tracking  button letter-spacing
 *   --dm-gdpr-btn-transform button text-transform
 *
 *   ─ Mechanics ──────────────────────────────────────────────────────
 *   --dm-gdpr-z             banner stacking (default 9000)
 *   --dm-gdpr-z-backdrop    backdrop stacking (default 8999, always below banner)
 *   --dm-gdpr-transition    motion easing
 *   --dm-gdpr-blur          backdrop blur radius — set INLINE by phtml
 */

:root {
    --dm-gdpr-bg:             #ffffff;
    --dm-gdpr-bg-elevated:    #f7f7f7;
    --dm-gdpr-text:           #1a1a1a;
    --dm-gdpr-text-muted:     #666666;
    --dm-gdpr-accent:         #1a1a1a;
    --dm-gdpr-accent-text:    #ffffff;
    --dm-gdpr-accent-hover:   var(--dm-gdpr-accent);
    --dm-gdpr-border:         #e0e0e0;
    --dm-gdpr-shadow:         0 -8px 32px rgba(0, 0, 0, 0.18);

    --dm-gdpr-radius:         6px;
    --dm-gdpr-font:           system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --dm-gdpr-title-size:     16px;
    --dm-gdpr-title-weight:   700;
    --dm-gdpr-title-tracking: normal;
    --dm-gdpr-title-transform: none;
    --dm-gdpr-msg-size:       13px;
    --dm-gdpr-btn-size:       13px;
    --dm-gdpr-btn-tracking:   normal;
    --dm-gdpr-btn-transform:  none;

    --dm-gdpr-z:              9000;
    --dm-gdpr-z-backdrop:     8999;
    --dm-gdpr-transition:     0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══════════════════════════════════════════════════════════════
   BACKDROP

   WHY ::before CARRIES backdrop-filter
   ─────────────────────────────────────
   backdrop-filter on an element creates a new stacking context and
   flattens every element below into one composited layer — *then*
   blurs it. Result: the banner, even at a higher z-index, gets
   blurred because it shares the same composited layer.

   Fix: apply backdrop-filter only to a ::before pseudo-element
   *inside* the backdrop div. The pseudo-element blurs what is
   behind the backdrop div itself; the banner (a sibling, not a
   child) is NOT inside that compositing scope, so it stays sharp.

   pointer-events: none — ALWAYS — on both backdrop and ::before.
   Clicking the backdrop must never dismiss the banner; the visitor
   must make an explicit consent choice. GDPR compliance, not just
   UX preference.
   ═════════════════════════════════════════════════════════════ */

.dm-gdpr-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--dm-gdpr-z-backdrop);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition:
        opacity var(--dm-gdpr-transition),
        visibility 0s linear var(--dm-gdpr-transition);
}

.dm-gdpr-backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    backdrop-filter: blur(var(--dm-gdpr-blur, 0px));
    -webkit-backdrop-filter: blur(var(--dm-gdpr-blur, 0px));
}

.dm-gdpr-backdrop--dim::before    { background: rgba(0, 0, 0, 0.55); }
.dm-gdpr-backdrop--light::before  { background: rgba(0, 0, 0, 0.25); }
.dm-gdpr-backdrop--medium::before { background: rgba(0, 0, 0, 0.35); }
.dm-gdpr-backdrop--heavy::before  { background: rgba(0, 0, 0, 0.45); }

.dm-gdpr-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    transition:
        opacity var(--dm-gdpr-transition),
        visibility 0s linear 0s;
}

.dm-gdpr-backdrop.is-leaving { opacity: 0; }

/* ═══════════════════════════════════════════════════════════════
   BANNER BASE

   Banner is always in the DOM. Hidden states use opacity +
   transform so the CSS transition always has a start state to
   animate from — no `display: none` flicker.
   ═════════════════════════════════════════════════════════════ */

.dm-gdpr-banner {
    position: fixed;
    z-index: var(--dm-gdpr-z);
    font-family: var(--dm-gdpr-font);
    background-color: var(--dm-gdpr-bg);
    color: var(--dm-gdpr-text);
    box-shadow: var(--dm-gdpr-shadow);
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition:
        opacity var(--dm-gdpr-transition),
        transform var(--dm-gdpr-transition),
        visibility 0s linear var(--dm-gdpr-transition);
}

.dm-gdpr-banner * { box-sizing: border-box; }

.dm-gdpr-banner.is-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition:
        opacity var(--dm-gdpr-transition),
        transform var(--dm-gdpr-transition),
        visibility 0s linear 0s;
}

.dm-gdpr-banner.is-leaving {
    opacity: 0;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   POSITION VARIANTS — placement + slide-in direction + accent
   ═════════════════════════════════════════════════════════════ */

/* Bottom bar (full width) */
.dm-gdpr-banner--bottom {
    bottom: 0; left: 0; right: 0; width: 100%;
    border-top: 1px solid var(--dm-gdpr-border);
    transform: translateY(110%);
}
.dm-gdpr-banner--bottom.is-visible { transform: translateY(0); }
.dm-gdpr-banner--bottom.is-leaving { transform: translateY(110%); }

/* Top bar (full width) */
.dm-gdpr-banner--top {
    top: 0; left: 0; right: 0; width: 100%;
    border-bottom: 1px solid var(--dm-gdpr-border);
    transform: translateY(-110%);
}
.dm-gdpr-banner--top.is-visible { transform: translateY(0); }
.dm-gdpr-banner--top.is-leaving { transform: translateY(-110%); }

/* Shared corner panel base */
.dm-gdpr-banner--bottom-left,
.dm-gdpr-banner--bottom-right,
.dm-gdpr-banner--top-left,
.dm-gdpr-banner--top-right {
    width: 420px;
    max-width: calc(100vw - 32px);
    border: 1px solid var(--dm-gdpr-border);
    border-radius: var(--dm-gdpr-radius);
}

.dm-gdpr-banner--bottom-left {
    bottom: 24px; left: 24px;
    transform: translateY(calc(100% + 32px));
}
.dm-gdpr-banner--bottom-left.is-visible { transform: translateY(0); }
.dm-gdpr-banner--bottom-left.is-leaving { transform: translateY(calc(100% + 32px)); }

.dm-gdpr-banner--bottom-right {
    bottom: 24px; right: 24px;
    transform: translateY(calc(100% + 32px));
}
.dm-gdpr-banner--bottom-right.is-visible { transform: translateY(0); }
.dm-gdpr-banner--bottom-right.is-leaving { transform: translateY(calc(100% + 32px)); }

.dm-gdpr-banner--top-left {
    top: 24px; left: 24px;
    transform: translateY(calc(-100% - 32px));
}
.dm-gdpr-banner--top-left.is-visible { transform: translateY(0); }
.dm-gdpr-banner--top-left.is-leaving { transform: translateY(calc(-100% - 32px)); }

.dm-gdpr-banner--top-right {
    top: 24px; right: 24px;
    transform: translateY(calc(-100% - 32px));
}
.dm-gdpr-banner--top-right.is-visible { transform: translateY(0); }
.dm-gdpr-banner--top-right.is-leaving { transform: translateY(calc(-100% - 32px)); }

/* Center modal */
.dm-gdpr-banner--center {
    top: 50%; left: 50%;
    width: min(560px, calc(100vw - 40px));
    max-height: 80vh;
    border: 1px solid var(--dm-gdpr-border);
    border-radius: var(--dm-gdpr-radius);
    transform: translate(-50%, -50%) scale(0.92);
}
.dm-gdpr-banner--center.is-visible { transform: translate(-50%, -50%) scale(1); }
.dm-gdpr-banner--center.is-leaving { transform: translate(-50%, -50%) scale(0.92); }

/* ═══════════════════════════════════════════════════════════════
   INNER LAYOUT
   ═════════════════════════════════════════════════════════════ */

.dm-gdpr-banner__main {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px clamp(16px, 3vw, 40px);
    max-width: 1280px;
    margin: 0 auto;
}

.dm-gdpr-banner--bottom .dm-gdpr-banner__main,
.dm-gdpr-banner--top .dm-gdpr-banner__main {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
}

.dm-gdpr-banner--bottom-left .dm-gdpr-banner__main,
.dm-gdpr-banner--bottom-right .dm-gdpr-banner__main,
.dm-gdpr-banner--top-left .dm-gdpr-banner__main,
.dm-gdpr-banner--top-right .dm-gdpr-banner__main,
.dm-gdpr-banner--center .dm-gdpr-banner__main {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 24px;
}

@media (max-width: 640px) {
    .dm-gdpr-banner__main {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px;
    }
}

.dm-gdpr-banner__content { flex: 1; min-width: 0; }

.dm-gdpr-banner__title {
    font-size: var(--dm-gdpr-title-size);
    font-weight: var(--dm-gdpr-title-weight);
    letter-spacing: var(--dm-gdpr-title-tracking);
    text-transform: var(--dm-gdpr-title-transform);
    color: var(--dm-gdpr-text);
    margin: 0 0 6px;
    line-height: 1.25;
}

.dm-gdpr-banner__message {
    font-size: var(--dm-gdpr-msg-size);
    color: var(--dm-gdpr-text-muted);
    line-height: 1.65;
    margin: 0;
}

.dm-gdpr-banner__policy-link {
    color: var(--dm-gdpr-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-left: 4px;
    font-weight: 600;
}
.dm-gdpr-banner__policy-link:hover { color: var(--dm-gdpr-text); }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═════════════════════════════════════════════════════════════ */

.dm-gdpr-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.dm-gdpr-banner--bottom-left .dm-gdpr-banner__actions,
.dm-gdpr-banner--bottom-right .dm-gdpr-banner__actions,
.dm-gdpr-banner--top-left .dm-gdpr-banner__actions,
.dm-gdpr-banner--top-right .dm-gdpr-banner__actions,
.dm-gdpr-banner--center .dm-gdpr-banner__actions {
    width: 100%;
}

.dm-gdpr-banner__btn {
    font-family: inherit;
    font-size: var(--dm-gdpr-btn-size);
    font-weight: 600;
    letter-spacing: var(--dm-gdpr-btn-tracking);
    text-transform: var(--dm-gdpr-btn-transform);
    padding: 11px 22px;
    border-radius: var(--dm-gdpr-radius);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

/* Corner / modal layouts: equally-weighted buttons */
.dm-gdpr-banner--bottom-left .dm-gdpr-banner__btn,
.dm-gdpr-banner--bottom-right .dm-gdpr-banner__btn,
.dm-gdpr-banner--top-left .dm-gdpr-banner__btn,
.dm-gdpr-banner--top-right .dm-gdpr-banner__btn,
.dm-gdpr-banner--center .dm-gdpr-banner__btn { flex: 1; }

.dm-gdpr-banner__btn--primary {
    background-color: var(--dm-gdpr-accent);
    color: var(--dm-gdpr-accent-text);
    border: 1px solid var(--dm-gdpr-accent);
}
.dm-gdpr-banner__btn--primary:hover {
    background-color: var(--dm-gdpr-accent-hover);
    border-color: var(--dm-gdpr-accent-hover);
}

.dm-gdpr-banner__btn--secondary {
    background-color: transparent;
    color: var(--dm-gdpr-text);
    border: 1px solid var(--dm-gdpr-border);
}
.dm-gdpr-banner__btn--secondary:hover {
    border-color: var(--dm-gdpr-text);
}

.dm-gdpr-banner__btn:focus-visible {
    outline: 2px solid var(--dm-gdpr-accent);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PANEL
   ═════════════════════════════════════════════════════════════ */

.dm-gdpr-banner__settings {
    padding: 24px clamp(16px, 3vw, 40px) 28px;
    max-width: 860px;
    margin: 0 auto;
    background-color: var(--dm-gdpr-bg-elevated);
}

.dm-gdpr-banner--bottom-left .dm-gdpr-banner__settings,
.dm-gdpr-banner--bottom-right .dm-gdpr-banner__settings,
.dm-gdpr-banner--top-left .dm-gdpr-banner__settings,
.dm-gdpr-banner--top-right .dm-gdpr-banner__settings,
.dm-gdpr-banner--center .dm-gdpr-banner__settings {
    max-width: none;
    padding: 20px 24px 24px;
}

.dm-gdpr-banner__back {
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 14px;
    color: var(--dm-gdpr-text-muted);
    font-family: inherit;
    font-size: var(--dm-gdpr-btn-size);
    font-weight: 600;
    letter-spacing: var(--dm-gdpr-btn-tracking);
    text-transform: var(--dm-gdpr-btn-transform);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}
.dm-gdpr-banner__back:hover { color: var(--dm-gdpr-text); }

.dm-gdpr-banner__categories { margin: 16px 0 20px; }

.dm-gdpr-cat {
    padding: 14px 0;
    border-bottom: 1px solid var(--dm-gdpr-border);
}
.dm-gdpr-cat:last-child { border-bottom: 0; }

.dm-gdpr-cat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 5px;
}

.dm-gdpr-cat__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dm-gdpr-text);
}

.dm-gdpr-cat__always-on {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dm-gdpr-accent);
}

.dm-gdpr-cat__desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--dm-gdpr-text-muted);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   TOGGLE SWITCH
   ═════════════════════════════════════════════════════════════ */

.dm-gdpr-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
}

.dm-gdpr-toggle input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}

.dm-gdpr-toggle__track {
    width: 42px;
    height: 22px;
    background-color: var(--dm-gdpr-border);
    border-radius: 11px;
    position: relative;
    transition: background-color 0.2s ease;
}

.dm-gdpr-toggle__thumb {
    width: 16px;
    height: 16px;
    background-color: var(--dm-gdpr-bg);
    border-radius: 50%;
    position: absolute;
    top: 3px; left: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.dm-gdpr-toggle input:checked + .dm-gdpr-toggle__track {
    background-color: var(--dm-gdpr-accent);
}
.dm-gdpr-toggle input:checked + .dm-gdpr-toggle__track .dm-gdpr-toggle__thumb {
    transform: translateX(20px);
    background-color: var(--dm-gdpr-accent-text);
}

.dm-gdpr-toggle input:focus-visible + .dm-gdpr-toggle__track {
    outline: 2px solid var(--dm-gdpr-accent);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   LEAVE-PAGE STATE — rendered by JS when rejectAction = redirect
   ═════════════════════════════════════════════════════════════ */

.dm-gdpr-banner__leaving {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px clamp(16px, 3vw, 40px);
    text-align: center;
}

.dm-gdpr-banner__leaving-icon {
    font-size: 32px;
    line-height: 1;
    color: var(--dm-gdpr-accent);
    animation: dmGdprLeaveArrow 0.6s ease-in-out infinite alternate;
}

@keyframes dmGdprLeaveArrow {
    from { transform: translateX(0); }
    to   { transform: translateX(8px); }
}

.dm-gdpr-banner__leaving-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: var(--dm-gdpr-btn-tracking);
    text-transform: var(--dm-gdpr-btn-transform);
    color: var(--dm-gdpr-text-muted);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — tight phones
   ═════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .dm-gdpr-banner--bottom-left,
    .dm-gdpr-banner--bottom-right,
    .dm-gdpr-banner--top-left,
    .dm-gdpr-banner--top-right {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none;
    }

    .dm-gdpr-banner--bottom-left,
    .dm-gdpr-banner--bottom-right { bottom: 12px; }
    .dm-gdpr-banner--top-left,
    .dm-gdpr-banner--top-right    { top: 12px; }

    .dm-gdpr-banner--center {
        width: calc(100vw - 24px);
        max-width: none;
    }
}
