/* Banner dei cookie, riquadri dei contenuti di terze parti e pagina Cookie policy. */
.jc-consent {
    position: fixed;
    z-index: 100000;
    right: 16px;
    bottom: 16px;
    left: 16px;
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
}

.jc-consent[hidden] {
    display: none;
}

.jc-consent__box {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 460px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 24px;
    border-top: 4px solid #dd0731;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(25, 0, 6, .28);
    color: #303030;
    pointer-events: auto;
}

.jc-consent h2 {
    margin: 0 36px 8px 0;
    color: #303030;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.jc-consent p {
    margin: 0;
    color: #575757;
    font-size: 14px;
    line-height: 1.55;
}

.jc-consent p a {
    color: #dd0731;
    font-weight: 700;
    text-decoration: underline;
}

.jc-consent__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #575757;
    cursor: pointer;
}

.jc-consent .jc-consent__close:is(:hover, :focus-visible, :active) {
    border: 0 !important;
    background: #f4f4f4 !important;
    color: #303030 !important;
}

.jc-consent__preferences {
    margin: 16px 0 0;
}

.jc-consent__preferences fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.jc-consent__preferences ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jc-consent__category label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
}

.jc-consent__category input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Interruttore: stato reso dalla casella nascosta, focus visibile. */
.jc-consent__switch {
    position: relative;
    flex: none;
    width: 40px;
    height: 24px;
    margin-top: 2px;
    border-radius: 999px;
    background: #c9c9c9;
    transition: background-color .15s ease;
}

.jc-consent__switch::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .15s ease;
    content: "";
}

.jc-consent__category input:checked + .jc-consent__switch {
    background: #dd0731;
}

.jc-consent__category input:checked + .jc-consent__switch::after {
    transform: translateX(16px);
}

.jc-consent__category input:disabled + .jc-consent__switch {
    opacity: .55;
}

.jc-consent__category input:focus-visible + .jc-consent__switch {
    outline: 2px solid #dd0731;
    outline-offset: 2px;
}

.jc-consent__label {
    display: grid;
    gap: 2px;
    font-size: 13px;
    line-height: 1.45;
}

.jc-consent__label strong {
    color: #303030;
    font-size: 14px;
}

.jc-consent__label span {
    color: #575757;
}

.jc-consent__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

/* «Rifiuta» e «Accetta tutti» hanno lo stesso peso visivo. */
.jc-consent__btn {
    display: inline-flex;
    flex: 1 1 140px;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin: 0;
    padding: 0 20px;
    border: 1px solid #dd0731;
    border-radius: 999px;
    background: #dd0731;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
}

.jc-consent__btn[hidden],
.jc-consent__link[hidden] {
    display: none;
}

