/**
 * Copyright since 2026 Tissus En Ligne
 * AFL-3.0 — https://opensource.org/licenses/AFL-3.0
 *
 * Cookie banner styles. Accept and refuse buttons share the same size,
 * colours and visual weight on purpose (CNIL / AEPD: refusal must be as easy
 * as acceptance — no dark patterns).
 */

.telcookie-hidden {
    display: none !important;
}

/* ---- Layer 1: bottom information bar (page stays scrollable) ---- */

.telcookie-layer1 {
    width: 500px;
    /* Never wider than the viewport (minus both 10px side margins) — a fixed
       500px width was cropping the banner on mobile screens. */
    max-width: calc(100vw - 20px);
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 9998;
    background: #1f2937;
    color: #f9fafb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

.telcookie-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.telcookie-intro {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    max-width: 720px;
}

.telcookie-policy-link {
    color: #fde68a;
    text-decoration: underline;
}

.telcookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Buttons: accept and refuse strictly identical ---- */

.telcookie-btn {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    padding: 12px 20px;
    min-height: 44px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.telcookie-btn-accept,
.telcookie-btn-refuse {
    background: #ffffff;
    color: #111827;
    border: 2px solid #ffffff;
}

.telcookie-btn-accept:hover,
.telcookie-btn-refuse:hover {
    background: #e5e7eb;
}

.telcookie-btn-customize {
    background: transparent;
    color: #f9fafb;
    border: 2px solid transparent;
    text-decoration: underline;
}

.telcookie-btn-save {
    background: #f59e0b;
    color: #111827;
    border: 2px solid #f59e0b;
}

.telcookie-btn-save:hover {
    background: #d97706;
}

.telcookie-btn:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* ---- Layer 2: preferences dialog ---- */

.telcookie-layer2 {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(17, 24, 39, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.telcookie-panel {
    background: #ffffff;
    color: #111827;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.telcookie-panel-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.telcookie-panel-intro {
    margin: 0 0 16px;
    font-size: 14px;
    color: #4b5563;
}

.telcookie-categories {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.telcookie-category {
    border: 1px solid #e5e7eb;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.telcookie-category-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.telcookie-switch-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.telcookie-category-necessary .telcookie-switch-label {
    cursor: default;
}

.telcookie-category-name {
    font-weight: 600;
    font-size: 15px;
}

.telcookie-category-desc {
    font-size: 13px;
    color: #6b7280;
}

.telcookie-necessary-note {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    padding: 6px 10px;
    white-space: nowrap;
}

.telcookie-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #d1d5db;
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin: 0;
    flex-shrink: 0;
}

.telcookie-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.15s ease;
}

.telcookie-switch:checked {
    background: #059669;
}

.telcookie-switch:checked::after {
    transform: translateX(20px);
}

.telcookie-switch:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

.telcookie-services {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}

.telcookie-services-label {
    margin: 0 0 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.telcookie-services ul {
    margin: 0;
    padding-left: 18px;
}

.telcookie-panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---- Floating "Manage cookies" button ---- */

.telcookie-float {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9997;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #1f2937;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.telcookie-float:hover {
    background: #374151;
}

.telcookie-float:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

/* ---- Footer link ---- */

.telcookie-manage-link {
    text-decoration: underline;
    cursor: pointer;
}

/* ---- Responsive ---- */

@media (max-width: 767px) {
    .telcookie-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .telcookie-actions {
        flex-direction: column;
    }

    .telcookie-btn {
        width: 100%;
    }

    .telcookie-panel-actions {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .telcookie-btn,
    .telcookie-switch,
    .telcookie-switch::after {
        transition: none;
    }
}
