/*
 * Zorno Cookies: banner and panel. Themes adjust the look through the custom
 * properties; with "Wygląd banera: z motywu" the plugin fills them from the
 * theme's Global Styles (src/ThemeStyle.php).
 */

.zorno-cookies-bar,
.zorno-cookies,
.zorno-cookies-float {
    --zc-accent: var(--zorno-cookies-accent, #1d2327);
    --zc-bg: #fff;
    --zc-fg: #1d2327;
    --zc-muted: #50575e;
    --zc-line: #dcdcde;
    --zc-radius: 10px;
    font-family: var(--zc-font, inherit);
    color: var(--zc-fg);
}

/* Theme heading styles (colour, capitals, tracking) must not make the panel hard to read. */
.zorno-cookies-bar__title,
.zorno-cookies h2,
.zorno-cookies h3 {
    font-family: var(--zc-heading-font, inherit);
    color: var(--zc-fg);
    text-transform: none;
    font-variant: normal;
    letter-spacing: normal;
}

.zorno-cookies-bar p,
.zorno-cookies p,
.zorno-cookies td,
.zorno-cookies th {
    font-family: var(--zc-font, inherit);
}

.zorno-cookies-locked,
.zorno-cookies-locked body {
    overflow: hidden;
}

.zorno-cookies-bar {
    position: fixed;
    inset: auto 16px 16px 16px;
    margin: 0 auto;
    max-width: 960px;
    width: auto;
    padding: 0;
    border: 1px solid var(--zc-line);
    border-radius: var(--zc-radius);
    background: var(--zc-bg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    z-index: 2147483000;
}

.zorno-cookies-bar::backdrop {
    background: rgba(0, 0, 0, .45);
}

.zorno-cookies-bar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
    padding: 20px 24px;
}

.zorno-cookies-bar__inner > div:first-child {
    flex: 1 1 360px;
}

.zorno-cookies-bar__title {
    margin: 0 0 6px;
    font-weight: 700;
    font-size: 1.05rem;
}

.zorno-cookies-bar__copy {
    margin: 0;
    font-size: .92rem;
    line-height: 1.5;
    color: var(--zc-muted);
}

.zorno-cookies-bar__copy a,
.zorno-cookies__note a {
    color: inherit;
    text-decoration: underline;
}

.zorno-cookies-bar__actions,
.zorno-cookies__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zorno-cookies__button {
    appearance: none;
    cursor: pointer;
    padding: 10px 18px;
    border: 2px solid var(--zc-accent);
    border-radius: var(--zc-button-radius, 999px);
    background: var(--zc-accent);
    color: var(--zc-accent-fg, #fff);
    font: inherit;
    font-family: var(--zc-button-font, inherit);
    font-size: .92rem;
    font-weight: var(--zc-button-weight, 600);
    letter-spacing: var(--zc-button-spacing, normal);
    text-transform: var(--zc-button-transform, none);
    line-height: 1.2;
}

/* Text in the page colour: a light accent (e.g. gold) on a light background would be unreadable. */
.zorno-cookies__button--ghost {
    background: transparent;
    color: var(--zc-fg);
}

.zorno-cookies__button:focus-visible,
.zorno-cookies__close:focus-visible,
.zorno-cookies-float:focus-visible,
.zorno-cookies__switch input:focus-visible {
    outline: 3px solid var(--zc-accent);
    outline-offset: 2px;
}

.zorno-cookies {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 0;
    border-radius: var(--zc-radius);
    background: var(--zc-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.zorno-cookies[open] {
    display: flex;
    flex-direction: column;
}

.zorno-cookies::backdrop {
    background: rgba(0, 0, 0, .55);
}

.zorno-cookies__head,
.zorno-cookies__foot {
    padding: 16px 24px;
    border-bottom: 1px solid var(--zc-line);
}

.zorno-cookies__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zorno-cookies__head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.zorno-cookies__foot {
    justify-content: flex-end;
    border-top: 1px solid var(--zc-line);
    border-bottom: 0;
}

.zorno-cookies__close {
    appearance: none;
    cursor: pointer;
    border: 0;
    background: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--zc-muted);
}

.zorno-cookies__body {
    overflow: auto;
    padding: 8px 24px 16px;
    font-size: .92rem;
    line-height: 1.5;
}

.zorno-cookies__category {
    padding: 14px 0;
    border-bottom: 1px solid var(--zc-line);
}

.zorno-cookies__category-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.zorno-cookies__category-head h3 {
    margin: 0;
    font-size: 1rem;
}

.zorno-cookies__category-copy {
    margin: 6px 0 0;
    color: var(--zc-muted);
}

.zorno-cookies__always {
    font-size: .85rem;
    font-weight: 600;
    color: var(--zc-muted);
}

.zorno-cookies__switch {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.zorno-cookies__switch input {
    width: 20px;
    height: 20px;
    accent-color: var(--zc-accent);
}

.zorno-cookies__table-wrap {
    overflow-x: auto;
    margin-top: 10px;
}

.zorno-cookies__table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.zorno-cookies__table th,
.zorno-cookies__table td {
    padding: 6px 8px;
    border: 1px solid var(--zc-line);
    text-align: left;
    vertical-align: top;
}

.zorno-cookies__note {
    margin-top: 14px;
    color: var(--zc-muted);
    font-size: .85rem;
}

.zorno-cookies .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.zorno-cookies-float {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    cursor: pointer;
    border: 0;
    border-radius: 50%;
    background: var(--zc-accent);
    color: var(--zc-accent-fg, #fff);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    z-index: 2147482999;
}

@media (max-width: 600px) {
    .zorno-cookies-bar {
        inset: auto 8px 8px 8px;
    }

    .zorno-cookies-bar__actions .zorno-cookies__button {
        flex: 1 1 auto;
    }
}
