.ebcc,
.ebcc * {
    box-sizing: border-box;
}

.ebcc {
    --ebcc-accent: #9b111e;
    --ebcc-text: #222;
    --ebcc-muted: #666;
    --ebcc-bg: #fff;
    --ebcc-border: #e6e6e6;
    font-family: inherit;
    line-height: 1.45;
}

.ebcc__backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: rgba(0, 0, 0, .45);
}

.ebcc__panel,
.ebcc__preferences {
    position: fixed;
    z-index: 2147483001;
    background: var(--ebcc-bg);
    color: var(--ebcc-text);
    border: 1px solid var(--ebcc-border);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.ebcc--bottom .ebcc__panel {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 1180px;
    margin: 0 auto;
    border-radius: 12px;
}

.ebcc--center .ebcc__panel {
    left: 50%;
    top: 50%;
    width: calc(100% - 32px);
    max-width: 760px;
    transform: translate(-50%, -50%);
    border-radius: 12px;
}

.ebcc__content,
.ebcc__preferences-inner {
    padding: 22px;
}

.ebcc__title {
    margin: 0 0 10px;
    font-size: 1.2rem;
    line-height: 1.25;
}

.ebcc__message,
.ebcc__message p,
.ebcc__policy,
.ebcc__category p {
    margin: 0;
    font-size: .95rem;
}

.ebcc__message {
    color: var(--ebcc-muted);
}

.ebcc__policy {
    margin-top: 8px;
}

.ebcc__policy a {
    color: var(--ebcc-accent);
    text-decoration: underline;
}

.ebcc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.ebcc__btn,
.ebcc__reopen,
.ebcc__close {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    cursor: pointer;
}

.ebcc__btn {
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 7px;
    border: 1px solid var(--ebcc-accent);
    background: transparent;
    color: var(--ebcc-accent);
    font-weight: 600;
}

.ebcc__btn:hover,
.ebcc__btn:focus-visible {
    filter: brightness(.96);
}

.ebcc__btn--accept {
    background: var(--ebcc-accent);
    color: #fff;
}

.ebcc__btn--reject {
    background: #fff;
    color: var(--ebcc-text);
    border-color: #bbb;
}

.ebcc__btn--prefs {
    border-color: transparent;
    color: var(--ebcc-text);
    text-decoration: underline;
}

.ebcc__preferences {
    left: 50%;
    top: 50%;
    width: calc(100% - 32px);
    max-width: 680px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    transform: translate(-50%, -50%);
    border-radius: 12px;
}

.ebcc__preferences-inner {
    position: relative;
}

.ebcc__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: var(--ebcc-text);
    font-size: 28px;
    line-height: 1;
}

.ebcc__category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--ebcc-border);
}

.ebcc__category:first-of-type {
    margin-top: 14px;
}

.ebcc__category strong {
    display: block;
    margin-bottom: 4px;
}

.ebcc__category p {
    color: var(--ebcc-muted);
}

.ebcc__switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
}

.ebcc__switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ebcc__switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #c8c8c8;
    transition: .2s ease;
}

.ebcc__switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: .2s ease;
}

.ebcc__switch input:checked + span {
    background: var(--ebcc-accent);
}

.ebcc__switch input:checked + span::after {
    transform: translateX(20px);
}

.ebcc__switch--locked {
    opacity: .72;
}

.ebcc__reopen {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 2147482999;
    padding: 8px 12px;
    border: 1px solid var(--ebcc-accent);
    border-radius: 999px;
    background: #fff;
    color: var(--ebcc-accent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
    font-size: .86rem;
}

.ebcc [hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .ebcc--bottom .ebcc__panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .ebcc__content,
    .ebcc__preferences-inner {
        padding: 18px;
    }

    .ebcc__actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ebcc__btn {
        width: 100%;
    }

    .ebcc__category {
        align-items: flex-start;
    }

    .ebcc__reopen {
        left: 8px;
        bottom: 8px;
        max-width: calc(100vw - 16px);
    }
}

/* v1.0.1: fallback visibility. The first consent panel remains visible even if JS fails. */
.ebcc__panel[hidden],
.ebcc__preferences[hidden],
.ebcc__backdrop[hidden],
.ebcc__reopen[hidden] {
    display: none !important;
}


/* v1.0.3 - discreet E-base.gr signature */
.ebcc__signature {
    margin-top: 10px;
    text-align: right;
    line-height: 1.2;
}
.ebcc__signature a {
    color: #8a8a8a !important;
    font-size: 10.5px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    opacity: .72;
    transition: opacity .18s ease, color .18s ease;
}
.ebcc__signature a:hover,
.ebcc__signature a:focus {
    color: var(--ebcc-accent) !important;
    opacity: 1;
    text-decoration: none !important;
}
@media (max-width: 640px) {
    .ebcc__signature { margin-top: 9px; text-align: center; }
    .ebcc__signature a { font-size: 10px !important; }
}


/* v1.0.6 - viewport portal hardening for transformed/clipped Joomla template containers */
html body .ebcc[data-ebcc-config] {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    pointer-events: none !important;
    z-index: 2147482998 !important;
    transform: none !important;
    contain: none !important;
}

html body .ebcc[data-ebcc-config] .ebcc__backdrop {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, .45) !important;
    pointer-events: auto !important;
}

