/*
 * citybox-cookie.css
 * CityBox cookie banner
 * v4.7.0 text-only-compact
 *
 * Structure:
 * - desktop: compact text-only cookie panel
 * - mobile: compact notification with one text line flow
 * - mobile only: hide Jivo while cookie banner is visible
 */

.cb-cookie {
    --cb-cookie-bg: #ffffff;
    --cb-cookie-text: #243241;
    --cb-cookie-muted: #627082;
    --cb-cookie-border: rgba(20, 31, 45, 0.12);
    --cb-cookie-shadow: 0 12px 34px rgba(15, 23, 42, 0.14);
    --cb-cookie-accent: #f58220;
    --cb-cookie-accent-hover: #e87518;
    --cb-cookie-radius: 18px;

    position: fixed;
    right: 0;
    bottom: 14px;
    left: 0;
    z-index: 2147483647;
    box-sizing: border-box;
    padding: 0 16px;
    color: var(--cb-cookie-text);
    font-family: inherit;
    pointer-events: none;
}

.cb-cookie,
.cb-cookie * {
    box-sizing: border-box;
}

.cb-cookie[hidden] {
    display: none !important;
}

.cb-cookie__panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: min(100%, 840px);
    max-height: calc(100vh - 28px);
    margin: 0 auto;
    padding: 12px 14px 12px 18px;
    gap: 14px;
    overflow: auto;
    background: var(--cb-cookie-bg);
    border: 1px solid var(--cb-cookie-border);
    border-radius: var(--cb-cookie-radius);
    box-shadow: var(--cb-cookie-shadow);
    pointer-events: auto;
}

.cb-cookie__content {
    min-width: 0;
}

.cb-cookie__text {
    margin: 0;
    color: var(--cb-cookie-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.cb-cookie__link {
    color: var(--cb-cookie-accent);
    font-weight: 800;
    text-decoration: none;
    text-underline-offset: 3px;
}

.cb-cookie__link:hover,
.cb-cookie__link:focus-visible {
    color: var(--cb-cookie-accent-hover);
    text-decoration: underline;
}

.cb-cookie__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.cb-cookie__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 98px;
    min-height: 36px;
    margin: 0;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.cb-cookie__button:hover {
    transform: translateY(-1px);
}

.cb-cookie__button:active {
    transform: translateY(0);
}

.cb-cookie__button:focus-visible {
    outline: 3px solid rgba(245, 130, 32, 0.24);
    outline-offset: 2px;
}

.cb-cookie__button--reject {
    color: var(--cb-cookie-text);
    background: #ffffff;
    border-color: var(--cb-cookie-border);
}

.cb-cookie__button--reject:hover,
.cb-cookie__button--reject:focus-visible {
    color: var(--cb-cookie-text);
    background: #f7f8fa;
    border-color: rgba(20, 31, 45, 0.2);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.cb-cookie__button--accept {
    color: #ffffff;
    background: var(--cb-cookie-accent);
    border-color: var(--cb-cookie-accent);
    box-shadow: 0 6px 16px rgba(245, 130, 32, 0.22);
}

.cb-cookie__button--accept:hover,
.cb-cookie__button--accept:focus-visible {
    background: var(--cb-cookie-accent-hover);
    border-color: var(--cb-cookie-accent-hover);
    box-shadow: 0 8px 20px rgba(245, 130, 32, 0.28);
}

@media (max-width: 767px) {
    .cb-cookie {
        bottom: calc(8px + env(safe-area-inset-bottom));
        padding: 0 12px;
    }

    .cb-cookie__panel {
        display: block;
        width: 100%;
        max-height: calc(100vh - 16px - env(safe-area-inset-bottom));
        padding: 14px 16px 16px;
        border-radius: 18px;
        box-shadow:
            0 12px 30px rgba(15, 23, 42, 0.14),
            0 2px 8px rgba(15, 23, 42, 0.05);
    }

    .cb-cookie__text {
        font-size: 13.5px;
        font-weight: 500;
        line-height: 1.42;
    }

    .cb-cookie__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 13px;
    }

    .cb-cookie__button {
        width: 100%;
        min-width: 0;
        min-height: 34px;
        padding: 7px 10px;
        font-size: 12.5px;
    }

    /*
     * Mobile only:
     * Hide Jivo while the cookie banner is visible.
     * This prevents the chat bubble from covering the cookie actions.
     */
    body:has(.cb-cookie:not([hidden])) jdiv,
    body:has(.cb-cookie:not([hidden])) #jivo-iframe-container,
    body:has(.cb-cookie:not([hidden])) [id^="jivo"],
    body:has(.cb-cookie:not([hidden])) [id*="jivo"],
    body:has(.cb-cookie:not([hidden])) [class^="jivo"],
    body:has(.cb-cookie:not([hidden])) [class*="jivo"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

@media (max-width: 420px) {
    .cb-cookie {
        padding: 0 10px;
    }

    .cb-cookie__panel {
        padding: 13px 15px 15px;
        border-radius: 17px;
    }

    .cb-cookie__text {
        font-size: 13px;
        line-height: 1.4;
    }

    .cb-cookie__actions {
        gap: 12px;
        margin-top: 13px;
    }

    .cb-cookie__button {
        min-height: 34px;
        padding: 7px 8px;
        font-size: 12.5px;
    }
}

@media (max-width: 340px) {
    .cb-cookie {
        padding: 0 8px;
    }

    .cb-cookie__panel {
        padding: 12px;
    }

    .cb-cookie__actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cb-cookie__button {
        min-height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cb-cookie__button {
        transition: none;
    }

    .cb-cookie__button:hover,
    .cb-cookie__button:active {
        transform: none;
    }
}