/* =========================================
   Cookie consent
========================================= */

.cookie-consent {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;

    z-index: 1055;

    max-width: 1180px;
    margin: 0 auto;

    background: #fff;
    border: 1px solid rgba(var(--bs-villa-gr-rgb), .18);
    border-radius: var(--villa-radius);

    box-shadow: 0 12px 40px rgba(0, 0, 0, .14);
}

.cookie-consent__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;

    padding: 1.15rem 1.25rem;
}

.cookie-consent__content {
    max-width: 760px;
}

.cookie-consent__title {
    margin-bottom: .3rem;

    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.cookie-consent__text {
    color: #666;
    font-size: .84rem;
    line-height: 1.55;
}

.cookie-consent__text a {
    color: var(--bs-villa-gr);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;

    flex: 0 0 auto;
}


/* =========================================
   Modal
========================================= */

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

    z-index: 1060;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, .42);
}

.cookie-modal__dialog {
    position: absolute;
    left: 50%;
    top: 50%;

    width: calc(100% - 2rem);
    max-width: 620px;
    max-height: calc(100vh - 2rem);

    overflow-y: auto;

    transform: translate(-50%, -50%);

    padding: 1.5rem;

    background: #fff;
    border: 1px solid rgba(var(--bs-villa-gr-rgb), .16);
    border-radius: var(--villa-radius);

    box-shadow: 0 18px 60px rgba(0, 0, 0, .2);
}

.cookie-modal__close {
    position: absolute;
    right: .85rem;
    top: .65rem;

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

    width: 36px;
    height: 36px;

    padding: 0;

    color: #888;
    background: transparent;
    border: 0;

    font-size: 1.6rem;
    line-height: 1;

    cursor: pointer;

    transition:
        color .2s ease,
        background-color .2s ease;
}

.cookie-modal__close:hover {
    color: #333;
    background: rgba(var(--bs-villa-gr-rgb), .06);
    border-radius: var(--villa-radius-sm);
}

.cookie-modal__title {
    margin: 0 2rem .6rem 0;

    color: #333;
    font-size: 1.35rem;
    font-weight: 600;
}

.cookie-modal__intro {
    margin: 0 0 1.4rem;

    color: #777;
    font-size: .88rem;
    line-height: 1.6;
}


/* =========================================
   Options
========================================= */

.cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;

    padding: 1rem 0;

    border-top: 1px solid rgba(var(--bs-villa-gr-rgb), .12);
}

.cookie-option__content {
    min-width: 0;
}

.cookie-option__title {
    display: block;

    margin-bottom: .25rem;

    color: #333;
    font-size: .92rem;
    font-weight: 600;
}

.cookie-option__text {
    color: #777;
    font-size: .8rem;
    line-height: 1.5;
}

.cookie-option__required {
    flex: 0 0 auto;

    color: var(--bs-villa-gr);
    font-size: .75rem;
    font-weight: 500;
}


/* =========================================
   Switch
========================================= */

.cookie-switch {
    position: relative;

    flex: 0 0 42px;

    width: 42px;
    height: 24px;
}

.cookie-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cookie-switch__slider {
    position: absolute;
    inset: 0;

    background: #ccc;
    border-radius: 999px;

    cursor: pointer;

    transition: background-color .2s ease;
}

.cookie-switch__slider::before {
    content: "";

    position: absolute;
    left: 3px;
    top: 3px;

    width: 18px;
    height: 18px;

    background: #fff;
    border-radius: 50%;

    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);

    transition: transform .2s ease;
}

.cookie-switch input:checked + .cookie-switch__slider {
    background: var(--bs-villa-gr);
}

.cookie-switch input:checked + .cookie-switch__slider::before {
    transform: translateX(18px);
}


/* =========================================
   Modal actions
========================================= */

.cookie-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;

    padding-top: 1.2rem;
    margin-top: .3rem;

    border-top: 1px solid rgba(var(--bs-villa-gr-rgb), .12);
}


/* =========================================
   Responsive
========================================= */

@media (max-width: 767.98px) {

    .cookie-consent {
        left: .6rem;
        right: .6rem;
        bottom: .6rem;
    }

    .cookie-consent__body {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cookie-consent__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .cookie-consent__actions .btn-villa {
        grid-column: 1 / -1;
    }

    .cookie-modal__actions {
        flex-direction: column;
    }

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