/*
 * Wolfram Cookie-Einwilligung · dialog styles
 *
 * Built from the storefront's own pieces, like the registration reminder
 * (GCI block b_wi_reg_reminder) and the register page: the light grey card,
 * the teal title slab with its slanted edge, teal parallelogram buttons,
 * sharp corners, teal bold text links, Source Sans 3 (loaded by the theme).
 * Compact by default. Everything is scoped to .wic-* so nothing leaks.
 */

.wic-root,
.wic-fab,
.wic-toast {
    --wic-teal: #00847e;
    --wic-teal-hover: #006b66;
    --wic-teal-deep: #00534f;
    --wic-ink: #1f2937;
    --wic-muted: #56616b;
    --wic-line: #e0e4e7;
    --wic-card: #f1f3f5;
    --wic-hover: #e3e8eb;
    --wic-font: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html.wic-lock,
html.wic-lock body {
    overflow: hidden;
}

/* ---- overlay + dialog ---------------------------------------------------- */

.wic-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483639;
    background: rgba(11, 23, 22, 0.5);
    animation: wic-fade 0.16s ease-out;
}

.wic-dialog {
    position: fixed;
    z-index: 2147483640;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(600px, calc(100vw - 24px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    background-color: var(--wic-card);
    background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0) 55%, rgba(31, 41, 55, 0.04) 100%);
    border: 0;
    border-radius: 0;
    box-shadow: 0 14px 36px rgba(0, 30, 29, 0.34), 0 0 44px rgba(0, 132, 126, 0.16);
    color: var(--wic-ink);
    font-family: var(--wic-font);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    animation: wic-rise 0.18s ease-out;
}

.wic-dialog[data-view='settings'] {
    width: min(720px, calc(100vw - 24px));
}

/* On the privacy policy / legal notice: no darkening, docked at the bottom,
   so the page underneath stays readable and scrollable. */
.wic-dialog--docked {
    top: auto;
    bottom: 12px;
    transform: translateX(-50%);
    max-height: min(70vh, 560px);
}

.wic-dialog:focus {
    outline: none;
}

.wic-dialog *,
.wic-dialog *::before,
.wic-dialog *::after {
    box-sizing: border-box;
    border-radius: 0;
}

/* ---- title slab + top controls --------------------------------------------- */

.wic-top {
    flex: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 36px;
}

.wic-slab {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    height: 36px;
    margin: 0;
    padding: 0 44px 0 20px;
    background: var(--wic-teal);
    color: #fff;
    font-family: var(--wic-font);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: normal;
    text-transform: uppercase;
    clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%);
}

.wic-slab__text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* back arrow at the start of the slab (settings opened from the first view) */
.wic-slab--back {
    padding-left: 4px;
}

.wic-slab__back {
    appearance: none;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 6px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.wic-slab__back:hover {
    background: var(--wic-teal-hover);
}

.wic-slab__back:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -5px;
}

.wic-top__controls {
    flex: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

/* DE | EN, as in the shop header: current language dark, the other one grey */
.wic-lang {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 4px;
}

.wic-lang__btn {
    appearance: none;
    height: 36px;
    margin: 0;
    padding: 0 6px;
    border: 0;
    background: none;
    color: #9aa3a3;
    font-family: var(--wic-font);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
}

.wic-lang__btn[aria-pressed='true'] {
    color: var(--wic-ink);
    cursor: default;
}

.wic-lang__btn[aria-pressed='false']:hover {
    color: var(--wic-teal);
}

.wic-close {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--wic-ink);
    font-family: var(--wic-font);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.wic-close:hover {
    background: var(--wic-hover);
    color: var(--wic-teal);
}

/* ---- body ----------------------------------------------------------------- */

.wic-body {
    padding: 14px 20px 4px;
    overflow: auto;
}

.wic-body--scroll {
    flex: 1 1 auto;
    min-height: 0;
}

.wic-text {
    margin: 0 0 8px;
    color: var(--wic-ink);
}

.wic-links {
    margin: 2px 0 10px;
    font-size: 13px;
}

.wic-links a,
.wic-facts a {
    color: var(--wic-teal);
    font-weight: 700;
    text-decoration: none;
}

.wic-links a:hover,
.wic-facts a:hover {
    color: var(--wic-teal-hover);
    text-decoration: underline;
}

.wic-dot {
    margin: 0 7px;
    color: var(--wic-muted);
}

/* ---- buttons ------------------------------------------------------------- */

.wic-actions {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 12px 20px 14px;
    border-top: 1px solid var(--wic-line);
}

.wic-actions__equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 0 1 auto;
    min-width: min(100%, 380px);
}

