/* Cookie consent banner (js/cookie-consent.js). Uses the theme's tokens when the page has
   a theme stylesheet, with fallbacks for the pages that don't. "Refuser" and "Accepter"
   share one style on purpose: refusing must be as easy and as visible as accepting. */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    background: var(--white, #ffffff);
    color: var(--dark, #111111);
    border: 1px solid var(--border, #dddddd);
    border-radius: var(--radius, 16px);
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.15));
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.cookie-banner-text {
    flex: 1 1 320px;
    margin: 0;
}

.cookie-banner-text a {
    color: var(--primary, #333333);
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
}

.cookie-btn {
    min-width: 120px;
    padding: 12px 20px;
    border: 2px solid var(--primary, #333333);
    border-radius: var(--radius-sm, 10px);
    background: var(--primary, #333333);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.cookie-btn:hover {
    background: var(--primary-dark, #111111);
    border-color: var(--primary-dark, #111111);
}

.cookie-btn:focus-visible {
    outline: 3px solid var(--accent, #888888);
    outline-offset: 2px;
}

/* "Modifier mon choix" on cookies.php. */
.cookie-settings-btn {
    margin-top: 8px;
}

@media (max-width: 520px) {
    .cookie-banner-actions { width: 100%; }
    .cookie-btn { flex: 1; min-width: 0; }
}

/* cookies.php's table on a phone: four columns don't fit in 360 px (the table overflowed
   and the whole page scrolled sideways), so each cookie becomes a card, one line per
   column, labelled. ".legal-body" outweighs the page's own <style>, which comes later. */
@media (max-width: 600px) {
    .legal-body .cookie-table,
    .legal-body .cookie-table tbody,
    .legal-body .cookie-table tr,
    .legal-body .cookie-table td { display: block; width: 100%; }
    .legal-body .cookie-table thead { display: none; }
    .legal-body .cookie-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--border, #dddddd);
        border-radius: var(--radius-sm, 10px);
        overflow: hidden;
    }
    .legal-body .cookie-table td { border: none; border-bottom: 1px solid var(--border, #dddddd); }
    .legal-body .cookie-table td:last-child { border-bottom: none; }
    .legal-body .cookie-table td::before {
        display: block;
        font-weight: 600;
        color: var(--dark, #111111);
    }
    .legal-body .cookie-table td:nth-child(1)::before { content: "Nom"; }
    .legal-body .cookie-table td:nth-child(2)::before { content: "Type"; }
    .legal-body .cookie-table td:nth-child(3)::before { content: "Durée"; }
    .legal-body .cookie-table td:nth-child(4)::before { content: "Finalité"; }
    .legal-body .cookie-table code { overflow-wrap: anywhere; }
}
