/**
 * @session  2026-10-09  ef153541-27a1-471d-b1c2-f94898bcce93
 * @purpose  Wyglad wlasnego CMP (banner, przycisk ustawien, fasada YouTube, deklaracja) - pilot www.muscle-zone.de, plik niezalezny od muscle-zone.css
 * @version  1.0
 * @change   Wydzielone z mz-consent.js (ficzer testowy w osobnych plikach)
 */

mz-consent {
    position: fixed;
    z-index: 2147483000;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    color: #060606;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
    font-size: 14px;
    line-height: 1.5;

    &[hidden] {
        display: none;
    }

    & consent-box {
        display: flex;
        gap: 24px;
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px;
    }

    & consent-text {
        display: block;
        flex: 1;
    }

    & h2 {
        margin: 0 0 6px;
        font-size: 17px;
        font-weight: 700;
    }

    & p {
        margin: 0;
    }

    & a {
        text-decoration: underline;
    }

    & consent-settings {
        display: none;
        margin-top: 12px;

        & label {
            display: block;
            margin-top: 10px;
            font-weight: 700;
        }

        & input {
            width: 18px;
            height: 18px;
            margin: 0 8px 0 0;
            vertical-align: -3px;
            appearance: auto;
            accent-color: #060606;
        }

        & p {
            margin-left: 26px;
            color: #444;
        }
    }

    & consent-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 0 0 230px;

        & button {
            padding: 11px 16px;
            border: 2px solid #060606;
            border-radius: 4px;
            background: #060606;
            color: #fff;
            font-weight: 700;
            cursor: pointer;

            &:hover {
                background: #333;
                border-color: #333;
            }
        }
    }

    & button:focus-visible, & input:focus-visible, & a:focus-visible {
        outline: 3px solid #92D500;
        outline-offset: 2px;
    }

    & [data-act="save"] {
        display: none;
    }

    &[data-view="settings"] {
        & consent-settings, & [data-act="save"] {
            display: block;
        }

        & [data-act="settings"] {
            display: none;
        }
    }

    @media (max-width: 760px) {
        & consent-box {
            flex-direction: column;
            align-items: stretch;
            gap: 14px;
            padding: 16px;
        }

        & consent-actions {
            flex: none;
        }
    }
}

mz-consent-toggle {
    position: fixed;
    z-index: 2147482999;
    left: 16px;
    bottom: 16px;
    display: block;

    &[hidden] {
        display: none;
    }

    & button {
        display: block;
        width: 44px;
        height: 44px;
        padding: 10px;
        border: 0;
        border-radius: 50%;
        background: #060606;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    }

    & svg {
        display: block;
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 600px) {
    body[data-route="product-product"] mz-consent-toggle {
        bottom: 76px;
    }
}

iframe[data-mz-src] {
    display: none !important;
}

mz-video-consent {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    padding: 20px;
    background: #111;
    color: #fff;
    text-align: center;
    font-size: 14px;

    & span {
        display: block;
        max-width: 460px;
    }

    & button {
        padding: 10px 18px;
        border: 2px solid #fff;
        border-radius: 4px;
        background: transparent;
        color: #fff;
        font-weight: 700;
        cursor: pointer;
    }
}

mz-cookie-declaration {
    display: block;
    margin: 20px 0;

    & table {
        width: 100%;
        margin: 8px 0 20px;
        font-size: 13px;
    }

    & th, & td {
        padding: 6px 8px;
        border: 1px solid #ddd;
        text-align: left;
        vertical-align: top;
    }

    & button {
        padding: 8px 14px;
        border: 2px solid #060606;
        border-radius: 4px;
        background: #060606;
        color: #fff;
        font-weight: 700;
        cursor: pointer;
    }
}
