:root {
    --modal-bg: #fff;
    --modal-bg-hover: #D6D6D6;
    --modal-color: #141414;
    --modal-font-family: sans-serif;
    --modal-font-size: 15px;
    --modal-line-height: 24px;
    --modal-font-weight: 600;

    --modal-font-size-mobile: 14px;

    --modal-border-color: #e6e6e6;

    --modal-content-font-size: 15px;
    --modal-content-title-font-weight: 600;

    --modal-btn-primary-bg: #5e5e5e;
    --modal-btn-primary-bg-hover: #313131;
    --modal-btn-primary-border: var(--modal-btn-primary-bg);
    --modal-btn-primary-color: var(--modal-bg);
    --modal-btn-line-height: var(--modal-line-height);

    --modal-selector-action-color: #9c9c9c;

    --modal-selector-toggle-slider-bg: #D6D6D6;
    --modal-selector-toggle-slider-bg-disabled: #b1b1b1;
    --modal-selector-toggle-slider-bg-enabled: #5e5e5e;
    --modal-selector-toggle-slider-bg-enabled-hover: #313131;
    --modal-selector-toggle-slider-bg-enabled-dot: var(--modal-bg);

    --modal-card-list-item-hover-bg: rgba(0,0,0,.05);
}

* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

.cookies__wrapper h1,
.cookies__wrapper h2,
.cookies__wrapper h3,
.cookies__wrapper h4,
.cookies__wrapper h5,
.cookies__wrapper h6 {
    font-family: var(--modal-font-family) !important;
    font-size: var(--modal-font-size) !important;
    font-weight: var(--modal-font-weight);
}

.cookies__wrapper h3,
.cookies__wrapper h4,
.cookies__wrapper h5 {
    margin: 0 !important;
}

.cookies__wrapper button:hover {
    background-color: transparent !important;
}

.btn_primary {
    background-color: var(--modal-btn-primary-bg);
    color: var(--modal-btn-primary-color);
    font-weight: 600;
}

.btn_primary:hover {
    background-color: var(--modal-btn-primary-bg-hover);
    border-color: var(--modal-btn-primary-bg-hover);
}

.cookies__blurred_bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9998;
    -webkit-backdrop-filter: blur(2.1px);
    backdrop-filter: blur(2.1px);
}

/* Modal styles */
.cookies__wrapper {
    /* Por defecto se oculta */
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    min-width: 100vw;
    height: auto;
    padding: .5em;
    z-index: 9999;
    transform: translateY(100%);
    perspective: 1000px;
    animation: showModal .5s cubic-bezier(0.23, 1, 0.320, 1);
    animation-fill-mode: forwards;
}

.cookies__wrapper.completed {
    animation: hideModal .5s cubic-bezier(0.785, 0.135, 0.15, 0.86);
    animation-fill-mode: forwards;
}

@keyframes showModal {
    from
    {
        transform: translateY(100%);
        perspective: 1000px;
    }
    to
    {
        transform: translateY(0%);
        perspective: 0px;
    }
}

@keyframes hideModal {
    from {
        transform: translateY(0%);
        perspective: 0px;
    }
    to {
        transform: translateY(100%);
        perspective: 1000px;
    }
}

.cookie__modal {
    background-color: var(--modal-bg);
    -webkit-box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
    -webkit-transition-property: opacity, top, -webkit-transform;
    transition-property: opacity, top, -webkit-transform;
    -o-transition-property: transform, opacity, top;
    transition-property: transform, opacity, top;
    transition-property: transform, opacity, top, -webkit-transform;
    border-radius: 8px;
    color: var(--modal-color);
    font-family: var(--modal-font-family) !important;
    font-size: var(--modal-font-size) !important;
    line-height: var(--modal-line-height) !important;
    -webkit-transition: all .5s ease;
    -o-transition: all .5s ease;
    transition: all .5s ease;
}

.modal__wrapper {
    width: 100%;
    margin: 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    padding: 24px;
}

.modal__content {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    height: auto;
    padding: 0 1.125em 0 0;
    max-height: inherit;
    line-height: 1.6em;
    letter-spacing: .5px;
    margin: 0 1.5em;
    outline: 0;
    color: inherit;
    font-family: inherit;
    font-size: var(--modal-content-font-size);
}

/* LOGO */
.modal__logo {
    -ms-flex-item-align: stretch;
    -ms-grid-row-align: stretch;
    align-self: stretch;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    padding-right: 1.5em;
    flex-shrink: 0;
}

