/* =========================================================
   CRESCITA — Consent Manager
   ========================================================= */

.crescita-consent {
    position: fixed;

    left: 20px;
    right: 20px;
    bottom: 20px;

    z-index: 999999;

    display: none;

    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 24px;

    background: var(--crescita-consent-bg, #ffffff);
    color: var(--crescita-consent-text, #191919);

    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 18px;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.16);

    font-family:
        "DM Sans",
        Arial,
        sans-serif;

    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   VISIBILITÀ
========================================================= */

.crescita-consent.is-visible {
    display: block;
}


/* =========================================================
   CONTENUTO
========================================================= */

.crescita-consent__inner {

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}


.crescita-consent__content {
    flex: 1;
    min-width: 0;
}


.crescita-consent__title {

    margin: 0 0 6px;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}


.crescita-consent__text {

    margin: 0;

    color: #68655e;

    font-size: 13px;
    line-height: 1.5;
}


.crescita-consent__text a {

    color: inherit;

    text-decoration: underline;
    text-underline-offset: 2px;
}


/* =========================================================
   AZIONI
========================================================= */

.crescita-consent__actions {

    display: flex;
    align-items: center;

    gap: 8px;

    flex-shrink: 0;
}


.crescita-consent__button {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 10px 17px;

    border-radius: 999px;

    border: 1px solid #d8d3c9;

    background: transparent;
    color: #191919;

    font-family: inherit;

    font-size: 13px;
    font-weight: 700;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.crescita-consent__button:hover {

    transform: translateY(-1px);

}


.crescita-consent__button--primary {

    background:
        var(--crescita-consent-primary, #d8ff3e);

    border-color:
        var(--crescita-consent-primary, #d8ff3e);

    color:
        var(--crescita-consent-dark, #151515);
}


.crescita-consent__button--primary:hover {

    filter: brightness(0.96);

}


.crescita-consent__button--secondary:hover {

    background: #f4f1ea;

}


/* =========================================================
   PREFERENZE
========================================================= */

.crescita-consent__preferences {

    display: none;

    margin-top: 20px;
    padding-top: 20px;

    border-top: 1px solid #e5e1d8;
}


.crescita-consent__preferences.is-visible {

    display: block;

}


.crescita-consent__preference {

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 13px 0;

    border-bottom: 1px solid #eeeae2;
}


.crescita-consent__preference:last-child {

    border-bottom: 0;

}


.crescita-consent__preference-info {

    min-width: 0;

}


.crescita-consent__preference-name {

    display: block;

    font-size: 13px;
    font-weight: 700;

}


.crescita-consent__preference-description {

    display: block;

    margin-top: 2px;

    color: #77736b;

    font-size: 11px;
}


/* =========================================================
   TOGGLE
========================================================= */

.crescita-consent__toggle {

    position: relative;

    width: 44px;
    height: 24px;

    flex-shrink: 0;
}


.crescita-consent__toggle input {

    position: absolute;

    opacity: 0;

    pointer-events: none;

}


.crescita-consent__toggle-slider {

    position: absolute;

    inset: 0;

    border-radius: 999px;

    background: #d8d3c9;

    cursor: pointer;

    transition:
        background 0.2s ease;
}


.crescita-consent__toggle-slider::before {

    content: "";

    position: absolute;

    width: 18px;
    height: 18px;

    top: 3px;
    left: 3px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.20);

    transition:
        transform 0.2s ease;

}


.crescita-consent__toggle input:checked
+ .crescita-consent__toggle-slider {

    background:
        var(--crescita-consent-primary, #d8ff3e);

}


.crescita-consent__toggle input:checked
+ .crescita-consent__toggle-slider::before {

    transform: translateX(20px);

}


/* =========================================================
   NECESSARI
========================================================= */

.crescita-consent__toggle--disabled {

    opacity: 0.55;

}


.crescita-consent__toggle--disabled
.crescita-consent__toggle-slider {

    cursor: default;

    background: #bdb9b1;

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    .crescita-consent {

        left: 12px;
        right: 12px;
        bottom: 12px;

        padding: 20px;

        border-radius: 16px;

    }


    .crescita-consent__inner {

        display: block;

    }


    .crescita-consent__actions {

        display: grid;

        grid-template-columns: 1fr;

        margin-top: 18px;

    }


    .crescita-consent__button {

        width: 100%;

    }


    .crescita-consent__preference {

        align-items: flex-start;

    }

}