/**
 * Cookie consent banner — prominent but NON-BLOCKING bottom card.
 *
 * The fixed wrapper stays full-width with pointer-events:none so clicks pass
 * through to the page (the banner never blocks browsing); only the card itself is
 * interactive. Centering comes from the card's margin, NOT a transform — so the
 * JS exit (which sets transform:translateY on the wrapper) keeps working untouched.
 *
 * NO backdrop-filter: blur is invisible behind the opaque card and is the canonical
 * Android Chrome fixed-element scroll-smear trigger. Markup ids
 * (#cookieNotice/#cookieAccept/#cookieDecline) + the consent contract live in
 * inc/cookie-notice.php / assets/js/cookie-notice.js — keep all three in sync.
 */

.cookie-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none; /* page stays clickable; only .cookie-notice__card re-enables */
    display: flex;
    justify-content: center;
    padding: 0 1.5rem 1.5rem;
}

.cookie-notice__card {
    pointer-events: auto;
    width: 100%;
    max-width: 560px;
    background: #1a1a2e;
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-top: 3px solid var(--color-accent, #c9a96e);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    padding: 1.25rem 1.4rem 1.1rem;
    font-family: 'Inter', sans-serif;
}

.cookie-notice__head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 0.35rem;
}
.cookie-notice__head-icon {
    color: var(--color-accent, #c9a96e);
    flex-shrink: 0;
}
.cookie-notice__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

/* Collapse / expand toggle — lets the visitor shrink the card to read the page
   (e.g. the Privacy Policy) without dismissing it. Choice still required. */
.cookie-notice__toggle {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-accent, #c9a96e);
    cursor: pointer;
    transition: background 0.2s;
}
.cookie-notice__toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}
.cookie-notice__toggle-icon {
    transition: transform 0.25s ease;
}
.cookie-notice--collapsed .cookie-notice__toggle-icon {
    transform: rotate(180deg);
}
.cookie-notice--collapsed .cookie-notice__intro,
.cookie-notice--collapsed .cookie-notice__services,
.cookie-notice--collapsed .cookie-notice__reassure,
.cookie-notice--collapsed .cookie-notice__link {
    display: none;
}
.cookie-notice--collapsed .cookie-notice__actions {
    margin-bottom: 0;
}

.cookie-notice__intro {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
}

.cookie-notice__services {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cookie-notice__service {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 0.6rem 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}
.cookie-notice__service-icon {
    color: var(--color-accent, #c9a96e);
    flex-shrink: 0;
    margin-top: 1px;
}
.cookie-notice__service-text {
    display: block;
}
.cookie-notice__service-name {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #fff;
}
.cookie-notice__service-prov {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
}
.cookie-notice__service-why {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.68);
}

.cookie-notice__actions {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}
.cookie-notice__accept,
.cookie-notice__decline {
    flex: 1;
    padding: 11px 18px;
    border-radius: 7px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
    border: 1px solid transparent;
}
.cookie-notice__accept {
    background: var(--color-accent, #c9a96e);
    color: var(--color-bg-dark, #1a1a2e);
}
.cookie-notice__accept:hover {
    opacity: 0.9;
}
.cookie-notice__decline {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.28);
}
.cookie-notice__decline:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.cookie-notice__reassure {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 0.55rem;
    font-size: 0.74rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
}
.cookie-notice__reassure-icon {
    color: var(--color-accent, #c9a96e);
    flex-shrink: 0;
    margin-top: 1px;
}

.cookie-notice__link {
    font-size: 0.76rem;
    color: var(--color-accent, #c9a96e);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Keyboard focus visibility */
.cookie-notice__accept:focus-visible,
.cookie-notice__decline:focus-visible,
.cookie-notice__link:focus-visible {
    outline: 2px solid var(--color-accent, #c9a96e);
    outline-offset: 2px;
}

/* Motion: CSS-only slide-up entrance + a one-time gold attention pulse.
   No requestAnimationFrame. Fully suppressed under prefers-reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
    .cookie-notice {
        animation: cookieSlideUp 0.5s ease-out;
    }
    .cookie-notice__card {
        animation: cookieGlow 1.4s ease-in-out 0.55s 2;
    }
}
@keyframes cookieSlideUp {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes cookieGlow {
    0%, 100% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(201, 169, 110, 0); }
    50%      { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(201, 169, 110, 0.5); }
}

/* Mobile: clear the 64px bottom nav + iOS home indicator; near-full-width card. */
@media (max-width: 767px) {
    .cookie-notice {
        padding: 0 0.75rem calc(64px + env(safe-area-inset-bottom, 0px) + 0.6rem);
    }
    .cookie-notice__card {
        max-width: none;
        padding: 1.1rem 1.1rem 1rem;
    }
    .cookie-notice__title {
        font-size: 1rem;
    }
}
