/* Own-built banner + preferences modal - visual pass 2 (polish round). Modeled loosely on
   CookieYes' clean card layout (white surfaces, generous spacing, accordion categories,
   clear button hierarchy) while keeping what the original vendor CMP did well (simple
   toggle-per-category list, orange brand accent, compact "Szczegoly" disclosure). Mobile
   first throughout; cards (never wide tables) below 768px so nothing overflows. */

:root {
    --eb-consent-radius: 14px;
    --eb-consent-border: #e7e5e2;
    --eb-consent-text: #202630;
    --eb-consent-muted: #69717d;
    --eb-consent-accent: var(--store-accent, #ef7b1c);
    --eb-consent-accent-hover: var(--store-accent-hover, #d9650b);
    --eb-consent-shadow: 0 12px 40px rgba(32, 38, 48, 0.18);
}

.eb-consent-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 99999;
    background: #fff;
    color: var(--eb-consent-text);
    border-radius: var(--eb-consent-radius);
    box-shadow: var(--eb-consent-shadow);
    border: 1px solid var(--eb-consent-border);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 880px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.5;
    animation: eb-consent-rise 0.25s ease-out;
}

@keyframes eb-consent-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.eb-consent-banner__title {
    font-size: 1.05em;
    font-weight: 700;
    margin: 0 0 4px;
}

.eb-consent-banner__text {
    color: var(--eb-consent-muted);
    margin: 0;
}

.eb-consent-banner__actions,
.eb-consent-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.eb-consent-btn {
    border: 1px solid var(--eb-consent-border);
    background: #fff;
    color: var(--eb-consent-text);
    padding: 11px 20px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.92em;
    font-weight: 600;
    transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
    white-space: nowrap;
}

.eb-consent-btn:hover {
    border-color: #c9c6c1;
    background: #f7f6f4;
}

.eb-consent-btn:active {
    transform: scale(0.98);
}

.eb-consent-btn--text {
    border-color: transparent;
    background: transparent;
    padding-left: 10px;
    padding-right: 10px;
}

.eb-consent-btn--text:hover {
    background: #f7f6f4;
}

.eb-consent-btn--accent {
    background: var(--eb-consent-accent);
    border-color: var(--eb-consent-accent);
    color: #fff;
}

.eb-consent-btn--accent:hover {
    background: var(--eb-consent-accent-hover);
    border-color: var(--eb-consent-accent-hover);
}

@media (min-width: 700px) {
    .eb-consent-banner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 20px 26px;
    }

    .eb-consent-banner__copy {
        flex: 1 1 auto;
        padding-right: 24px;
    }

    .eb-consent-banner__actions {
        flex: 0 0 auto;
    }
}

/* ---------- Modal ---------- */

.eb-consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(24, 27, 33, 0.55);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 16px;
    animation: eb-consent-fade 0.15s ease-out;
}

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

.eb-consent-modal {
    background: #fff;
    color: var(--eb-consent-text);
    border-radius: var(--eb-consent-radius);
    box-shadow: var(--eb-consent-shadow);
    max-width: 620px;
    width: 100%;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    margin: auto;
    overflow: hidden;
}

.eb-consent-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--eb-consent-border);
}

.eb-consent-modal__title {
    margin: 0 0 4px;
    font-size: 1.25em;
    font-weight: 700;
}

.eb-consent-modal__subtitle {
    margin: 0;
    color: var(--eb-consent-muted);
    font-size: 0.88em;
    line-height: 1.5;
}

.eb-consent-modal__close {
    background: none;
    border: none;
    color: var(--eb-consent-muted);
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    flex: 0 0 auto;
}

.eb-consent-modal__close:hover {
    background: #f2f1ef;
    color: var(--eb-consent-text);
}

.eb-consent-modal__body {
    overflow-y: auto;
    padding: 8px 24px;
}

.eb-consent-category {
    border-bottom: 1px solid var(--eb-consent-border);
    padding: 16px 0;
}

.eb-consent-category:last-child {
    border-bottom: none;
}

.eb-consent-category__head {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.eb-consent-category__chevron {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--eb-consent-muted);
    transition: transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eb-consent-category--open .eb-consent-category__chevron {
    transform: rotate(90deg);
}

.eb-consent-category__name {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 0.98em;
}

.eb-consent-category__badge {
    font-size: 0.72em;
    font-weight: 700;
    color: var(--eb-consent-muted);
    background: #f2f1ef;
    border-radius: 999px;
    padding: 2px 10px;
    margin-right: 4px;
    white-space: nowrap;
}

.eb-consent-category__desc {
    margin: 8px 0 0 30px;
    color: var(--eb-consent-muted);
    font-size: 0.88em;
    line-height: 1.5;
}

.eb-consent-category__body {
    margin-left: 30px;
}

/* Toggle switch */
.eb-consent-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: 0 0 auto;
}

.eb-consent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.eb-consent-toggle__slider {
    position: absolute;
    inset: 0;
    background: #d8d6d2;
    border-radius: 22px;
    transition: 0.15s;
}

.eb-consent-toggle__slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.eb-consent-toggle input:checked + .eb-consent-toggle__slider {
    background: var(--eb-consent-accent);
}

.eb-consent-toggle input:checked + .eb-consent-toggle__slider::before {
    transform: translateX(18px);
}

.eb-consent-toggle input:disabled + .eb-consent-toggle__slider {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Details (name/provider/purpose/period) */
.eb-consent-details {
    margin-top: 12px;
}

.eb-consent-details__empty {
    font-size: 0.85em;
    color: var(--eb-consent-muted);
    margin: 4px 0;
    font-style: italic;
}

.eb-consent-details__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
}

.eb-consent-card {
    border: 1px solid var(--eb-consent-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.85em;
    max-width: 100%;
    word-break: break-word;
    background: #fbfaf9;
}

.eb-consent-card__name {
    font-weight: 700;
    color: var(--eb-consent-text);
    font-size: 1.02em;
    margin-bottom: 6px;
}

/* Dostawca/Cel/Okres render as a compact label:value grid regardless of screen width -
   the modal itself is never wide enough for a real spreadsheet-style table to breathe, so
   this reads cleanly on a large desktop monitor exactly as it does on a phone. */
.eb-consent-card__fields {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    row-gap: 4px;
}

.eb-consent-card__fields dt {
    color: var(--eb-consent-muted);
    font-weight: 600;
    white-space: nowrap;
}

.eb-consent-card__fields dd {
    margin: 0;
}

.eb-consent-modal__footer {
    padding: 16px 24px 22px;
    border-top: 1px solid var(--eb-consent-border);
}

.eb-consent-modal__footer .eb-consent-btn {
    flex: 1 1 auto;
    text-align: center;
}

.eb-consent-modal__link {
    padding: 0 24px 12px;
    font-size: 0.85em;
}

.eb-consent-modal__link a {
    color: var(--eb-consent-text);
    text-decoration: underline;
}

@media (min-width: 480px) {
    .eb-consent-modal__footer .eb-consent-btn {
        flex: 0 0 auto;
    }

    .eb-consent-modal__footer .eb-consent-btn--accent {
        margin-left: auto;
    }
}

