/* ------------------------------------------------------------------
 * Cookie consent bar + preferences modal (Epic.GDPR)
 * Markup: partials/cookiesBar/cookiesbar-data.htm
 * Colors follow scss/abstracts/_base.scss:
 *   blue #0068A5, light blue #29ABE2, silver02 #DDDDDD, silver05 #F2F2F2
 * ------------------------------------------------------------------ */

.cookie-bar {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 9990;
    width: 26rem;
    max-width: calc(100% - 3rem);
    padding: 1.5rem;
    background-color: #FFFFFF;
    border-top: 3px solid #29ABE2;
    -webkit-animation: cookie-bar-in .35s ease-out both;
    animation: cookie-bar-in .35s ease-out both;
}

@media screen and (max-width: 575px) {
    .cookie-bar {
        left: .75rem;
        right: .75rem;
        bottom: .75rem;
        width: auto;
        max-width: none;
        padding: 1.25rem;
    }
}

@-webkit-keyframes cookie-bar-in {
    from { opacity: 0; -webkit-transform: translateY(1rem); transform: translateY(1rem); }
    to { opacity: 1; -webkit-transform: none; transform: none; }
}

@keyframes cookie-bar-in {
    from { opacity: 0; -webkit-transform: translateY(1rem); transform: translateY(1rem); }
    to { opacity: 1; -webkit-transform: none; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-bar { -webkit-animation: none; animation: none; }
}

.cookie-bar__actions,
.cookie-modal__footer {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: -.25rem;
}

.cookie-bar__actions .btn,
.cookie-modal__footer .btn {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    margin: .25rem;
    padding: .6rem 1rem;
    white-space: nowrap;
}

.cookie-bar__accept {
    -ms-flex-preferred-size: 100%;
    flex-basis: 100%;
}

/* richeditor HTML from the backend settings */
.cookie-prose p {
    margin-bottom: .5rem;
}

.cookie-prose p:last-child {
    margin-bottom: 0;
}

.cookie-prose a {
    color: #29ABE2;
    text-decoration: underline;
}

/* Preferences modal */
.cookie-modal .modal-dialog {
    max-width: 34rem;
}

.cookie-modal .modal-content {
    border: none;
}

.cookie-modal__header {
    border-bottom: 1px solid #DDDDDD;
}

.cookie-modal__close {
    width: 2rem;
    height: 2rem;
    margin-right: -.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #999999;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.cookie-modal__close:hover,
.cookie-modal__close:focus {
    color: #000000;
    outline: none;
}

.cookie-modal__footer {
    margin: 0;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    border-top: 1px solid #DDDDDD;
    background-color: #F2F2F2;
}

.cookie-group {
    padding: 1rem 0;
    border-bottom: 1px solid #EEEEEE;
}

.cookie-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cookie-group label {
    cursor: pointer;
}

/* Toggle switch.
 * The theme hides every checkbox globally (scss/components/_checkbox.scss),
 * so the input is brought back as an invisible, clickable layer on top of
 * the track — this keeps it keyboard-focusable. */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.cookie-switch input[type="checkbox"] {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.cookie-switch input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.cookie-switch__track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 1.5rem;
    background-color: #DDDDDD;
    -webkit-transition: background-color .2s ease-in-out;
    transition: background-color .2s ease-in-out;
}

.cookie-switch__track:after {
    content: '';
    position: absolute;
    top: .1875rem;
    left: .1875rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background-color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    -webkit-transition: -webkit-transform .2s ease-in-out;
    transition: transform .2s ease-in-out;
}

.cookie-switch input:checked + .cookie-switch__track {
    background-color: #29ABE2;
}

.cookie-switch input:checked + .cookie-switch__track:after {
    -webkit-transform: translateX(1.25rem);
    transform: translateX(1.25rem);
}

.cookie-switch input:disabled + .cookie-switch__track {
    opacity: .6;
}

.cookie-switch input:focus + .cookie-switch__track {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(41, 171, 226, .5);
}

/* Footer "Cookie settings" link */
.cookie-settings-link {
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
}

.cookie-settings-link:hover,
.cookie-settings-link:focus {
    text-decoration: underline;
    outline: none;
}
