/* Me Digital — Cookie consent banner & preferences (mobile-first) */

.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6000;
    background: #212529;
    color: #fff;
    border-top: 3px solid #f9d71c;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
}

.cookie-consent-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-consent-banner__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: #f9d71c;
}

.cookie-consent-banner__body {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #e9ecef;
}

.cookie-consent-banner__body a {
    color: #f7dc6f;
}

.cookie-consent-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cookie-consent-btn {
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    width: 100%;
    text-align: center;
}

.cookie-consent-btn--primary {
    background: #f9d71c;
    color: #212529;
}

.cookie-consent-btn--secondary {
    background: transparent;
    color: #fff;
    border: 1px solid #6c757d;
}

/* Secondary buttons on light panels (modal + preferences page) */
.cookie-preferences-modal__panel .cookie-consent-btn--secondary,
.legal-preferences-page .cookie-consent-btn--secondary {
    color: #212529;
    border-color: #adb5bd;
    background: #fff;
}

.cookie-preferences-modal__panel .cookie-consent-btn--secondary:hover,
.legal-preferences-page .cookie-consent-btn--secondary:hover {
    background: #f8f9fa;
    border-color: #6c757d;
}

.cookie-consent-btn:hover {
    opacity: 0.92;
}

body.cookie-banner-open .footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.cookie-consent-toast {
    position: fixed;
    left: 50%;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(12px);
    background: #212529;
    color: #f7dc6f;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 7500;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: calc(100vw - 2rem);
    text-align: center;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cookie-consent-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cookie-preferences {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-pref-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.cookie-pref-row__text {
    flex: 1;
    min-width: 0;
}

.cookie-pref-row__text strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #212529;
}

.cookie-pref-row__text p {
    margin: 0;
    font-size: 0.875rem;
    color: #495057;
    line-height: 1.45;
}

.cookie-pref-toggle {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 28px;
    margin-top: 0.15rem;
}

.cookie-pref-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cookie-pref-toggle input:disabled {
    cursor: not-allowed;
}

.cookie-pref-toggle__ui {
    display: block;
    width: 48px;
    height: 28px;
    background: #ced4da;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.cookie-pref-toggle__ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-pref-toggle input:checked + .cookie-pref-toggle__ui {
    background: #f9d71c;
}

.cookie-pref-toggle input:checked + .cookie-pref-toggle__ui::after {
    transform: translateX(20px);
}

.cookie-pref-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cookie-preferences-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 7000;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-preferences-modal__panel {
    background: #fff;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: min(90vh, 640px);
    overflow-y: auto;
    padding: 1.25rem;
    position: relative;
}

.cookie-preferences-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #6c757d;
    min-width: 44px;
    min-height: 44px;
}

.cookie-preferences-modal__intro {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
}

.cookie-preferences-modal__links {
    font-size: 0.875rem;
    margin-top: 1rem;
}

.cookie-preferences-modal__links a {
    color: #856404;
}

@media (min-width: 640px) {
    .cookie-consent-banner__inner {
        flex-direction: row;
        align-items: center;
    }

    .cookie-consent-banner__text {
        flex: 1;
    }

    .cookie-consent-banner__actions {
        flex-direction: row;
        flex-shrink: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: 420px;
    }

    .cookie-consent-btn {
        width: auto;
        min-width: 140px;
    }

    .cookie-pref-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .cookie-pref-actions .cookie-consent-btn {
        width: auto;
    }
}

@media (min-width: 900px) {
    .cookie-consent-banner__actions {
        max-width: none;
    }
}