.wic-actions__equal--three {
    grid-template-columns: 1fr 1fr 1fr;
    min-width: min(100%, 540px);
}

.wic-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 22px;
    border: 0;
    border-radius: 0;
    font-family: var(--wic-font);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: normal;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Both decisions use the very same parallelogram (equal prominence). */
.wic-btn--primary,
.wic-btn--secondary {
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}

.wic-btn--primary {
    background: var(--wic-teal);
    color: #fff;
}

.wic-btn--primary:hover {
    background: var(--wic-teal-hover);
}

.wic-btn--primary:active {
    background: var(--wic-teal-deep);
}

.wic-btn--secondary {
    background: #dde3e6;
    color: var(--wic-teal-deep);
}

.wic-btn--secondary:hover {
    background: #cfd7db;
}

.wic-btn--link {
    min-height: 0;
    padding: 6px 2px;
    background: none;
    color: var(--wic-teal);
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
}

.wic-btn--link:hover {
    color: var(--wic-teal-hover);
    text-decoration: underline;
}

.wic-btn:focus-visible,
.wic-close:focus-visible,
.wic-lang__btn:focus-visible,
.wic-more:focus-visible,
.wic-fab:focus-visible,
.wic-links a:focus-visible,
.wic-facts a:focus-visible {
    outline: 2px solid var(--wic-teal-deep);
    outline-offset: 2px;
}

.wic-spacer {
    flex: 1 1 auto;
}

/* ---- categories ---------------------------------------------------------- */

.wic-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 12px;
}

.wic-cat {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--wic-line);
}

.wic-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wic-cat__name {
    margin: 0;
    font-family: var(--wic-font);
    font-size: 15px;
    font-weight: 700;
    color: var(--wic-ink);
}

.wic-cat__desc {
    margin: 2px 0 4px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--wic-muted);
}

/* "Immer aktiv": the shop's slanted step badge */
.wic-badge {
    flex: none;
    padding: 4px 14px;
    background: var(--wic-teal);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.wic-more {
    appearance: none;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--wic-teal);
    font-family: var(--wic-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.wic-more::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
    transition: transform 0.15s;
}

.wic-more[aria-expanded='true']::after {
    transform: translateY(1px) rotate(225deg);
}

.wic-services {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.wic-services[hidden] {
    display: none;
}

.wic-service {
    padding: 8px 10px;
    background: var(--wic-card);
}

.wic-service__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wic-service__name {
    margin: 0;
    font-family: var(--wic-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--wic-ink);
}

.wic-service__desc {
    margin: 2px 0 6px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--wic-ink);
}

.wic-facts {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2px 12px;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
}

.wic-facts dt {
    margin: 0;
    font-weight: 700;
    color: var(--wic-muted);
}

.wic-facts dd {
    margin: 0;
    color: var(--wic-ink);
    overflow-wrap: anywhere;
}

.wic-cookies {
    margin-top: 8px;
}

.wic-cookies__title {
    margin: 0 0 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--wic-muted);
}

.wic-cookies table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.35;
    background: #fff;
    border: 1px solid var(--wic-line);
}

.wic-cookies th {
    padding: 5px 7px;
    background: var(--wic-hover);
    color: var(--wic-ink);
    font-weight: 700;
    text-align: left;
}

.wic-cookies td {
    padding: 5px 7px;
    border-top: 1px solid var(--wic-line);
    vertical-align: top;
    color: var(--wic-ink);
}

.wic-cookies td:first-child,
.wic-cookies td:first-child code {
    white-space: nowrap;
    overflow-wrap: normal;
}

.wic-cookies td:nth-child(2) {
    white-space: nowrap;
}

.wic-cookies code,
.wic-consent-id code {
    font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
    font-size: 11.5px;
    color: var(--wic-teal-deep);
    background: none;
    padding: 0;
    overflow-wrap: anywhere;
}

/* ---- switch (sharp, like the rest of the shop) ----------------------------- */

