/* =========================================================
   TAWLÉ — COOKIE CONSENT UI

   Self-contained styles for the consent banner, preferences
   dialog and footer links. Brand variables are referenced with
   literal fallbacks so the widget looks correct even on the few
   pages that do not load global.css.
========================================================= */

.tcc-banner,
.tcc-overlay,
.tcc-footer-link {
    --tcc-charcoal: var(--charcoal, #221f20);
    --tcc-off-white: var(--off-white, #fffdee);
    --tcc-coral: var(--coral, #ff8661);
    --tcc-yellow: var(--yellow, #ffca5f);
    --tcc-blue: var(--blue, #6bb4fc);
    --tcc-lilac: var(--lilac, #cccced);
    --tcc-border: rgba(34, 31, 32, 0.14);
    --tcc-font: "Overused Grotesk", Arial, sans-serif;
}

html[lang="ar"] .tcc-banner,
html[lang="ar"] .tcc-overlay {
    --tcc-font: "Noto Sans Arabic", Arial, sans-serif;
}


/* =========================================================
   BANNER
========================================================= */
.tcc-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 2147483000;

    display: none;
    padding: clamp(16px, 2.4vw, 26px);

    font-family: var(--tcc-font);
    color: var(--tcc-charcoal);

    transform: translateY(16px);
    opacity: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.tcc-banner--visible {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.tcc-banner__inner {
    max-width: 1180px;
    margin: 0 auto;

    background-color: var(--tcc-off-white);
    border: 1.5px solid var(--tcc-charcoal);
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(34, 31, 32, 0.22);

    padding: clamp(18px, 2.4vw, 28px);

    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title   actions"
        "body    actions"
        "policy  actions";
    column-gap: 28px;
    row-gap: 6px;
    align-items: start;
}

.tcc-banner__title {
    grid-area: title;
    font-size: 1.12rem;
    font-weight: 700;
}

.tcc-banner__body {
    grid-area: body;
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 62ch;
}

.tcc-banner__policy {
    grid-area: policy;
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tcc-charcoal);
    text-decoration: underline;
    text-underline-offset: 3px;
    width: fit-content;
}

.tcc-banner__policy:hover {
    color: var(--tcc-coral);
}

.tcc-banner__actions {
    grid-area: actions;
    align-self: center;

    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 190px;
}


/* =========================================================
   BUTTONS (equal weight — no dark patterns)
========================================================= */
.tcc-btn {
    font-family: var(--tcc-font);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;

    padding: 13px 20px;
    border-radius: 999px;
    border: 1.5px solid var(--tcc-charcoal);

    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.12s ease, background-color 0.18s ease, color 0.18s ease;
}

.tcc-btn:hover { transform: translateY(-1px); }
.tcc-btn:active { transform: translateY(0); }

.tcc-btn--primary {
    background-color: var(--tcc-charcoal);
    color: var(--tcc-off-white);
}
.tcc-btn--primary:hover {
    background-color: var(--tcc-coral);
    border-color: var(--tcc-coral);
    color: var(--tcc-charcoal);
}

.tcc-btn--secondary {
    background-color: transparent;
    color: var(--tcc-charcoal);
}
.tcc-btn--secondary:hover {
    background-color: var(--tcc-charcoal);
    color: var(--tcc-off-white);
}

.tcc-btn--ghost {
    background-color: transparent;
    color: var(--tcc-charcoal);
    border-color: var(--tcc-border);
}
.tcc-btn--ghost:hover {
    border-color: var(--tcc-charcoal);
    background-color: rgba(34, 31, 32, 0.05);
}

.tcc-btn:focus-visible,
.tcc-banner__policy:focus-visible,
.tcc-footer-link:focus-visible,
.tcc-toggle__input:focus-visible + .tcc-toggle__track {
    outline: 3px solid var(--tcc-blue);
    outline-offset: 2px;
}


/* =========================================================
   PREFERENCES DIALOG
========================================================= */
.tcc-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483001;

    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;

    background-color: rgba(34, 31, 32, 0.55);
    font-family: var(--tcc-font);
    color: var(--tcc-charcoal);
}

.tcc-overlay--visible {
    display: flex;
}

.tcc-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    background-color: var(--tcc-off-white);
    border: 1.5px solid var(--tcc-charcoal);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(34, 31, 32, 0.3);

    padding: clamp(22px, 3vw, 34px);
}

.tcc-modal__close {
    position: absolute;
    top: 14px;
    inset-inline-end: 16px;

    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;

    font-size: 1.7rem;
    line-height: 1;
    color: var(--tcc-charcoal);
    cursor: pointer;
}
.tcc-modal__close:hover { background-color: rgba(34, 31, 32, 0.08); }

.tcc-modal__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    padding-inline-end: 34px;
}

.tcc-modal__intro {
    font-size: 0.93rem;
    line-height: 1.55;
    margin-bottom: 20px;
}

.tcc-modal__cats {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tcc-cat {
    border: 1px solid var(--tcc-border);
    border-radius: 14px;
    padding: 16px 18px;
}

.tcc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
}

.tcc-cat__title {
    font-size: 1rem;
    font-weight: 700;
}

.tcc-cat__desc {
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(34, 31, 32, 0.82);
}

.tcc-pill {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: var(--tcc-mint, #bce2d0);
    color: var(--tcc-charcoal);
    white-space: nowrap;
}

.tcc-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}
.tcc-modal__actions .tcc-btn { flex: 1 1 auto; }


/* =========================================================
   TOGGLE
========================================================= */
.tcc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.tcc-toggle__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.tcc-toggle__track {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background-color: rgba(34, 31, 32, 0.25);
    transition: background-color 0.2s ease;
    flex: none;
}

.tcc-toggle__track::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--tcc-off-white);
    transition: transform 0.2s ease;
}

.tcc-toggle__input:checked + .tcc-toggle__track {
    background-color: var(--tcc-coral);
}
.tcc-toggle__input:checked + .tcc-toggle__track::after {
    transform: translateX(20px);
}
html[lang="ar"] .tcc-toggle__input:checked + .tcc-toggle__track::after {
    transform: translateX(-20px);
}

.tcc-toggle__state {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 2.4em;
}


/* =========================================================
   FOOTER LINKS (match the surrounding footer anchors)
========================================================= */
.tcc-footer-link {
    cursor: pointer;
}


/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 720px) {
    .tcc-banner__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "body"
            "policy"
            "actions";
        row-gap: 10px;
    }

    .tcc-banner__actions {
        flex-direction: column;
        min-width: 0;
        margin-top: 6px;
    }
    .tcc-banner__actions .tcc-btn { width: 100%; }

    .tcc-modal__actions { flex-direction: column; }
    .tcc-modal__actions .tcc-btn { width: 100%; }
}


/* =========================================================
   MOTION PREFERENCE
========================================================= */
@media (prefers-reduced-motion: reduce) {
    .tcc-banner,
    .tcc-btn,
    .tcc-toggle__track,
    .tcc-toggle__track::after {
        transition: none;
    }
}