.modal__logo__client {
    height: auto;
    max-height: 6em;
    max-width: 100px;
    object-fit: contain;
}


/* MAIN CONTENT */
.modal__content__main {
    padding-left: 0.375em;
}

.modal__content__wrapper {
    width: 100%;
}

.modal__content__title {
    font-weight: var(--modal-content-title-font-weight);
    font-size: inherit;
    letter-spacing: .25px;
    margin-bottom: .5em;
}

.modal__content__description {
    font-size: inherit;
    line-height: inherit;
}

/* Cookies selectos */

.consent__selector__wrapper {
    width: 100%;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    margin-top: 1.5em;
    padding-left: 0.375em;
    gap: 2.5em;
}

.selector__action__detail {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    font-weight: var(--modal-font-weight);
    font-size: inherit;
    color: var(--modal-selector-action-color);
    cursor: pointer;
}

.selector__action__detail:hover {
    color: var(--modal-btn-primary-bg-hover);
}

.selector__action__detail::after,
.card__accordion__content__header::after {
    border-style: solid;
    border-width: 0.15em 0.15em 0 0;
    color: var(--modal-color);
    content: "";
    display: block;
    height: 0.563em;
    margin-left: 1em;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    -webkit-transform-origin: center;
    -ms-transform-origin: center;
    transform-origin: center;
    -webkit-transition: .3s ease;
    -o-transition: .3s ease;
    transition: .3s ease;
    width: 0.563em;
}

.selector__action__detail.active::after,
.card__accordion__content__header.active::after {
    -webkit-transform: rotate(133deg) translateY(4px);
    -ms-transform: rotate(133deg) translateY(4px);
    transform: rotate(133deg) translateY(4px);
    -webkit-transition: .3s ease;
    -o-transition: .3s ease;
    transition: .3s ease;
}

.consent__selector__buttons {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 2.5em;
}

/* Hide raw inputs */
.selector__input_hidden {
    position: absolute;
    opacity: 0;
    left: -9999px;
}

.selector__input__wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 1em;
}

.selector__input__label {
    font-weight: var(--modal-font-weight);
}

.selector__input__toggle {
    position: relative;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    height: 32px;
    position: relative;
    width: 57px;
}

.selector__input__toggle__slider {
    background-color: var(--modal-selector-toggle-slider-bg);
    border-radius: 32px;
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    -webkit-transition: background-color .4s;
    -o-transition: background-color .4s;
    transition: background-color .4s;
    cursor: pointer;
}

.selector__input__toggle__slider.mandatory {
    pointer-events: none;
}

.selector__input__toggle.mandatory {
    cursor: not-allowed;
}

