/* ============================================================
   Cookie Consent - GDPR popup centrato (stile fondosanedil.it)
   ============================================================ */

/* Overlay scuro */
.cc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.cc-overlay.cc-visible {
    display: flex;
}

/* Body scroll lock */
body.cookie-consent-open {
    overflow: hidden;
}

/* ---- Banner principale ---- */
.cc-banner {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    max-width: 440px;
    width: 90%;
    padding: 28px 24px 24px;
    text-align: center;
}

.cc-banner__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #222;
}

.cc-banner__text {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin: 0 0 20px;
}

.cc-banner__text a {
    color: #006B34;
    text-decoration: underline;
}

.cc-banner__buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Pulsanti comuni */
.cc-btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    line-height: 1.4;
}

.cc-btn:hover {
    opacity: 0.85;
}

.cc-btn--accept {
    background: #006B34;
    color: #fff;
}

.cc-btn--reject,
.cc-btn--settings {
    background: transparent;
    border: 1px solid #000;
    color: #000;
}

/* ---- Pannello Preferenze ---- */
.cc-preferences {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    max-width: 700px;
    width: 92%;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.cc-preferences__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #eee;
}

.cc-preferences__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #222;
}

.cc-preferences__close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    line-height: 1;
}

.cc-preferences__close:hover {
    color: #000;
}

.cc-preferences__body {
    padding: 16px 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.cc-preferences__footer {
    padding: 12px 24px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Categoria */
.cc-category {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cc-category:last-child {
    border-bottom: none;
}

.cc-category__info {
    flex: 1;
    padding-right: 16px;
}

.cc-category__label {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin: 0 0 4px;
}

.cc-category__desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Toggle switch (stile iOS) */
.cc-toggle {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 24px;
    margin-top: 2px;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cc-toggle__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.cc-toggle__slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.cc-toggle input:checked + .cc-toggle__slider {
    background: #006B34;
}

.cc-toggle input:checked + .cc-toggle__slider::before {
    transform: translateX(20px);
}

.cc-toggle input:disabled + .cc-toggle__slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Link per riaprire l'informativa (sotto il footer) ---- */
.cc-riapri-bar {
    text-align: center;
    padding: 8px 16px 12px;
    background: #f4f4f4;
}

.cc-riapri {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 13px;
    color: #444;
    text-decoration: underline;
    cursor: pointer;
}

.cc-riapri:hover,
.cc-riapri:focus-visible {
    color: #000;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .cc-banner {
        width: 95%;
        padding: 20px 16px 18px;
    }

    .cc-banner__buttons {
        flex-direction: column;
    }

    .cc-btn {
        width: 100%;
    }

    .cc-preferences {
        width: 97%;
    }

    .cc-preferences__body {
        padding: 12px 16px;
    }

    .cc-category {
        flex-direction: column;
        gap: 8px;
    }

    .cc-category__info {
        padding-right: 0;
    }
}
