/**
 * Copyright © TecnoStack. All rights reserved.
 *
 * Loaded inside the Shadow DOM of #ts-cookie-consent (and of blocked-iframe placeholders), so theme
 * stylesheets cannot reach these rules and these rules cannot leak into the theme.
 * Logical properties only: the layout mirrors automatically in RTL.
 * Customise through the admin design settings, the --tscc-* custom properties or ::part().
 */

:host(#ts-cookie-consent) {
    all: initial !important;
    display: block !important;
    position: static !important;
    font-family: inherit !important;
}

:host(.tscc-placeholder-host) {
    font-family: inherit;
}

:host([dir="rtl"]) {
    direction: rtl;
}

:host([dir="ltr"]) {
    direction: ltr;
}

:host {
    --tscc-primary: #111111;
    --tscc-primary-text: #ffffff;
    --tscc-primary-hover: #333333;
    --tscc-accent: #0058a3;
    --tscc-toggle-off: #767676;
    --tscc-border: #dfdfdf;
    --tscc-expanded-bg: #f5f5f5;
    --tscc-overlay-opacity: 0.5;
    --tscc-text: #111111;
    --tscc-surface: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

.tscc,
.tscc-placeholder {
    color: var(--tscc-text);
    font-family: inherit;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.5;
    text-align: start;
    text-transform: none;
    word-spacing: normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

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

.tscc-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin: 0;
    padding: 0 24px;
    border: 0;
    border-radius: 100px;
    background: var(--tscc-primary);
    color: var(--tscc-primary-text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

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

.tscc-btn:focus-visible {
    outline: 2px solid var(--tscc-accent);
    outline-offset: 2px;
}

.tscc-btn--outline {
    min-width: 210px;
    height: 42px;
    border: 1px solid var(--tscc-text);
    background: transparent;
    color: var(--tscc-text);
}

.tscc-btn--outline:hover {
    background: var(--tscc-expanded-bg);
}

/* ------------------------------------------------------------------ banner */

.tscc-banner {
    position: fixed;
    bottom: 16px;
    z-index: 2147483640;
    display: flex;
    flex-direction: column;
    width: calc(100% - 28px);
    max-width: 500px;
    max-height: 60vh;
    margin: 0;
    border-radius: 2.5px;
    background: var(--tscc-surface);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: var(--tscc-text);
    animation: tscc-banner-in 0.2s ease-out;
}

.tscc-banner--bottom-start {
    inset-inline-start: 14px;
}

.tscc-banner--bottom-end {
    inset-inline-end: 14px;
}

.tscc-banner--bottom-center {
    left: 0;
    right: 0;
    margin-inline: auto;
}

.tscc-banner--bottom-full-width {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
}

.tscc-banner__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 24px 0;
    overscroll-behavior: contain;
}

.tscc-banner__title {
    margin: 0 0 10px;
    padding-inline-end: 25px;
    color: var(--tscc-text);
    font-size: 15.4px;
    font-weight: 600;
    line-height: 1.4;
}

.tscc-banner__text {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
}

.tscc-banner__list {
    margin: 8px 0 0;
    padding: 0;
    padding-inline-start: 20px;
    font-size: 14px;
    list-style: disc;
}

.tscc-banner__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    padding: 0 24px 24px;
}

@keyframes tscc-banner-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------------------ preference centre */

.tscc-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    background: #000000;
    opacity: var(--tscc-overlay-opacity);
    animation: tscc-overlay-in 0.25s ease-out;
}

.tscc-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 2147483646;
    display: flex;
    flex-direction: column;
    width: 480px;
    max-width: 100vw;
    background: var(--tscc-surface);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.15);
    color: var(--tscc-text);
    outline: none;
    animation: 0.25s ease-out both;
}

.tscc-drawer--left {
    left: 0;
    animation-name: tscc-from-left;
}

.tscc-drawer--right {
    right: 0;
    animation-name: tscc-from-right;
}

.tscc-drawer--inline-start {
    inset-inline-start: 0;
    animation-name: tscc-from-left;
}

.tscc-drawer--inline-end {
    inset-inline-end: 0;
    animation-name: tscc-from-right;
}

:host([dir="rtl"]) .tscc-drawer--inline-start {
    animation-name: tscc-from-right;
}

:host([dir="rtl"]) .tscc-drawer--inline-end {
    animation-name: tscc-from-left;
}

@keyframes tscc-from-left {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: none;
    }
}

@keyframes tscc-from-right {
    from {
        transform: translateX(100%);
    }

    to {
        transform: none;
    }
}

@keyframes tscc-overlay-in {
    from {
        opacity: 0;
    }
}

.tscc-drawer__header {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    padding: 12px 16px 0;
}

.tscc-close {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--tscc-text);
    cursor: pointer;
}

.tscc-close:hover {
    background: var(--tscc-expanded-bg);
}

