/* Musicash Cookie Consent */
/* Valori predefiniti: lo stile inline con i colori scelti nel pannello viene stampato dopo e li sostituisce. */
:root {
    --mcc-bg: #ffffff;
    --mcc-text: #1f2328;
    --mcc-accent: #dca236;
    --mcc-accent-text: #1f2328;
}
#mcc-root {
    --mcc-radius: 12px;
    --mcc-shadow: 0 10px 40px rgba(0, 0, 0, .22);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}
#mcc-root [hidden] { display: none !important; }

.mcc-banner {
    position: fixed;
    z-index: 2147483000;
    box-sizing: border-box;
    background: var(--mcc-bg);
    color: var(--mcc-text);
    box-shadow: var(--mcc-shadow);
    padding: 16px 18px 14px;
}
.mcc-pos-left .mcc-banner {
    left: 16px;
    bottom: 16px;
    width: 400px;
    max-width: calc(100vw - 32px);
    border-radius: var(--mcc-radius);
}
.mcc-pos-bottom .mcc-banner {
    left: 0;
    right: 0;
    bottom: 0;
    padding-left: max(20px, calc((100vw - 1100px) / 2));
    padding-right: max(20px, calc((100vw - 1100px) / 2));
}

.mcc-title {
    margin: 0 28px 6px 0;
    font-size: 16px;
    font-weight: 700;
}
.mcc-message { margin: 0 0 8px; }
.mcc-links { margin: 0 0 12px; font-size: 13px; }
.mcc-links a { color: inherit; text-decoration: underline; margin-right: 14px; }

.mcc-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
}
.mcc-close:hover, .mcc-close:focus-visible { opacity: 1; }

.mcc-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.mcc-btn {
    flex: 1 1 120px;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--mcc-accent);
}
/* Accetta e Rifiuta hanno lo stesso peso visivo, come chiede il Garante. */
.mcc-btn-main { background: var(--mcc-accent); color: var(--mcc-accent-text); }
.mcc-btn-ghost { background: transparent; color: var(--mcc-text); }
/* Nel banner i tre pulsanti stanno su una riga */
.mcc-banner .mcc-btn { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
.mcc-btn:hover { filter: brightness(.95); }
.mcc-btn:focus-visible, .mcc-close:focus-visible, .mcc-revoke:focus-visible, .mcc-toggle:focus-visible {
    outline: 3px solid var(--mcc-text);
    outline-offset: 2px;
}

/* Finestra delle preferenze */
.mcc-prefs {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mcc-prefs-box {
    position: relative;
    box-sizing: border-box;
    width: 560px;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--mcc-bg);
    color: var(--mcc-text);
    border-radius: var(--mcc-radius);
    box-shadow: var(--mcc-shadow);
    padding: 22px;
}
.mcc-cat {
    border-top: 1px solid rgba(127, 127, 127, .25);
    padding: 12px 0;
}
.mcc-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    cursor: pointer;
}
.mcc-cat-desc { margin: 4px 0 6px; opacity: .85; }
.mcc-always { font-size: 12px; font-weight: 600; opacity: .7; }
.mcc-cat-services summary { cursor: pointer; font-size: 13px; text-decoration: underline; }
.mcc-cat-services ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.mcc-cat-services li { margin-bottom: 6px; }
.mcc-prefs .mcc-buttons { margin-top: 12px; }

/* Interruttore */
.mcc-toggle {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    position: relative;
    width: 44px;
    height: 24px;
    margin: 0;
    border-radius: 12px;
    background: #b8bcc2;
    cursor: pointer;
    transition: background .15s;
}
.mcc-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
}
.mcc-toggle:checked { background: #1e9e3a; }
.mcc-toggle:checked::after { transform: translateX(20px); }

/* Pulsante per riaprire le preferenze */
.mcc-revoke {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 2147482999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--mcc-accent);
    color: var(--mcc-accent-text);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .85;
}
.mcc-revoke:hover { opacity: 1; }

/* Contenuti incorporati bloccati */
iframe.mcc-blocked { display: none !important; }
.mcc-placeholder {
    box-sizing: border-box;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    margin: 1em 0;
    border-radius: 10px;
    background: #f1f2f4;
    color: #1f2328;
    font-size: 14px;
    text-align: center;
}
.mcc-placeholder p { margin: 0; }
.mcc-placeholder-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.mcc-placeholder-accept {
    padding: 8px 16px;
    border-radius: 8px;
    border: 0;
    background: var(--mcc-accent, #dca236);
    color: var(--mcc-accent-text, #1f2328);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.mcc-placeholder a { color: inherit; text-decoration: underline; }

/* Cookie Policy */
.mcc-policy table { width: 100%; border-collapse: collapse; margin: 0 0 1.5em; font-size: .92em; }
.mcc-policy th, .mcc-policy td { border: 1px solid rgba(127, 127, 127, .3); padding: 8px; text-align: left; vertical-align: top; }
.mcc-policy th { background: rgba(127, 127, 127, .08); }
.mcc-policy .mcc-table-wrap { overflow-x: auto; }

@media (max-width: 480px) {
    .mcc-pos-left .mcc-banner { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; }
    .mcc-banner { font-size: 13px; padding: 14px 14px 10px; }
    /* Rifiuta e Accetta affiancati e identici; Personalizza sotto, come link */
    .mcc-banner .mcc-btn-main { flex: 1 1 0; min-width: 0; padding: 8px 6px; }
    .mcc-banner .mcc-btn-ghost {
        flex-basis: 100%;
        min-height: 34px;
        border: 0;
        text-decoration: underline;
        font-weight: 500;
    }
    .mcc-revoke { left: 10px; bottom: 10px; width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .mcc-toggle, .mcc-toggle::after { transition: none; }
}