.jc-consent__link {
    min-height: 44px;
    margin: 0 auto 0 0;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: #303030;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* Il tema colora di rosso lo sfondo di ogni pulsante al passaggio: qui resta un link. */
.jc-consent .jc-consent__link:is(:hover, :focus, :focus-visible, :active) {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #dd0731 !important;
}

/* All'apertura il fuoco va al riquadro, senza evidenziare nessun pulsante. */
.jc-consent__box:focus {
    outline: none;
}

.jc-consent :is(button, a):focus-visible {
    outline: 2px solid #dd0731;
    outline-offset: 2px;
}

.jc-consent__visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Footer: pulsante «Preferenze cookie» con l'aspetto dei link legali. */
.jc-footer__legal button.jc-footer__cookie-prefs {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.jc-footer__legal button.jc-footer__cookie-prefs:is(:hover, :focus-visible, :active) {
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: #fff;
    text-decoration: underline;
}

/* Pulsante fisso per riaprire le preferenze, dopo la prima scelta. */
.jc-consent-reopen {
    position: fixed;
    z-index: 99990;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 18px rgba(48, 48, 48, .18);
    color: #dd0731;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.jc-consent-reopen[hidden] {
    display: none;
}

/* Il tema colora di rosso lo sfondo dei pulsanti al passaggio: qui resta bianco. */
.jc-consent-reopen:is(:hover, :focus-visible, :active) {
    border-color: #dd0731 !important;
    background: #fff !important;
    color: #dd0731 !important;
    box-shadow: 0 8px 22px rgba(48, 48, 48, .24) !important;
    transform: translateY(-1px);
}

.jc-consent-reopen:focus-visible {
    outline: 2px solid #dd0731;
    outline-offset: 3px;
}

/* Telefono, pagine filiale: sopra la barra «Chiama / Indicazioni». */
@media (max-width: 767px) {
    body:has(.jc-branch__sticky:not(.is-hidden)) .jc-consent-reopen {
        bottom: calc(86px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    .jc-consent-reopen {
        transition: none;
    }
}

/* Riquadro al posto di mappe e video finché manca il consenso. */
.jc-consent-embed {
    box-sizing: border-box;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 260px;
    padding: 24px;
    background:
        repeating-linear-gradient(-45deg, rgba(221, 7, 49, .05) 0 1px, transparent 1px 18px),
        #f6f6f6;
    color: #575757;
    text-align: center;
}

.jc-consent-embed p {
    max-width: 36ch;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.jc-consent-embed strong {
    display: block;
    margin-bottom: 4px;
    color: #303030;
    font-size: 16px;
}

.jc-consent-embed__button {
    min-height: 46px;
    margin: 0;
    padding: 0 22px;
    border: 1px solid #dd0731;
    border-radius: 999px;
    background: #dd0731;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.jc-consent-embed a {
    color: #575757;
    font-size: 13px;
    text-decoration: underline;
}

@media (min-width: 1024px) {
    .jc-branch__map .jc-consent-embed {
        min-height: 420px;
    }
}

/* Pagina Cookie policy */
.jc-cookie-policy__body {
    box-sizing: border-box;
    width: min(860px, calc(100% - 2 * clamp(16px, 4vw, 48px)));
    margin: 0 auto;
    padding-block: clamp(28px, 5vw, 56px) clamp(40px, 6vw, 72px);
    color: #303030;
    font-size: 16px;
    line-height: 1.65;
}

.jc-cookie-policy__body h2 {
    margin: 1.8em 0 .5em;
    color: #303030;
    font-size: clamp(1.3rem, 2.4vw, 1.65rem);
    line-height: 1.25;
}

.jc-cookie-policy__body p,
.jc-cookie-policy__body ul {
    margin: 0 0 1em;
}

.jc-cookie-policy__body ul {
    padding-left: 1.3em;
    list-style: disc;
}

.jc-cookie-policy__body li {
    margin-bottom: .35em;
}

.jc-cookie-policy__body a {
    color: #dd0731;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.jc-cookie-policy__updated {
    color: #666;
    font-size: 14px;
}

.jc-cookie-policy__note {
    color: #666;
    font-size: 14px;
}

.jc-cookie-policy__open.jc-consent__btn {
    flex: none;
}

.jc-cookie-policy__table {
    margin: 0 0 1em;
    overflow-x: auto;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
}

.jc-cookie-policy__table table {
    width: 100%;
    min-width: 560px;
    margin: 0;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
}

.jc-cookie-policy__table :is(th, td) {
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
    vertical-align: top;
}

.jc-cookie-policy__table thead th {
    background: #f6f6f6;
    color: #303030;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.jc-cookie-policy__table tbody tr:last-child :is(th, td) {
    border-bottom: 0;
}

.jc-cookie-policy__table code {
    padding: 0;
    border: 0;
    background: none;
    color: #303030;
    font-family: inherit;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 559px) {
    .jc-consent {
        right: 8px;
        bottom: 8px;
        left: 8px;
    }

    .jc-consent__box {
        width: 100%;
        padding: 20px 18px;
    }
}
