/*
 * Bistro Tron cookie banner (CWS Suite, custom template).
 * Every rule is scoped to [data-cws-tpl-style="custom"] so it never touches the
 * built-in banner. Show/hide stays with the plugin's .active + opacity/visibility.
 */

:root {
    --btck-navy: #1f3a5f;
    --btck-navy-hover: #2d5283;
    --btck-red: #c4262e;
    --btck-text: #4a5566;
    --btck-muted: #6a7484;
    --btck-line: #dde3ea;
    --btck-track: #cdd5df;
    --btck-soft: #eef2f7;
    --btck-font: 'Roboto', sans-serif;
    --btck-font-head: 'Roboto Slab', serif;
    /* Left inset of the banner and dialog. 0 = full width; set to 98px to clear
       the theme's fixed left menu (.site-menu-left #masthead, >= 992px). */
    --btck-offset: 0px;
}

/* ---------- Wrappers: reset the plugin's default card / circle / overlay ---------- */

.cws-cookie-consent-notice-wrap[data-cws-tpl-style="custom"] {
    left: var(--btck-offset);
    right: 0;
    bottom: 0;
    width: auto;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    z-index: 9990;
}

.cws-cookie-consent-modal[data-cws-tpl-style="custom"] {
    align-items: flex-end;
    justify-content: flex-end;
    background: rgba(15, 30, 50, .35);
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"] {
    left: auto;
    right: 13px;
    bottom: 14px;
    width: auto;
    height: auto;
    padding: 0;
    border-radius: 50%;
    background: none;
    box-shadow: none;
    z-index: 9989;
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"]:hover {
    background: none;
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"]:has(.btck-fab--left) {
    left: calc(var(--btck-offset) + 13px);
    right: auto;
}

/* ---------- Sheet (banner + preferences) ---------- */

[data-cws-tpl-style="custom"] .btck-sheet {
    font-family: var(--btck-font);
    color: var(--btck-navy);
    background: #fff;
    box-shadow: 0 -20px 50px -20px rgba(15, 30, 50, .35);
    transform: translateY(110%);
    transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}

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

[data-cws-tpl-style="custom"] .btck-dialog {
    width: calc(100% - var(--btck-offset));
    max-height: 90vh;
    overflow: auto;
}

/* Red checkered strip along the top edge. */
[data-cws-tpl-style="custom"] .btck-strip {
    height: 10px;
    background-color: #fff;
    background-image:
        linear-gradient(90deg, rgba(196, 38, 46, .5) 50%, transparent 50%),
        linear-gradient(rgba(196, 38, 46, .5) 50%, transparent 50%);
    background-size: 20px 20px;
}

[data-cws-tpl-style="custom"] .btck-inner {
    display: flex;
    align-items: center;
    gap: 56px;
    padding: 30px 56px 34px;
}

[data-cws-tpl-style="custom"] .btck-inner--modal {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px 56px;
}

[data-cws-tpl-style="custom"] .btck-mark {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--btck-soft);
}

[data-cws-tpl-style="custom"] .btck-mark svg {
    width: 32px;
    height: 32px;
}

[data-cws-tpl-style="custom"] .btck-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

[data-cws-tpl-style="custom"] .btck-title {
    margin: 0;
    font-family: var(--btck-font-head);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.15;
    color: var(--btck-navy);
    text-transform: none;
    letter-spacing: 0;
}

[data-cws-tpl-style="custom"] .btck-text {
    margin: 0;
    max-width: 820px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--btck-text);
    text-wrap: pretty;
}

[data-cws-tpl-style="custom"] .btck-privacy {
    color: var(--btck-navy);
    text-decoration: underline;
    text-decoration-color: var(--btck-red);
    text-underline-offset: 4px;
}

[data-cws-tpl-style="custom"] .btck-privacy:hover {
    color: var(--btck-navy-hover);
}

/* ---------- Categories ---------- */

[data-cws-tpl-style="custom"] .btck-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

[data-cws-tpl-style="custom"] .btck-cat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid var(--btck-line);
    border-radius: 4px;
}

[data-cws-tpl-style="custom"] .btck-cat__copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

[data-cws-tpl-style="custom"] .btck-cat__name {
    margin: 0;
    font-family: var(--btck-font-head);
    font-weight: 600;
    font-size: 16px;
    color: var(--btck-navy);
}

[data-cws-tpl-style="custom"] .btck-cat__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--btck-muted);
}

/* The plugin's switch (.enable-single-cookie), restyled to the design. */
[data-cws-tpl-style="custom"] .btck-cat .enable-single-cookie {
    flex: none;
}

[data-cws-tpl-style="custom"] .btck-cat .enable-single-cookie .switch {
    width: 44px;
    height: 24px;
    margin: 0;
}

[data-cws-tpl-style="custom"] .btck-cat .enable-single-cookie .slider {
    background-color: var(--btck-track);
    border-radius: 999px;
    transition: background .25s;
}

