/* =========================================================================
 *  ez-cookies.css (v3.65) — premium cookie-consent banner + preferences modal.
 *  Vanilla, no framework. Owned namespace: .ezck-*. Paired with ez-cookies.js.
 *  Reduced-motion guarded; mobile-first; never blocks the page (banner is a
 *  bottom sheet, the modal is the only focus trap).
 * ========================================================================= */

.ezck-hidden { display: none !important; }

/* ---- Bottom banner (first visit) ---- */
.ezck-banner {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(0);
    z-index: 5000;
    width: min(960px, calc(100vw - 28px));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 20px;
    box-shadow: 0 30px 70px -28px rgba(15, 23, 42, 0.45);
    padding: 18px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    animation: ezckRise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ezckRise {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.ezck-banner__icon {
    width: 46px; height: 46px; border-radius: 14px; flex: none;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 10px 22px -8px rgba(99, 102, 241, 0.7);
}
.ezck-banner__icon svg { width: 24px; height: 24px; }
.ezck-banner__body { min-width: 0; }
.ezck-banner__title {
    font-weight: 800; color: #0f172a; font-size: 15px; letter-spacing: -0.01em;
    margin: 0 0 3px;
}
.ezck-banner__text {
    color: #475569; font-size: 13px; line-height: 1.5; margin: 0;
}
.ezck-banner__text a { color: #4f46e5; font-weight: 600; text-decoration: none; }
.ezck-banner__text a:hover { text-decoration: underline; }
.ezck-banner__actions {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---- Buttons (self-contained so the banner works on every shell) ---- */
.ezck-btn {
    font: inherit; cursor: pointer; border-radius: 11px; padding: 10px 16px;
    font-size: 13.5px; font-weight: 700; border: 1px solid transparent;
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.ezck-btn:focus-visible {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}
.ezck-btn--primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
    box-shadow: 0 10px 22px -10px rgba(99, 102, 241, 0.8);
}
.ezck-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -10px rgba(99, 102, 241, 0.9); }
.ezck-btn--ghost {
    background: rgba(99, 102, 241, 0.08); color: #4338ca;
    border-color: rgba(99, 102, 241, 0.22);
}
.ezck-btn--ghost:hover { background: rgba(99, 102, 241, 0.14); }
.ezck-btn--text {
    background: transparent; color: #475569; padding: 10px 12px;
}
.ezck-btn--text:hover { color: #4338ca; background: rgba(99, 102, 241, 0.06); }

/* ---- Preferences modal ---- */
.ezck-overlay {
    position: fixed; inset: 0; z-index: 5100;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 18px;
    animation: ezckFade 0.22s ease both;
}
@keyframes ezckFade { from { opacity: 0; } to { opacity: 1; } }
.ezck-modal {
    width: min(560px, 100%);
    max-height: calc(100dvh - 36px);
    background: #fff; border-radius: 22px; overflow: hidden;
    box-shadow: 0 50px 110px -40px rgba(15, 23, 42, 0.6);
    display: flex; flex-direction: column;
    animation: ezckPop 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ezckPop {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.ezck-modal__head {
    padding: 20px 22px 14px; border-bottom: 1px solid #eef2f7;
    display: flex; align-items: flex-start; gap: 13px;
}
.ezck-modal__head .ezck-banner__icon { width: 42px; height: 42px; border-radius: 13px; }
.ezck-modal__head h2 { font-size: 18px; font-weight: 800; color: #0f172a; margin: 0; letter-spacing: -0.01em; }
.ezck-modal__head p { font-size: 12.5px; color: #64748b; margin: 3px 0 0; line-height: 1.45; }
.ezck-modal__close {
    margin-left: auto; background: #f1f5f9; border: none; cursor: pointer;
    width: 34px; height: 34px; border-radius: 10px; color: #475569; flex: none;
    display: flex; align-items: center; justify-content: center;
}
.ezck-modal__close:hover { background: #e2e8f0; color: #0f172a; }
.ezck-modal__close:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
.ezck-modal__body { padding: 8px 22px 4px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.ezck-cat {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 14px;
    align-items: center; padding: 16px 0; border-bottom: 1px solid #f1f5f9;
}
.ezck-cat:last-child { border-bottom: none; }
.ezck-cat__name { font-weight: 700; color: #0f172a; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.ezck-cat__desc { grid-column: 1 / 2; color: #64748b; font-size: 12.5px; line-height: 1.5; margin: 0; }
.ezck-cat__locked { font-size: 11px; font-weight: 700; color: #047857; background: rgba(16, 185, 129, 0.12); padding: 3px 9px; border-radius: 999px; }

/* iOS-style toggle */
.ezck-switch { position: relative; width: 46px; height: 27px; flex: none; }
.ezck-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ezck-switch__track {
    position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1;
    transition: background 0.2s ease;
}
.ezck-switch__track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
    border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(15, 23, 42, 0.3);
    transition: transform 0.2s ease;
}
.ezck-switch input:checked + .ezck-switch__track { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ezck-switch input:checked + .ezck-switch__track::after { transform: translateX(19px); }
.ezck-switch input:focus-visible + .ezck-switch__track { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); }
.ezck-switch input:disabled { cursor: not-allowed; }
.ezck-switch input:disabled + .ezck-switch__track { background: #a7f3d0; opacity: 0.9; }

.ezck-modal__foot {
    padding: 14px 22px; border-top: 1px solid #eef2f7;
    display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
    background: #fbfcff;
}

@media (max-width: 720px) {
    .ezck-banner {
        grid-template-columns: 1fr; gap: 12px; padding: 16px;
        bottom: 10px; width: calc(100vw - 18px);
    }
    .ezck-banner__icon { width: 40px; height: 40px; }
    .ezck-banner__actions { justify-content: stretch; }
    .ezck-banner__actions .ezck-btn { flex: 1 1 auto; justify-content: center; }
    .ezck-modal__foot { justify-content: stretch; }
    .ezck-modal__foot .ezck-btn { flex: 1 1 auto; justify-content: center; }
}

/* ---- v3.70 — no-overflow hardening for small phones (320–480px) ---- */
.ezck-banner, .ezck-banner *, .ezck-modal, .ezck-modal * { box-sizing: border-box; }
.ezck-banner__title, .ezck-banner__text,
.ezck-cat__name, .ezck-cat__desc, .ezck-modal__head h2, .ezck-modal__head p {
    overflow-wrap: anywhere; word-break: break-word; min-width: 0;
}
@media (max-width: 480px) {
    .ezck-banner {
        left: 8px; right: 8px; bottom: 8px;
        transform: none; width: auto; max-width: none;
        padding: 14px; border-radius: 16px; gap: 10px;
    }
    @keyframes ezckRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
    .ezck-banner__actions { flex-direction: column; align-items: stretch; gap: 8px; }
    .ezck-banner__actions .ezck-btn { width: 100%; justify-content: center; }
    .ezck-overlay { padding: 8px; align-items: flex-end; }
    .ezck-modal {
        width: 100%; max-height: calc(100dvh - 16px); border-radius: 18px 18px 0 0;
    }
    .ezck-modal__head { padding: 16px 16px 12px; }
    .ezck-modal__body { padding: 6px 16px 4px; }
    .ezck-modal__foot { padding: 12px 16px; flex-direction: column; }
    .ezck-modal__foot .ezck-btn { width: 100%; justify-content: center; }
    .ezck-cat { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 14px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ezck-banner, .ezck-overlay, .ezck-modal { animation: none; }
    .ezck-btn, .ezck-switch__track, .ezck-switch__track::after { transition: none; }
    .ezck-btn--primary:hover { transform: none; }
}
