/* ==========================================================
   EBOX - GESTION DES COOKIES
   ========================================================== */


/* ==========================================================
   BANDEAU
   ========================================================== */

.ebox-cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;

    z-index: 999999;

    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}

.ebox-cookie-banner.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);

    pointer-events: auto;
}

.ebox-cookie-banner__inner {
    width: 100%;
    max-width: 1180px;

    margin: 0 auto;
    padding: 22px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    box-sizing: border-box;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.16);
}

.ebox-cookie-banner__content {
    flex: 1;
    min-width: 0;
}

.ebox-cookie-banner__content h2 {
    margin: 0 0 7px;

    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;

    color: #1f2937;
}

.ebox-cookie-banner__content p {
    margin: 0;

    max-width: 730px;

    font-size: 14px;
    line-height: 1.6;

    color: #5f6672;
}

.ebox-cookie-banner__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    flex-shrink: 0;
}


/* ==========================================================
   BOUTONS
   ========================================================== */

.ebox-cookie-btn {
    min-height: 43px;

    padding: 10px 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.ebox-cookie-btn:hover {
    transform: translateY(-1px);
}

.ebox-cookie-btn--primary {
    border: 1px solid #8c3f00;

    background: #8c3f00;
    color: #ffffff;
}

.ebox-cookie-btn--primary:hover,
.ebox-cookie-btn--primary:focus {
    border-color: #713300;

    background: #713300;
    color: #ffffff;
}

.ebox-cookie-btn--secondary {
    border: 1px solid #d1d5db;

    background: #ffffff;
    color: #374151;
}

.ebox-cookie-btn--secondary:hover,
.ebox-cookie-btn--secondary:focus {
    border-color: #9ca3af;

    background: #f9fafb;
    color: #111827;
}


/* ==========================================================
   MODALE
   ========================================================== */

.ebox-cookie-modal {
    position: fixed;
    inset: 0;

    z-index: 1000000;

    padding: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    background: rgba(17, 24, 39, 0.62);

    visibility: hidden;
    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.ebox-cookie-modal.is-visible {
    visibility: visible;
    opacity: 1;

    pointer-events: auto;
}

.ebox-cookie-modal__dialog {
    position: relative;

    width: 100%;
    max-width: 680px;

    max-height: calc(100vh - 50px);

    overflow-y: auto;

    padding: 32px;

    box-sizing: border-box;

    background: #ffffff;

    border-radius: 14px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.25);
}

.ebox-cookie-modal__dialog h2 {
    margin: 0 45px 10px 0;

    font-size: 25px;
    line-height: 1.3;

    color: #1f2937;
}

.ebox-cookie-modal__intro {
    margin: 0 0 24px;

    font-size: 14px;
    line-height: 1.65;

    color: #606772;
}

.ebox-cookie-modal__close {
    position: absolute;

    top: 17px;
    right: 18px;

    width: 38px;
    height: 38px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #f3f4f6;
    color: #374151;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
}

.ebox-cookie-modal__close:hover {
    background: #e5e7eb;
}


/* ==========================================================
   CATÉGORIES
   ========================================================== */

.ebox-cookie-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;

    padding: 18px 0;

    border-top: 1px solid #e5e7eb;
}

.ebox-cookie-setting > div {
    flex: 1;
    min-width: 0;
}

.ebox-cookie-setting strong {
    display: block;

    margin-bottom: 5px;

    font-size: 15px;
    line-height: 1.4;

    color: #1f2937;
}

.ebox-cookie-setting p {
    margin: 0;

    font-size: 13px;
    line-height: 1.55;

    color: #6b7280;
}


/* ==========================================================
   INTERRUPTEURS
   ========================================================== */

.ebox-cookie-switch {
    position: relative;

    display: inline-flex;

    width: 48px;
    height: 26px;

    flex: 0 0 48px;

    cursor: pointer;
}

.ebox-cookie-switch input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.ebox-cookie-switch span {
    position: absolute;
    inset: 0;

    border-radius: 999px;

    background: #d1d5db;

    transition: background-color 0.2s ease;
}

.ebox-cookie-switch span::before {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.25);

    transition: transform 0.2s ease;
}

.ebox-cookie-switch input:checked + span {
    background: #8c3f00;
}

.ebox-cookie-switch input:checked + span::before {
    transform: translateX(22px);
}

.ebox-cookie-switch--locked {
    cursor: default;
}

.ebox-cookie-switch--locked span {
    opacity: 0.7;
}


/* ==========================================================
   ACTIONS MODALE
   ========================================================== */

.ebox-cookie-modal__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    padding-top: 24px;

    border-top: 1px solid #e5e7eb;
}


/* ==========================================================
   BODY
   ========================================================== */

body.ebox-cookie-modal-open {
    overflow: hidden;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 900px) {

    .ebox-cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .ebox-cookie-banner__inner {
        align-items: stretch;
        flex-direction: column;

        gap: 18px;

        padding: 20px;
    }

    .ebox-cookie-banner__actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

}


@media (max-width: 600px) {

    .ebox-cookie-banner__actions {
        display: grid;

        grid-template-columns: 1fr;

        width: 100%;
    }

    .ebox-cookie-btn {
        width: 100%;
    }

    .ebox-cookie-modal {
        padding: 12px;
    }

    .ebox-cookie-modal__dialog {
        max-height: calc(100vh - 24px);

        padding: 25px 20px;
    }

    .ebox-cookie-setting {
        align-items: flex-start;

        gap: 15px;
    }

    .ebox-cookie-modal__actions {
        flex-direction: column-reverse;

        align-items: stretch;
    }

}