.selector__input__toggle__slider.mandatory::before {
    background-color: #fff;
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.selector__input__toggle__slider.disabled::before {
    background-color: #fff;
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
}

.selector__input__toggle__slider.disabled {
    background-color: var(--modal-selector-toggle-slider-bg-disabled);
}

.selector__input__toggle__slider.enabled {
    background-color: var(--modal-selector-toggle-slider-bg-enabled);
}

.selector__input__toggle__slider.enabled:hover {
    background-color: var(--modal-selector-toggle-slider-bg-enabled-hover);
}

.selector__input__toggle__slider.enabled::before {
    background-color: var(--modal-selector-toggle-slider-bg-enabled-dot);
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.selector__input__toggle__slider::before {
    background-color: #fff;
    border-radius: 50%;
    bottom: 4px;
    content: "";
    height: 24px;
    left: 4px;
    position: absolute;
    -webkit-transition: -webkit-transform .4s;
    transition: -webkit-transform .4s;
    -o-transition: transform .4s;
    transition: transform .4s;
    transition: transform .4s, -webkit-transform .4s;
    width: 24px;
}

/* ACTIONS BUTTONS */
.modal__actions {
    max-width: 286px;
    -webkit-box-align: end;
    -ms-flex-align: end;
    align-items: flex-end;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-flex: 1;
    -ms-flex: auto;
    flex: auto;
}

.modal__action__btn {
    width: 100%;
    border-radius: 0.25em;
    border: 2px solid var(--modal-btn-primary-border);
    padding: 1em;
    text-align: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    margin-bottom: 0.5em;
    cursor: pointer;
    font-size: inherit;
    transition: .1s ease;
}

.modal__action__btn:first-child {
    font-weight: bolder;
}

.modal__action__btn:last-child {
    margin-bottom: 0;
}


.modal__action__btn.allow_all:hover {
    background-color: var(--modal-btn-primary-bg-hover) !important;
}

.modal__action__btn:focus {
    outline: 2px solid;
    outline-offset: 1px;
    outline-color: var(--modal-btn-primary-bg-hover);
    background-color: inherit;
    color: initial;
}

.allow_custom, .deny_all {
    background-color: var(--modal-bg);
    color: var(--modal-color);
}

.modal__actions__row {
    width: 100%;
}

/* Modal extension */
.modal__extension {
    height: 0;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    -webkit-box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 10px 0px inset;
    box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 10px 0px inset;
    border-top: 1px solid var(--modal-border-color);
    -webkit-transition: height .4s ease;
    -o-transition: height .4s ease;
    transition: height .4s ease;
    overflow-y: scroll;
}

.modal__extension.active {
    height: 50vh;
}

/* Modal extension cards list */
.modal__cards {
    padding: 2.5em;
    width: 100%;
    height: auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.modal__cards__wrapper {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    -webkit-box-pack: stretch;
    -ms-flex-pack: stretch;
    justify-content: stretch;
    gap: 2em;
}

.card__title {
    font-size: var(--modal-font-size);
    font-weight: var(--modal-font-weight);
}

.cards__list__item {
    width: 100%;
    height: auto;
    -webkit-transition: all .4s ease;
    -o-transition: all .4s ease;
    transition: all .4s ease;
    border: 1px solid var(--modal-border-color);
    border-radius: 8px;
    padding: 1.8em 1.5em;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 1em;
}

.card__accordion {
    width: 100%;
}

.card__accordion__content {
    border: 1px solid var(--modal-border-color);
    border-radius: 8px;
    -webkit-transition: background-color .2s ease;
    -o-transition: background-color .2s ease;
    transition: background-color .2s ease;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    /* gap: .8em; */
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: start;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

.card__accordion__content:hover {
    -webkit-transition: background-color .4s ease;
    -o-transition: background-color .4s ease;
    transition: background-color .4s ease;
    background-color: var(--modal-card-list-item-hover-bg);
}

.card__accordion__content__header {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: .8em;
    padding: 1em 1.5em;
    cursor: pointer;
}

.cookie__number__tag {
    padding: 0.25em 0.5em;
    border-radius: 5em;
    font-size: .8em;
    letter-spacing: .25px;
    font-weight: 700;
    line-height: 1.2em;
    background-color: var(--modal-card-list-item-hover-bg);
}

.card__accordion__list {
    padding: 0 1.5em 1.5em 1.5em;
    width: 100%;
    height: auto;
    display: none;
    overflow: hidden;
}

.card__accordion__list.active {
    display: block;
}

.card__accordion__list__item {
    background-color: var(--modal-card-list-item-hover-bg);
    padding: .8em;
    border-radius: 8px;
    border: 1px solid var(--modal-border-color);
}

.card__accordion__separator {
    height: 1px;
    width: 100%;
    background-color: var(--modal-border-color);
    margin-bottom: 1em;
}

.cookies__list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 1em;
    list-style: none;
}


@media screen and (min-width: 1600px) {
    .modal__wrapper {
        max-width: 90%;
    }
}

@media screen and (max-width: 950px) {
    .cookies__wrapper h2 {
        margin-top: 0 !important;
    }

    .cookies__wrapper {
        height: 100dvh;
        display: none;
        align-items: flex-start;
        overflow-y: visible;
        transform: scale(0);
        perspective: 1000px;
        animation: showModal .3s cubic-bezier(0.075, 0.82, 0.165, 1);
        animation-fill-mode: forwards;
        animation-delay: .2s;
    }

    .modal__extension.active {
        overflow-y: scroll;
    }

    .cookie__modal {
        max-height: 100dvh;
        padding: 0 0 24px 0;
        overflow-y: scroll;
    }

    .modal__wrapper {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: unset;
        -ms-flex-align: unset;
        align-items: unset;
        padding: 0;
    }

    .modal__logo {
        padding: 1.5em 1.875em;
        border-bottom: 1px solid var(--modal-border-color);
    }

    .modal__actions {
        width: 100%;
        max-width: 100%;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        padding: 1.5em 1.875em;
        border-top: 1px solid var(--modal-border-color);
    }

    .modal__logo__client {
        max-height: 4vh;
        -ms-flex-item-align: start;
        align-self: flex-start;
    }

    .modal__cards {
        padding: 1.5em 1.875em;
    }

    .modal__content__description {
        font-size: 14px !important;
    }

    .consent__selector__wrapper {
        gap: 1em;
    }

    .modal__logo {
        position: sticky;
        background: var(--modal-bg);
        -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .1);
        box-shadow: 0 0 5px rgba(0, 0, 0, .1);
        top: 0;
        z-index: 1;
    }

    .modal__logo,
    .modal__content__main,
    .modal__content__description,
    .consent__selector__input {
        width: 100%;
    }

    .modal__content {
        padding-top: 1.5em;
        padding-bottom: 1.5em;
    }

    .consent__selector__buttons {
        gap: 0.5em;
        width: 100%;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: start;
        -ms-flex-align: start;
        align-items: start;
    }

    .modal__action__btn {
        padding: .5em;
    }

    .selector__input__wrapper {
        width: 100%;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack: justify;
        -ms-flex-pack: justify;
        justify-content: space-between;
    }

    .cookie__number__tag {
        display: none;
    }
    
    .card__accordion__content__header {
        padding: 1em;
    }

    @keyframes showModal {
        from
        {
            transform: scale(0);
            perspective: 1000px;
        }
        to
        {
            transform: scale(1);
            perspective: 0px;
        }
    }
}

@media screen and (max-width: 750px) {
    .cookies__wrapper {
        height: 90dvh;
        width: 80vw;
        max-width: 80vw;
        min-width: 80vw;
        top: 50%;
        left: 50%;
        transform: scale(0) translate(-50%, -50%);
        transform-origin: center;
        perspective: 1000px;
        animation: showModal .3s cubic-bezier(0.075, 0.82, 0.165, 1);
        animation-fill-mode: forwards;
        animation-delay: .2s;
        font-size: var(--modal-font-size-mobile) !important;
    }

    .modal__content__description {
        font-size: 12px !important;
        line-height: 1.5em;
    }

    .cookies__wrapper h2, .cookies__wrapper h4, .modal__action__btn {
        font-size: var(--modal-font-size-mobile) !important;
    }

    .cookies__wrapper h4 {
        width: 100%;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .modal__content {
        padding-top: 1em;
        padding-bottom: 1em;
    }

    .cookie__modal {
        max-height: 100%;
    }

    .modal__actions {
        background-color: var(--modal-bg);
        position: sticky;
        bottom: 0;
        flex-direction: row;
        gap: .5em;
    }

    .cookie__modal {
        padding: 0;
    }

    .modal__logo {
        padding: 1.2em 1.325em;
    }

    /* #allow_custom_cookies {
        display: none;
    } */

    .modal__action__btn {
        width: auto;
        margin: 0;
    }

    .modal__action__btn:first-child {
        width: 100%;
    }

    .modal__actions__row {
        display: flex;
        width: 100%;
        gap: 0.5em;
    }

    #allow_custom_cookies {
        width: 65%;
    }

    #deny_cookies {
        flex: 1;
    }

    #mobile_hidden {
        display: none;
    }

    .consent__selector__wrapper {
        margin-top: 0.5em;
    }

    @keyframes showModal {
        from
        {
            transform: scale(0) translate(-50%, -50%);
            perspective: 1000px;
        }
        to
        {
            transform: scale(1) translate(-50%, -50%);
            perspective: 0px;
        }
    }

    @keyframes hideModal {
        from {
            transform: translate(-50%, -50%);
            perspective: 0px;
        }
        to {
            transform: translate(-50%, 100%);
            perspective: 1000px;
        }
    }
}

@media screen and (max-width: 450px) {
    .cookies__wrapper {
        width: 90vw;
        max-width: 90vw;
        min-width: 90vw;
    }

    .modal__cards {
        padding: 1.5em 1em;
    }

    .cards__list__item {
        padding: 1.5em 1.1em;
    }
    
    .card__accordion__list {
        padding: 0 1em 1em 1em;
    }

    .modal__actions__row {
        flex-direction: column;
    }

    #allow_custom_cookies {
        width: 100%;
    }

    #deny_cookies {
        width: 100%;
    }

    .modal__action__btn {
        padding: 0.2em;
    }
}