/*
 * Dentico — custom cookie banner (CWS Suite cookie module, Banner layout: Custom).
 * Pairs with cws-suite/cookie-banner.php.
 *
 * Every rule is scoped to [data-cws-tpl-style="custom"] so it can never leak onto
 * the built-in banner, and button rules sit at (0,3,0)+ so the Elementor kit's
 * `.elementor-kit-9 button` (0,1,1 — orange pill, Oxygen) cannot repaint them.
 * The plugin's opacity/visibility + .active mechanism is left untouched.
 */

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"],
.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"],
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] {
    --dck-blue: var(--e-global-color-primary, #0e3d82);
    --dck-orange: var(--e-global-color-accent, #f2690d);
    --dck-orange-hover: #ff7d24;
    --dck-text: #fff;
    --dck-muted: #cfdbee;
    --dck-line: rgba(255, 255, 255, .16);
    --dck-font: var(--e-global-typography-primary-font-family, "Barlow Semi Condensed"), sans-serif;
}

/* ------------------------------------------------------------------ */
/* Notice — full-width bar pinned to the top                           */
/* ------------------------------------------------------------------ */

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    padding: 0;
    border-radius: 0;
    background: var(--dck-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    z-index: 99990;
    transform: translateY(-100%);
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"].active {
    transform: translateY(0);
}

body.admin-bar .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] {
    top: 32px;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-bar__inner {
    padding: 18px 24px 16px 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 40px;
    box-sizing: border-box;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-bar__copy {
    flex: 1 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-bar__title {
    margin: 0;
    font-family: var(--dck-font);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--dck-text);
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-bar__text {
    margin: 0 0 10px;
    font-family: var(--dck-font);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -.1px;
    color: var(--dck-text);
    text-wrap: pretty;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ------------------------------------------------------------------ */
/* Buttons + links (notice and modal)                                  */
/* ------------------------------------------------------------------ */

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-width: 114px;
    margin: 0;
    padding: 0 20px;
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 0;
    font-family: var(--dck-font);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 200ms, border-color 200ms, color 200ms;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn:hover,
.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn:focus,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn:hover,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn:focus {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border-color: #fff;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn--primary,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn--primary {
    min-width: 130px;
    background: var(--dck-orange);
    color: #fff;
    border-color: var(--dck-orange);
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn--primary:hover,
.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn--primary:focus,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn--primary:hover,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn--primary:focus {
    background: var(--dck-orange-hover);
    color: #fff;
    border-color: var(--dck-orange-hover);
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn:focus-visible,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-link,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-link {
    color: var(--dck-orange);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-link:hover,
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-link:hover {
    color: var(--dck-orange-hover);
}

/* ------------------------------------------------------------------ */
/* Floating button — orange circle, reopens the preferences            */
/* ------------------------------------------------------------------ */

/* The plugin pins left/right at 12px inline; the 8px margin lands it at 20px. */
.cws-cookie-floating-wrap[data-cws-tpl-style="custom"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    bottom: 20px;
    margin: 0 8px;
    padding: 0;
    border-radius: 50%;
    background: var(--dck-orange);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    z-index: 9998;
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"]:hover {
    background: var(--dck-orange-hover);
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"] .dentico-ck-fab {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"] .dentico-ck-fab__icon,
.cws-cookie-floating-wrap[data-cws-tpl-style="custom"] .dentico-ck-fab__icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"] svg path {
    stroke: #fff;
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"] .dentico-ck-fab__label {
    font-family: var(--dck-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
}

/* Peek style (module setting): a tab glued to the bottom edge */
.cws-cookie-floating-wrap[data-cws-tpl-style="custom"].cws-cookie-floating-wrap--peek {
    width: auto;
    height: auto;
    bottom: 0;
    padding: 10px 16px 14px;
    border-radius: 8px 8px 0 0;
}

/* ------------------------------------------------------------------ */
/* Modal — preferences dialog                                          */
/* ------------------------------------------------------------------ */

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] {
    padding: 24px;
    box-sizing: border-box;
    background: rgba(4, 22, 54, .7);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog {
    display: flex;
    flex-direction: column;
    width: min(760px, 100%);
    max-height: min(85vh, 860px);
    background: var(--dck-blue);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .4);
    color: var(--dck-text);
    font-family: var(--dck-font);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--dck-line);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__title {
    margin: 0;
    font-family: var(--dck-font);
    font-size: 22px;
    font-weight: 600;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .close-consent-modal {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: background-color 200ms;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .close-consent-modal:hover {
    background: rgba(255, 255, 255, .1);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .close-consent-modal svg {
    width: 26px;
    height: 26px;
    padding: 0;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .close-consent-modal svg path {
    stroke: #fff;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 18px 24px 6px;
}

/* Firefox only — in Chrome these standard properties would switch off the
   ::-webkit-scrollbar rules below, so they are kept out of its way. */
@supports not selector(::-webkit-scrollbar) {
    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .4) transparent;
    }
}

/* Chrome / Edge / Safari — slim square thumb, no arrows, orange on hover */
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body::-webkit-scrollbar {
    width: 6px;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body::-webkit-scrollbar-track {
    background: transparent;
    border-left: 1px solid var(--dck-line);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .4);
    border-radius: 0;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body::-webkit-scrollbar-thumb:hover {
    background: var(--dck-orange);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__intro {
    margin: 0 0 14px;
    font-family: var(--dck-font);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dck-text);
}

/* Category rows */
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cat {
    padding: 16px 0;
    border-top: 1px solid var(--dck-line);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cat__name {
    margin: 0;
    font-family: var(--dck-font);
    font-size: 18px;
    font-weight: 600;
    font-style: normal;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cat__desc {
    margin: 8px 0 0;
    font-family: var(--dck-font);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dck-muted);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .always-active {
    font-family: var(--dck-font);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--dck-orange);
    white-space: nowrap;
}

/* The plugin's switch (cws_cookie_part('toggle')) — squared, orange when on */
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .enable-single-cookie .switch {
    width: 52px;
    height: 26px;
    margin: 0;
    flex-shrink: 0;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .enable-single-cookie .slider.round {
    border-radius: 0;
    background-color: transparent;
    box-shadow: inset 0 0 0 2px #fff;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .enable-single-cookie .slider.round:before {
    width: 16px;
    height: 16px;
    left: 5px;
    bottom: 5px;
    border-radius: 0;
    background-color: #fff;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .enable-single-cookie input:checked + .slider.round {
    background-color: var(--dck-orange);
    box-shadow: inset 0 0 0 2px var(--dck-orange);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .enable-single-cookie input:checked + .slider.round:before {
    background-color: #fff;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .enable-single-cookie input:focus-visible + .slider.round {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Cookie list (native <details>, no script needed) */
.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookies {
    margin-top: 10px;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookies summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    list-style: none;
    font-family: var(--dck-font);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--dck-orange);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookies summary::-webkit-details-marker {
    display: none;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookies summary::after {
    content: "+";
    font-size: 16px;
    line-height: 1;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookies[open] summary::after {
    content: "\2212";
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookies__list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    background: rgba(0, 0, 0, .18);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookie {
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-family: var(--dck-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dck-text);
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookie:last-child {
    border-bottom: 0;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookie__row {
    display: block;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-cookie__label {
    font-weight: 600;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--dck-line);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 782px) {
    body.admin-bar .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] {
        top: 46px;
    }
}

@media (max-width: 600px) {
    /* WordPress un-fixes the admin bar here, so the bar goes back to the edge */
    body.admin-bar .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] {
        top: 0;
    }
}

@media (max-width: 768px) {
    .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-bar__inner {
        padding: 16px;
        gap: 14px;
    }

    .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-bar__copy {
        flex-basis: 100%;
        gap: 10px;
    }

    .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-bar__text {
        margin-bottom: 0;
        font-size: 14px;
    }

    .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-actions,
    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__foot {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        box-sizing: border-box;
    }

    /* Accept spans the full first row; the other two share the second */
    .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn--primary,
    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn--primary {
        grid-column: 1 / -1;
        order: -1;
    }

    .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] .dentico-ck-btn,
    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-btn {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 44px;
        padding: 8px 12px;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
    }

    .cws-cookie-floating-wrap[data-cws-tpl-style="custom"] {
        bottom: 16px;
        margin: 0 4px;
    }

    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] {
        padding: 0;
    }

    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog {
        width: 100%;
        height: 100%;
        max-height: none;
    }

    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__head,
    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__foot {
        padding: 16px;
    }

    .cws-cookie-consent-modal[data-cws-tpl-style="custom"] .dentico-ck-dialog__body {
        padding: 14px 16px 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] {
        transform: none;
    }
}
