/* ============================================================
   Kimmo : bandeau cookies, pages legales, liens legaux du footer
   ============================================================ */

/* ---------- Bandeau compact en bas a gauche ---------- */
.kimmo-consent {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999999;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    color: #454e6d;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: inherit;
    animation: kimmoConsentIn 0.4s ease-out;
}
.kimmo-consent[hidden],
.kimmo-consent-modal[hidden] { display: none !important; }
@keyframes kimmoConsentIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.kimmo-consent__content { padding: 20px; }
.kimmo-consent__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.kimmo-consent__logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: contain;
}
.kimmo-consent__title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    color: #7a819a;
}
.kimmo-consent__title-big {
    display: block;
    margin-top: 2px;
    font-size: 22px;
    font-weight: 700;
    color: #454e6d;
}
.kimmo-consent__text {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #5b6280;
}
.kimmo-consent__buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.kimmo-consent__btn {
    flex: 1;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.kimmo-consent__btn--accept { background: #68bec5; color: #ffffff; }
.kimmo-consent__btn--accept:hover { background: #4fa4ab; }
.kimmo-consent__btn--reject { background: #454e6d; color: #ffffff; }
.kimmo-consent__btn--reject:hover { background: #363e59; }
.kimmo-consent__btn--settings {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    background: #f5f5f5;
    color: #454e6d;
    border-color: #e0e0e0;
}
.kimmo-consent__btn--settings:hover { background: #ebebeb; border-color: #d0d0d0; }
.kimmo-consent__btn:focus-visible { outline: 2px solid #454e6d; outline-offset: 2px; }
.kimmo-consent__link {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #4fa4ab;
    text-decoration: underline;
}
.kimmo-consent__link:hover { color: #454e6d; }

/* ---------- Fenetre de personnalisation ---------- */
html.kimmo-consent-open { overflow: hidden; }
.kimmo-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    animation: kimmoConsentFade 0.3s ease-out;
}
@keyframes kimmoConsentFade { from { opacity: 0; } to { opacity: 1; } }
.kimmo-consent-modal__content {
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    color: #454e6d;
    border-top: 4px solid #68bec5;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.kimmo-consent-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}
.kimmo-consent-modal__header h3 { margin: 0; font-size: 22px; font-weight: 700; color: #454e6d; }
.kimmo-consent-modal__close {
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(104, 190, 197, 0.15);
    color: #4fa4ab;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.kimmo-consent-modal__close:hover { background: #68bec5; color: #ffffff; transform: rotate(90deg); }
.kimmo-consent-modal__body { padding: 25px; }
.kimmo-consent-cat {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 10px;
    background: #f6f9fa;
    transition: background 0.3s ease;
}
.kimmo-consent-cat:last-child { margin-bottom: 0; }
.kimmo-consent-cat:hover { background: #eef4f5; }
.kimmo-consent-cat__info h4 { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: #454e6d; }
.kimmo-consent-cat__info p { margin: 0; font-size: 14px; line-height: 1.6; color: #5b6280; }
.kimmo-consent-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 55px;
    height: 30px;
}
.kimmo-consent-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.kimmo-consent-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    border-radius: 30px;
    background: #d0d0d0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: 0.4s;
}
.kimmo-consent-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    bottom: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: 0.4s;
}
.kimmo-consent-switch input:checked + .kimmo-consent-slider {
    background: linear-gradient(135deg, #68bec5 0%, #4fa4ab 100%);
    box-shadow: 0 0 10px rgba(104, 190, 197, 0.35);
}
.kimmo-consent-switch input:checked + .kimmo-consent-slider::before { transform: translateX(25px); }
.kimmo-consent-switch input:disabled + .kimmo-consent-slider { cursor: not-allowed; opacity: 0.5; }
.kimmo-consent-switch input:focus-visible + .kimmo-consent-slider { outline: 2px solid #454e6d; outline-offset: 2px; }
.kimmo-consent-modal__footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 25px;
    border-top: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
}
.kimmo-consent-modal__footer .kimmo-consent__btn { flex: 0 1 auto; padding: 16px 32px; font-size: 16px; }

@media (max-width: 768px) {
    .kimmo-consent {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        border: 0;
        border-top: 3px solid #68bec5;
        border-radius: 12px 12px 0 0;
    }
    .kimmo-consent__content { padding: 18px; }
    .kimmo-consent__logo { width: 35px; height: 35px; }
    .kimmo-consent__title { font-size: 13px; }
    .kimmo-consent__title-big { font-size: 20px; }
    .kimmo-consent__text { font-size: 12px; }
    .kimmo-consent__btn { font-size: 13px; padding: 9px 16px; }
    .kimmo-consent-cat { flex-direction: column; gap: 12px; }
    .kimmo-consent-modal { padding: 10px; }
    .kimmo-consent-modal__content { border-radius: 10px; }
    .kimmo-consent-modal__header,
    .kimmo-consent-modal__body,
    .kimmo-consent-modal__footer { padding: 18px; }
    .kimmo-consent-modal__header h3 { font-size: 19px; }
    .kimmo-consent-modal__footer { flex-direction: column; }
    .kimmo-consent-modal__footer .kimmo-consent__btn { padding: 14px 20px; font-size: 15px; }
}

/* ---------- Liens legaux du footer ---------- */
.kimmo-footer__legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.25rem;
    margin-top: 0.6rem;
}
.kimmo-footer__legal-links a,
.kimmo-footer__legal-links button {
    color: inherit;
    font: inherit;
    font-size: 0.85rem;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.kimmo-footer__legal-links a:hover,
.kimmo-footer__legal-links button:hover { text-decoration: underline; }

/* ---------- Lien confidentialite des cases de consentement ---------- */
.kimmo-consent-link { color: inherit; text-decoration: underline; white-space: nowrap; }

/* ---------- Pages legales ---------- */
.kimmo-legal {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
    color: var(--kimmo-secondary, #454e6d);
    font-size: 1rem;
    line-height: 1.7;
}
.kimmo-legal__updated { font-size: 0.85rem; opacity: 0.75; margin: 0 0 2rem; }
.kimmo-legal h2 { font-size: 1.3rem; margin: 2.5rem 0 0.75rem; }
.kimmo-legal h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.kimmo-legal p, .kimmo-legal ul { margin: 0 0 1rem; }
.kimmo-legal ul { padding-left: 1.25rem; }
.kimmo-legal li { margin-bottom: 0.35rem; }
.kimmo-legal a { color: inherit; text-decoration: underline; }
.kimmo-legal table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.9rem; }
.kimmo-legal th, .kimmo-legal td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--kimmo-border, #ececec); }
.kimmo-legal th { font-weight: 700; }
.kimmo-legal__table { overflow-x: auto; }
.kimmo-legal__btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    border: 0;
    background: var(--kimmo-secondary, #454e6d);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.kimmo-legal__btn:hover { background: var(--kimmo-primary, #68bec5); }
/* Passages a completer ou valider par le client (a retirer avant mise en ligne) */
.kimmo-todo { background: #fff3c4; padding: 0 0.2em; border-radius: 3px; }
/* Pages legales : meme largeur que les pages du site (.kpg-section, 1280px) au lieu des 720px du gabarit WordPress */
body.kimmo-legal-page main.is-layout-constrained > .wp-block-post-content { max-width: 1280px; }
body.kimmo-legal-page main.is-layout-constrained > .wp-block-post-title,
body.kimmo-legal-page .wp-block-post-title {
    max-width: 1280px;
    margin: 3rem auto 0.75rem;
    padding: 0 1.25rem;
    color: var(--kimmo-secondary, #454e6d);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
}

/* Fond de carte OpenStreetMap desature : rendu clair et epure (le marqueur reste en couleur) */
.leaflet-tile-pane .kimmo-map-tiles { filter: grayscale(1) brightness(1.06) contrast(0.92); }

/* Texte lu par les moteurs et lecteurs d'ecran, invisible a l'ecran (H1 de l'accueil) */
.kimmo-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