.tscc-close:focus-visible {
    outline: 2px solid var(--tscc-accent);
    outline-offset: 2px;
}

.tscc-close svg {
    display: block;
    width: 24px;
    height: 24px;
}

.tscc-drawer__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 24px 24px;
    overscroll-behavior: contain;
}

.tscc-drawer__title {
    margin: 16px 0 12px;
    color: var(--tscc-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.tscc-intro {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.tscc-link {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tscc-accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: underline;
    cursor: pointer;
}

.tscc-link:focus-visible {
    outline: 2px solid var(--tscc-accent);
    outline-offset: 2px;
}

.tscc-allow-all {
    margin-top: 20px;
}

.tscc-heading {
    margin: 24px 0 12px;
    color: var(--tscc-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.tscc-accordion,
.tscc-cookies {
    margin: 0;
    padding: 0;
    border: 1px solid var(--tscc-border);
    border-radius: 4px;
    list-style: none;
}

.tscc-row + .tscc-row,
.tscc-cookie + .tscc-cookie {
    border-top: 1px solid var(--tscc-border);
}

.tscc-row__header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 49px;
    padding: 0 16px;
}

.tscc-row__toggle {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.tscc-row__toggle:focus-visible {
    outline: 2px solid var(--tscc-accent);
    outline-offset: 2px;
}

.tscc-row__icon {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--tscc-text);
}

.tscc-row__icon::before,
.tscc-row__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    margin: -1px 0 0 -6px;
    border-radius: 1px;
    background: currentColor;
}

.tscc-row__icon::after {
    transform: rotate(90deg);
}

.tscc-row__toggle[aria-expanded="true"] .tscc-row__icon {
    background: var(--tscc-border);
}

.tscc-row__toggle[aria-expanded="true"] .tscc-row__icon::after {
    display: none;
}

.tscc-row__title {
    color: var(--tscc-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.tscc-always {
    flex: 0 0 auto;
    color: var(--tscc-accent);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.tscc-row__panel {
    padding: 16px 24px;
    background: var(--tscc-expanded-bg);
    font-size: 14px;
    line-height: 1.7;
}

.tscc-row__description p {
    margin: 0 0 12px;
}

.tscc-row__description p:last-child {
    margin-bottom: 0;
}

.tscc-row__description ul {
    margin: 0 0 12px;
    padding-inline-start: 20px;
}

.tscc-row__description a {
    color: var(--tscc-accent);
}

/* ------------------------------------------------------------------ toggle switch */

.tscc-switch {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    width: 48px;
    height: 40px;
}

.tscc-switch__input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.tscc-switch__track {
    position: relative;
    display: block;
    width: 48px;
    height: 24px;
    border-radius: 24px;
    background: var(--tscc-toggle-off);
    transition: background-color 0.2s ease;
}

.tscc-switch__knob {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--tscc-text);
    transition: inset-inline-start 0.2s ease;
}

.tscc-switch__knob svg {
    display: block;
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tscc-switch__input:checked + .tscc-switch__track {
    background: var(--tscc-accent);
}

.tscc-switch__input:checked + .tscc-switch__track .tscc-switch__knob {
    inset-inline-start: 26px;
}

.tscc-switch__input:checked + .tscc-switch__track .tscc-switch__knob svg {
    opacity: 1;
}

.tscc-switch__input:focus-visible + .tscc-switch__track {
    outline: 2px solid var(--tscc-text);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ cookie list */

.tscc-back {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tscc-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tscc-back:focus-visible {
    outline: 2px solid var(--tscc-accent);
    outline-offset: 2px;
}

:host([dir="rtl"]) .tscc-back svg {
    transform: scaleX(-1);
}

.tscc-cookie {
    padding: 12px 16px;
}

.tscc-cookie dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 12px;
    margin: 0;
    font-size: 13px;
}

.tscc-cookie dt {
    font-weight: 700;
}

.tscc-cookie dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.tscc-drawer__footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    padding: 16px 24px;
    background: var(--tscc-surface);
}

/* ------------------------------------------------------------------ blocked iframe placeholder */

.tscc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    height: 100%;
    min-height: inherit;
    padding: 24px;
    background: var(--tscc-expanded-bg);
    text-align: center;
}

.tscc-placeholder__text {
    margin: 0;
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 600px) {
    .tscc-banner--bottom-start,
    .tscc-banner--bottom-end,
    .tscc-banner--bottom-center {
        left: 14px;
        right: 14px;
        width: auto;
        max-width: none;
        margin: 0;
    }

    .tscc-banner__actions {
        flex-direction: column;
    }

    .tscc-banner__actions .tscc-btn {
        width: 100%;
    }

    .tscc-drawer {
        width: 100vw;
    }
}

@media (max-width: 360px) {
    .tscc-banner__text,
    .tscc-banner__list {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