html body .ebcc[data-ebcc-config] .ebcc__panel {
    position: absolute !important;
    top: auto !important;
    right: auto !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    width: min(1180px, calc(100vw - 24px)) !important;
    width: min(1180px, calc(100dvw - 24px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    max-width: calc(100dvw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-50%) !important;
    pointer-events: auto !important;
}

html body .ebcc[data-ebcc-config].ebcc--center .ebcc__panel {
    top: 50% !important;
    bottom: auto !important;
    width: min(760px, calc(100vw - 24px)) !important;
    width: min(760px, calc(100dvw - 24px)) !important;
    transform: translate(-50%, -50%) !important;
}

html body .ebcc[data-ebcc-config] .ebcc__preferences {
    position: absolute !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    width: min(680px, calc(100vw - 24px)) !important;
    width: min(680px, calc(100dvw - 24px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    max-width: calc(100dvw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: auto !important;
}

html body .ebcc[data-ebcc-config] .ebcc__reopen {
    position: absolute !important;
    right: auto !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    max-width: calc(100vw - 16px) !important;
    max-width: calc(100dvw - 16px) !important;
    pointer-events: auto !important;
}

html body .ebcc[data-ebcc-config] .ebcc__content,
html body .ebcc[data-ebcc-config] .ebcc__preferences-inner,
html body .ebcc[data-ebcc-config] .ebcc__actions,
html body .ebcc[data-ebcc-config] .ebcc__category,
html body .ebcc[data-ebcc-config] .ebcc__message,
html body .ebcc[data-ebcc-config] .ebcc__policy,
html body .ebcc[data-ebcc-config] .ebcc__signature {
    min-width: 0 !important;
    max-width: 100% !important;
}

html body .ebcc[data-ebcc-config] .ebcc__message,
html body .ebcc[data-ebcc-config] .ebcc__message *,
html body .ebcc[data-ebcc-config] .ebcc__policy,
html body .ebcc[data-ebcc-config] .ebcc__policy *,
html body .ebcc[data-ebcc-config] .ebcc__category,
html body .ebcc[data-ebcc-config] .ebcc__category *,
html body .ebcc[data-ebcc-config] .ebcc__btn {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

@media (max-width: 640px) {
    html body .ebcc[data-ebcc-config] .ebcc__panel,
    html body .ebcc[data-ebcc-config].ebcc--center .ebcc__panel,
    html body .ebcc[data-ebcc-config] .ebcc__preferences {
        width: calc(100vw - 16px) !important;
        width: calc(100dvw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        max-width: calc(100dvw - 16px) !important;
    }

    html body .ebcc[data-ebcc-config] .ebcc__panel {
        bottom: max(8px, env(safe-area-inset-bottom)) !important;
    }

    html body .ebcc[data-ebcc-config] .ebcc__content,
    html body .ebcc[data-ebcc-config] .ebcc__preferences-inner {
        padding: 16px !important;
    }

    html body .ebcc[data-ebcc-config] .ebcc__actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        gap: 8px !important;
    }

    html body .ebcc[data-ebcc-config] .ebcc__btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        white-space: normal !important;
        text-align: center !important;
    }

    html body .ebcc[data-ebcc-config] .ebcc__category {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 12px !important;
        align-items: start !important;
    }
}

@media (max-width: 360px) {
    html body .ebcc[data-ebcc-config] .ebcc__content,
    html body .ebcc[data-ebcc-config] .ebcc__preferences-inner {
        padding: 13px !important;
    }

    html body .ebcc[data-ebcc-config] .ebcc__title {
        font-size: 1.05rem !important;
    }

    html body .ebcc[data-ebcc-config] .ebcc__message,
    html body .ebcc[data-ebcc-config] .ebcc__message p,
    html body .ebcc[data-ebcc-config] .ebcc__policy,
    html body .ebcc[data-ebcc-config] .ebcc__category p {
        font-size: .88rem !important;
    }
}

/* v1.1.0 - compliance/accessibility refinements */
.ebcc__preferences-intro {
    margin: 0 0 10px;
    color: var(--ebcc-muted);
    font-size: .92rem;
}

/* Accept and reject are intentionally given equivalent visual weight. */
.ebcc__btn--choice {
    min-width: 160px;
    background: var(--ebcc-accent);
    color: #fff;
    border-color: var(--ebcc-accent);
    font-weight: 700;
}

.ebcc__btn--choice:hover,
.ebcc__btn--choice:focus-visible {
    background: var(--ebcc-accent);
    color: #fff;
    outline: 3px solid color-mix(in srgb, var(--ebcc-accent) 28%, transparent);
    outline-offset: 2px;
}

.ebcc__btn--prefs {
    min-width: 160px;
}

.ebcc__switch input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--ebcc-accent) 28%, transparent);
    outline-offset: 2px;
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
    .ebcc__btn--choice:focus-visible,
    .ebcc__switch input:focus-visible + span {
        outline: 3px solid rgba(155, 17, 30, .3);
    }
}
