/* ================================================================
   COOKIE CONSENT — dark theme, modern layout
   ================================================================ */

/* ---------- BANNER ---------- */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    background: #12121a;
    border-top: 1px solid rgba(245, 200, 66, 0.35);
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.55);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
    visibility: hidden;
}
.cookie-banner.is-visible {
    transform: translateY(0);
    visibility: visible;
}

.cookie-banner__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cookie-banner__text {
    flex: 1;
    min-width: 260px;
    color: #d8d8de;
    font-size: 0.9rem;
    line-height: 1.55;
}
.cookie-banner__text strong {
    display: block;
    color: #f5f5f5;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.cookie-banner__text p { margin: 0; }
.cookie-banner__text a {
    color: #f5c842;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-banner__text a:hover { color: #ffd95e; }

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---------- BUTTONS (shared) ---------- */
.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    color: #f5f5f5;
}
.cookie-btn:focus-visible {
    outline: 2px solid #f5c842;
    outline-offset: 2px;
}
.cookie-btn:active { transform: scale(0.98); }

.cookie-btn--primary {
    background: linear-gradient(135deg, #f5c842, #f7b32b);
    color: #0b0b0b;
    border-color: #f5c842;
}
.cookie-btn--primary:hover { background: linear-gradient(135deg, #ffd95e, #f5c842); }

.cookie-btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e0e0e6;
}
.cookie-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(245, 200, 66, 0.4);
    color: #f5c842;
}

/* ---------- MODAL ---------- */
.cookie-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0));
}
.cookie-settings-modal.is-open {
    display: flex;
    animation: cookieFadeIn 0.25s ease;
}
@keyframes cookieFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cookie-settings-content {
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    max-width: 560px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
    color: #f5f5f5;
    animation: cookieSlideUp 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes cookieSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.cookie-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.cookie-settings-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.cookie-settings-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f5f5f5;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.cookie-settings-close:hover,
.cookie-settings-close:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(245, 200, 66, 0.4);
    color: #f5c842;
    outline: none;
}

.cookie-settings-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.cookie-intro {
    margin: 0 0 18px;
    color: #b0b0bc;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---------- COOKIE TYPE CARDS ---------- */
.cookie-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cookie-type {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
}
.cookie-type--required {
    background: rgba(245, 200, 66, 0.04);
    border-color: rgba(245, 200, 66, 0.25);
}
.cookie-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.cookie-type-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f5f5f5;
}
.cookie-type-title i {
    color: #f5c842;
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
}
.cookie-type-description {
    margin: 0;
    font-size: 0.8rem;
    color: #a0a0aa;
    line-height: 1.55;
}
.cookie-pill {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f5c842;
    background: rgba(245, 200, 66, 0.15);
    border: 1px solid rgba(245, 200, 66, 0.3);
    border-radius: 40px;
    padding: 3px 10px;
    flex-shrink: 0;
}

/* ---------- TOGGLE ---------- */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.cookie-toggle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}
.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 26px;
    transition: background 0.2s ease;
}
.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #f5f5f5;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #f5c842, #f7b32b);
}
.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(22px);
    background: #0b0b0b;
}
.cookie-toggle input:focus-visible + .cookie-toggle-slider {
    outline: 2px solid #f5c842;
    outline-offset: 2px;
}

/* ---------- FOOTER ---------- */
.cookie-settings-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0));
}

/* ---------- FLOATING PREFERENCES BUTTON ---------- */
.cookie-preferences-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #12121a;
    border: 2px solid rgba(245, 200, 66, 0.5);
    color: #f5c842;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 8500;
    -webkit-tap-highlight-color: transparent;
}
.cookie-preferences-btn:hover,
.cookie-preferences-btn:focus-visible {
    background: #f5c842;
    color: #0b0b0b;
    transform: scale(1.08);
    outline: none;
}
.cookie-preferences-btn i { font-size: 1.1rem; }

/* ---------- MOBILE ---------- */
@media (max-width: 639px) {
    .cookie-banner__inner {
        padding: 16px;
        gap: 14px;
    }
    .cookie-banner__text {
        font-size: 0.85rem;
    }
    .cookie-banner__actions {
        width: 100%;
        flex-direction: column;
    }
    .cookie-btn {
        width: 100%;
        min-height: 44px;
    }
    .cookie-settings-modal { padding: 12px; }
    .cookie-settings-header { padding: 16px; }
    .cookie-settings-header h3 { font-size: 1rem; }
    .cookie-settings-body { padding: 16px; }
    .cookie-settings-footer {
        padding: 12px 16px;
        flex-direction: column-reverse;
    }
    .cookie-settings-footer .cookie-btn {
        width: 100%;
    }
    .cookie-preferences-btn {
        width: 44px;
        height: 44px;
        bottom: 16px;
        right: 16px;
    }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-settings-modal,
    .cookie-settings-content,
    .cookie-toggle-slider,
    .cookie-toggle-slider::before {
        transition: none !important;
        animation: none !important;
    }
}