.wic-switch {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.wic-switch__input {
    position: absolute;
    opacity: 0;
    width: 40px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}

.wic-switch__track {
    position: relative;
    width: 40px;
    height: 22px;
    background: #9aa3a3;
    transition: background-color 0.15s;
}

.wic-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    transition: transform 0.15s;
}

.wic-switch__input:checked + .wic-switch__track {
    background: var(--wic-teal);
}

.wic-switch__input:checked + .wic-switch__track::after {
    transform: translateX(18px);
}

/* the top row sits at the dialog's clipped edge: draw these rings inside */
.wic-close:focus-visible,
.wic-lang__btn:focus-visible {
    outline-offset: -3px;
}

.wic-switch__input:focus-visible + .wic-switch__track {
    outline: 2px solid var(--wic-teal-deep);
    outline-offset: 2px;
}

.wic-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.wic-consent-id {
    flex: 1 1 auto;
    margin: 0;
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--wic-muted);
}

/* ---- floating button, toast, footer fallback ------------------------------ */

/* the cookie icon button: a smaller sibling of the chat launcher, sharp like the shop */
.wic-fab {
    position: fixed;
    bottom: 14px;
    z-index: 2147482000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--wic-teal);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 30, 29, 0.22);
    transition: background-color 0.15s ease;
}

.wic-fab svg {
    display: block;
    width: 24px;
    height: 24px;
}

.wic-fab:hover {
    background: var(--wic-teal-hover);
}

.wic-fab:active {
    background: var(--wic-teal-deep);
}

.wic-fab--left { left: 12px; }
.wic-fab--right { right: 12px; }
.wic-fab[hidden] { display: none; }

.wic-toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 2147483641;
    transform: translateX(-50%);
    padding: 9px 22px;
    background: var(--wic-teal-deep);
    color: #fff;
    font-family: var(--wic-font);
    font-size: 13px;
    font-weight: 700;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    animation: wic-rise 0.18s ease-out;
}

.wic-footer-fallback {
    margin: 8px 0 0;
    text-align: center;
}

/* ---- phones: bottom sheet ------------------------------------------------ */

@media (max-width: 640px) {
    .wic-dialog,
    .wic-dialog[data-view='settings'],
    .wic-dialog--docked {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        width: 100%;
        max-height: 88vh;
        max-height: 88dvh;
    }

    .wic-slab {
        padding-right: 34px;
        font-size: 13px;
    }

    .wic-slab--back {
        padding-left: 2px;
    }

    .wic-lang__btn {
        padding: 0 5px;
        font-size: 14px;
    }

    .wic-close {
        width: 36px;
    }

    .wic-body {
        padding: 12px 14px 2px;
    }

    .wic-text {
        font-size: 13.5px;
    }

    .wic-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 6px;
        padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .wic-actions__equal,
    .wic-actions__equal--three {
        min-width: 0;
        grid-template-columns: 1fr 1fr;
    }

    .wic-actions__equal--three .wic-btn--primary {
        grid-column: 1 / -1;
        order: -1;
    }

    .wic-btn {
        min-height: 40px;
        padding: 0 14px;
        font-size: 13px;
    }

    .wic-btn--link {
        align-self: center;
    }

    .wic-consent-id {
        text-align: center;
    }

    .wic-facts {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .wic-facts dd {
        margin-bottom: 4px;
    }

    .wic-cookies table,
    .wic-cookies thead,
    .wic-cookies tbody,
    .wic-cookies tr,
    .wic-cookies td {
        display: block;
    }

    .wic-cookies thead {
        display: none;
    }

    .wic-cookies tr {
        padding: 4px 0;
        border-top: 1px solid var(--wic-line);
    }

    .wic-cookies td {
        border: 0;
        padding: 1px 7px;
    }

    .wic-fab {
        bottom: 10px;
        width: 38px;
        height: 38px;
    }

    .wic-fab svg {
        width: 21px;
        height: 21px;
    }

    .wic-fab--left { left: 8px; }
    .wic-fab--right { right: 8px; }
}

@keyframes wic-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wic-rise {
    from { opacity: 0; translate: 0 6px; }
    to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .wic-overlay,
    .wic-dialog,
    .wic-toast {
        animation: none;
    }
}