[data-cws-tpl-style="custom"] .btck-cat .enable-single-cookie .slider:before {
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    transition: transform .25s;
}

[data-cws-tpl-style="custom"] .btck-cat .enable-single-cookie input:checked + .slider {
    background-color: var(--btck-navy);
}

/* The base sheet sets translateX(26px) with !important; the design's knob travels 20px. */
[data-cws-tpl-style="custom"] .btck-cat .enable-single-cookie input:checked + .slider:before {
    transform: translateX(20px) !important;
}

[data-cws-tpl-style="custom"] .btck-cat .enable-single-cookie input:focus-visible + .slider {
    outline: 2px solid var(--btck-navy);
    outline-offset: 2px;
}

/* Necessary cookies: a switch that is always on and cannot be changed. */
[data-cws-tpl-style="custom"] .btck-locked {
    flex: none;
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: var(--btck-navy);
    opacity: .5;
}

[data-cws-tpl-style="custom"] .btck-locked:before {
    content: "";
    position: absolute;
    top: 3px;
    left: 23px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
}

[data-cws-tpl-style="custom"] .btck-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Actions ---------- */

[data-cws-tpl-style="custom"] .btck-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-cws-tpl-style="custom"] .btck-inner--modal .btck-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
}

/*
 * Buttons: (0,2,0)+ under the wrapper attribute, so theme button rules cannot
 * repaint them. Reset what Booklium sets on <button> before applying the design.
 */
[data-cws-tpl-style="custom"] .btck-actions .btck-btn {
    appearance: none;
    height: 50px;
    min-height: 0;
    margin: 0;
    padding: 0 28px;
    border: 1.5px solid var(--btck-navy);
    border-radius: 4px;
    background: #fff;
    color: var(--btck-navy);
    font: 700 15px/1 var(--btck-font);
    letter-spacing: .5px;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
    transition: background .25s, color .25s, border-color .25s;
}

[data-cws-tpl-style="custom"] .btck-actions .btck-btn:hover {
    background: var(--btck-soft);
    color: var(--btck-navy);
}

[data-cws-tpl-style="custom"] .btck-actions .btck-btn:focus-visible {
    outline: 2px solid var(--btck-navy);
    outline-offset: 2px;
}

[data-cws-tpl-style="custom"] .btck-actions .btck-btn--primary {
    padding: 0 32px;
    background: var(--btck-navy);
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(31, 58, 95, .7);
}

[data-cws-tpl-style="custom"] .btck-actions .btck-btn--primary:hover {
    background: var(--btck-navy-hover);
    border-color: var(--btck-navy-hover);
    color: #fff;
}

[data-cws-tpl-style="custom"] .btck-actions .btck-btn--link {
    padding: 0 16px;
    border-color: transparent;
    background: transparent;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--btck-red);
    text-underline-offset: 5px;
}

[data-cws-tpl-style="custom"] .btck-actions .btck-btn--link:hover {
    background: transparent;
    color: var(--btck-navy-hover);
}

/* The plugin pins .close-consent-modal as a 32px icon in the dialog's top-right
   corner; here it is the "back" button, so put it back in the row. */
[data-cws-tpl-style="custom"] .btck-actions .close-consent-modal {
    position: static;
    display: inline-block;
    width: auto;
}

/* ---------- Floating button ---------- */

[data-cws-tpl-style="custom"] .btck-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--btck-navy);
    box-shadow: 0 8px 22px -6px rgba(15, 30, 50, .55);
    transform: scale(.6) rotate(-30deg);
    transition: transform .5s cubic-bezier(.2, .8, .2, 1), background .25s;
}

.cws-cookie-floating-wrap[data-cws-tpl-style="custom"].active .btck-fab {
    transform: scale(1) rotate(0);
}

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

[data-cws-tpl-style="custom"] .btck-fab svg {
    width: 24px;
    height: 24px;
}

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

@media (max-width: 1199px) {
    [data-cws-tpl-style="custom"] .btck-inner {
        flex-wrap: wrap;
        gap: 20px 32px;
        padding: 24px 32px 28px;
    }

    [data-cws-tpl-style="custom"] .btck-actions {
        flex: 1 1 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    [data-cws-tpl-style="custom"] .btck-inner {
        gap: 16px;
        padding: 20px 16px 20px;
    }

    [data-cws-tpl-style="custom"] .btck-mark {
        display: none;
    }

    [data-cws-tpl-style="custom"] .btck-title {
        font-size: 21px;
    }

    [data-cws-tpl-style="custom"] .btck-text {
        font-size: 15px;
        line-height: 1.55;
    }

    [data-cws-tpl-style="custom"] .btck-dialog {
        max-height: 100vh;
        max-height: 100dvh;
    }

    [data-cws-tpl-style="custom"] .btck-cats {
        grid-template-columns: 1fr;
    }

    [data-cws-tpl-style="custom"] .btck-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    [data-cws-tpl-style="custom"] .btck-actions .btck-btn {
        width: 100%;
        height: 46px;
    }
}
