/* =============================================================================
   COOKIE CONSENT BANNER
   Uses shared theme CSS variables (see shared-styles.css :root). Scoped class
   names (cookie-*) to avoid clashing with the existing .toggle/.modal classes
   used elsewhere (modal.css, auth-modal.css).
   ============================================================================= */

.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: flex;
    justify-content: center;
    padding: 16px;
    animation: cookieConsentSlideUp 0.35s ease-out;
}

@keyframes cookieConsentSlideUp {
    from {
        transform: translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent-inner {
    width: 100%;
    max-width: 1400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

/* ---- Summary (first-touch) view ---------------------------------------- */

.cookie-consent-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1 1 320px;
    min-width: 240px;
}

.cookie-consent-text strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.cookie-consent-text p {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.cookie-consent-text a {
    color: var(--accent);
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---- Buttons (mirrors .btn-primary / .btn-secondary visual language) --- */

.cookie-btn {
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
    max-width: 97%;
}

.cookie-btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.cookie-btn-primary:hover {
    background: #FCD535;
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.cookie-btn-secondary:hover {
    background: var(--bg-tertiary);
}

.cookie-btn-text {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.cookie-btn-text:hover {
    color: var(--accent);
}

/* ---- Customize panel ----------------------------------------------------- */

.cookie-consent-customize {
    padding: 18px 22px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.cookie-consent-customize-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cookie-consent-customize-header strong {
    font-size: 14px;
    color: var(--text-primary);
}

.cookie-consent-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.cookie-consent-close:hover {
    color: var(--text-primary);
}

.cookie-category {
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.cookie-category:first-of-type {
    border-top: none;
}

.cookie-category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cookie-category-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-category-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-tertiary);
    margin: 4px 0 0;
    padding-right: 60px;
}

/* ---- Toggle switch (visually matches modal.css's .toggle, scoped to avoid collision) */

.cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.cookie-toggle.on {
    background: var(--green);
    border-color: var(--green);
}

.cookie-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.cookie-toggle.on .cookie-toggle-knob {
    transform: translateX(20px);
}

.cookie-toggle-locked {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px 10px;
    flex-shrink: 0;
}

.cookie-consent-customize .cookie-consent-actions {
    margin-top: 16px;
    justify-content: flex-end;
}

/* ---- Footer "Cookie Settings" trigger ------------------------------------ */
/* A <button>, not <a>, since it opens the panel via JS rather than navigating.
   Styled to match .footer-links a in shared-styles.css. */

.footer-cookie-settings-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s;
}

.footer-cookie-settings-btn:hover {
    color: var(--accent);
}

/* ---- Mobile ---------------------------------------------------------------- */

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 0;
    }

    .cookie-consent-inner {
        max-width: 97%;
        border-radius: 16px 16px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .cookie-consent-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px 18px 18px;
    }

    .cookie-consent-actions {
        justify-content: stretch;
    }

    .cookie-consent-actions .cookie-btn {
        flex: 1 1 auto;
    }

    .cookie-category-desc {
        padding-right: 0;
    }

    .cookie-consent-text {
        flex: 1 1 75px;
    }
}
