/**
 * LumaCookies - Consentement aux cookies RGPD / CNIL
 *
 * @author    PrestaLuma
 * @copyright 2026 PrestaLuma
 * @license   Licence commerciale - Tous droits réservés
 *
 * Ce fichier fait partie du module "lumacookies" édité par PrestaLuma.
 * Toute reproduction, distribution ou modification non autorisée est interdite.
 *
 * Compatibilité : PrestaShop 1.7.8 à 9.x - PHP 7.2 à 8.3.
 */
/**
 * LumaCookies – styles de la bannière de consentement.
 * Les couleurs viennent du BO via les variables CSS --lc-bg / --lc-text /
 * --lc-accent posées en attribut style sur #lumacookies-banner.
 */

.lumacookies-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 2147483000; /* au-dessus de tout, y compris les menus du thème */
    font-size: 0.9375rem;
    line-height: 1.5;
}

.lumacookies-banner[hidden] {
    display: none !important;
}

/* --- Les 3 positions configurables --- */

.lumacookies-banner--bottom {
    bottom: 0;
}

.lumacookies-banner--top {
    top: 0;
}

/* Version centrée : le conteneur devient un voile plein écran. */
.lumacookies-banner--center {
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 18, 30, 0.55);
}

/* --- La boîte elle-même --- */

.lumacookies-banner__inner {
    background: var(--lc-bg, #111827);
    color: var(--lc-text, #f9fafb);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.lumacookies-banner--bottom .lumacookies-banner__inner {
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
}

.lumacookies-banner--top .lumacookies-banner__inner {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.lumacookies-banner--center .lumacookies-banner__inner {
    display: block;
    max-width: 560px;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.lumacookies-banner__text {
    flex: 1 1 320px;
}

.lumacookies-banner__text p {
    margin: 0;
    color: inherit;
}

.lumacookies-banner__title {
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 0.25rem !important;
}

/* --- Boutons --- */

.lumacookies-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.lumacookies-banner--center .lumacookies-banner__actions {
    margin-top: 1.25rem;
}

.lumacookies-btn {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0.625rem 1.125rem;
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: opacity 0.15s ease;
}

.lumacookies-btn:hover {
    opacity: 0.85;
}

/* Accessibilité : contour visible à la navigation clavier. */
.lumacookies-btn:focus-visible {
    outline: 3px solid var(--lc-accent, #6366f1);
    outline-offset: 2px;
}

/* « Tout accepter » et « Tout refuser » : même mise en avant (exigence CNIL). */
.lumacookies-btn--primary {
    background: var(--lc-accent, #6366f1);
    color: #ffffff;
}

.lumacookies-btn--ghost {
    background: transparent;
    color: var(--lc-text, #f9fafb);
    border-color: currentColor;
}

/* ==================================================================== */
/* Centre de préférences (modal)                                        */
/* ==================================================================== */

.lumacookies-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483001; /* au-dessus de la bannière */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.lumacookies-modal[hidden] {
    display: none !important;
}

.lumacookies-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 18, 30, 0.6);
}

.lumacookies-modal__box {
    position: relative;
    background: var(--lc-bg, #111827);
    color: var(--lc-text, #f9fafb);
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.lumacookies-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lumacookies-modal__title {
    font-weight: 700;
    font-size: 1.0625rem;
    margin: 0 !important;
}

.lumacookies-modal__close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.lumacookies-modal__close:focus-visible {
    outline: 3px solid var(--lc-accent, #6366f1);
    outline-offset: 2px;
}

.lumacookies-modal__body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
}

.lumacookies-modal__intro {
    margin: 0 0 1rem;
}

/* --- Une catégorie --- */

.lumacookies-cat {
    padding: 0.875rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.lumacookies-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lumacookies-cat__name {
    font-weight: 700;
}

.lumacookies-cat__locked {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--lc-accent, #6366f1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}

.lumacookies-cat__desc {
    margin: 0.375rem 0 0 !important;
    opacity: 0.85;
    color: inherit;
}

/* --- Détail des cookies (dépliable) --- */

.lumacookies-cat__cookies {
    margin-top: 0.5rem;
}

.lumacookies-cat__cookies summary {
    cursor: pointer;
    font-size: 0.875rem;
    opacity: 0.85;
}

.lumacookies-table {
    width: 100%;
    margin-top: 0.5rem;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.lumacookies-table th,
.lumacookies-table td {
    padding: 0.375rem 0.5rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: inherit;
    background: transparent;
}

/* --- Interrupteurs (toggles) --- */

.lumacookies-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
    margin: 0;
}

.lumacookies-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.lumacookies-switch__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 13px;
    transition: background 0.15s ease;
    pointer-events: none;
}

.lumacookies-switch__slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    top: 3px;
    left: 3px;
    transition: transform 0.15s ease;
}

.lumacookies-switch input:checked + .lumacookies-switch__slider {
    background: var(--lc-accent, #6366f1);
}

.lumacookies-switch input:checked + .lumacookies-switch__slider::before {
    transform: translateX(20px);
}

.lumacookies-switch input:focus-visible + .lumacookies-switch__slider {
    outline: 3px solid var(--lc-accent, #6366f1);
    outline-offset: 2px;
}

.lumacookies-modal__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* --- Mobile : boutons empilés pleine largeur --- */

@media (max-width: 576px) {
    .lumacookies-banner__actions,
    .lumacookies-modal__footer {
        width: 100%;
        flex-direction: column;
    }

    .lumacookies-btn {
        width: 100%;
    }

    .lumacookies-table thead {
        display: none;
    }

    .lumacookies-table td {
        display: block;
    }
}

/* ==================================================================== */
/* Page cookies publique (rendue dans le thème, fond clair)             */
/* ==================================================================== */

.lumacookies-page__intro {
    margin-bottom: 1.5rem;
}

.lumacookies-page__subtitle {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.lumacookies-page__cat {
    margin-top: 2rem;
}

.lumacookies-page__desc {
    margin-bottom: 0.75rem;
}

.lumacookies-page__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.lumacookies-page__consent {
    margin-bottom: 1.5rem;
}

.lumacookies-status__list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.lumacookies-status__list li {
    padding: 0.15rem 0;
}

.lumacookies-status__list .is-on {
    color: #16a34a;
}

.lumacookies-status__list .is-off {
    color: #dc2626;
}

.lumacookies-page__actions {
    margin-top: 1rem;
    margin-bottom: 0;
}

/* ==================================================================== */
/* Lien permanent dans le pied de page                                  */
/* ==================================================================== */

.lumacookies-footer-links {
    padding: 0.75rem 0;
    text-align: center;
    font-size: 0.875rem;
}

/* Espacement entre les deux boutons du pied de page. */
.lumacookies-footer-btn {
    margin: 0.25rem 0.35rem;
}

/* Le lien <a> hérite sinon de la couleur de lien du thème : on force la même
   couleur de texte que le <button> (texte blanc du bouton primaire) et on
   retire le soulignement, pour que les deux boutons soient identiques. */
.lumacookies-footer-links a.lumacookies-footer-btn,
.lumacookies-footer-links a.lumacookies-footer-btn:hover,
.lumacookies-footer-links a.lumacookies-footer-btn:focus,
.lumacookies-footer-links a.lumacookies-footer-btn:active {
    color: #fff;
    text-decoration: none;
}

/* Bouton « Gérer mes cookies » rendu visuellement comme un lien
   (utilisé par les placeholders d'iframes). */
.lumacookies-link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
}

/* --- Placement « footer » : liens texte intégrés au pied de page.
   On laisse le thème colorer les <a> (ils héritent du style natif des liens
   du footer) ; on retire seulement les puces de la liste et le soulignement. */
/* Filet de sécurité pour le titre si le thème ne le stylise pas. */
.lumacookies-footer-title {
    margin-bottom: 0.6rem;
}

.lumacookies-footer-textlinks ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lumacookies-footer-textlinks li {
    margin: 0;
}

a.lumacookies-textlink,
a.lumacookies-textlink:hover,
a.lumacookies-textlink:focus {
    text-decoration: none;
}

/* Chevron d'accordéon : masqué sur desktop (la liste est toujours visible). */
.lumacookies-footer-chevron {
    display: none;
}

/* Sur mobile, le bloc se replie comme les autres colonnes du pied de page :
   le titre devient un bouton, le chevron apparaît, la liste est masquée
   jusqu'à l'ouverture (classe .is-open ajoutée au clic par le JS).
   Le chevron est dessiné en CSS (bordures) pour s'afficher sur tous les thèmes
   sans dépendre d'une police d'icônes. */
/* Sur classic, la classe « .links » rend notre bloc « display:flex », ce qui
   empêche le titre d'occuper toute la largeur et envoie le chevron au bord.
   On remet le bloc en « block » (ciblé classic via .footer-container, donc
   sans effet sur Hummingbird/prestaluma). */
.footer-container .lumacookies-footer-textlinks {
    display: block;
    /* Espace au-dessus de la colonne Cookies (classic) pour ne pas coller
       au bloc précédent. */
    margin-top: 20px;
}

@media (max-width: 767px) {
    .lumacookies-footer-textlinks .lumacookies-footer-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        margin-bottom: 0;
    }

    /* Sur classic, le décalage du titre vient de « .links .title » (padding
       + bordure) que notre <p> ne porte pas → sans lui, le titre et le chevron
       collent aux bords. On reproduit ce décalage, ciblé sur classic via
       .footer-container (Hummingbird/prestaluma utilise .footer__main, donc
       n'est PAS affecté et garde son rendu actuel). */
    .footer-container .lumacookies-footer-title {
        padding: 0.625rem;
        border-bottom: 1px solid #f6f6f6;
    }

    .lumacookies-footer-chevron {
        display: inline-block;
        flex: 0 0 auto;
        width: 9px;
        height: 9px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg); /* pointe vers le bas */
        transition: transform 0.2s ease;
        /* Décalage par défaut (Hummingbird/PS9) : l'icône native material-icons
           est calée à droite (centre ~7px à l'intérieur du bord). On recentre
           notre chevron sur ce centre. Classic réajuste ce décalage ci-dessous. */
        margin-right: 0.5rem;
    }

    /* Sur classic, l'icône native est calée à GAUCHE dans sa boîte flottante :
       son centre tombe ~19px à l'intérieur du bord droit (bien plus que sur
       Hummingbird). On augmente le décalage pour aligner notre chevron sur le
       centre des chevrons natifs. Ciblé classic via .footer-container. */
    .footer-container .lumacookies-footer-chevron {
        margin-right: 1.2rem;
    }

    .lumacookies-footer-textlinks.is-open .lumacookies-footer-chevron {
        transform: rotate(225deg); /* pointe vers le haut */
    }

    /* Les liens s'alignent sur le titre (pas d'indentation supplémentaire). */
    .lumacookies-footer-list {
        display: none !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    /* !important : force l'ouverture même si le thème (Hummingbird) impose
       sa propre règle d'affichage sur .footer-block__list. */
    .lumacookies-footer-textlinks.is-open .lumacookies-footer-list {
        display: block !important;
        padding-top: 0.5rem;
    }
}

/* --- Placement « floating » : pastille flottante dans un coin --- */
.lumacookies-floating {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 2147482000; /* sous la bannière et le modal */
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border: none;
    border-radius: 999px;
    background: var(--lc-accent, #6366f1);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: opacity 0.15s ease;
    /* Certains thèmes (Hummingbird) imposent width:100% aux <button> :
       on force la pastille à s'adapter à son contenu. */
    width: auto !important;
    max-width: calc(100vw - 32px);
}

.lumacookies-floating:hover {
    opacity: 0.9;
}

.lumacookies-floating:focus-visible {
    outline: 3px solid var(--lc-accent, #6366f1);
    outline-offset: 2px;
}

.lumacookies-floating__icon {
    font-size: 1.05rem;
}

/* ==================================================================== */
/* Placeholder des iframes tierces bloquées                             */
/* ==================================================================== */

.lumacookies-iframe-ph {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 200px;
    padding: 1.5rem;
    text-align: center;
    background: #f3f4f6;
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    color: #374151;
}

.lumacookies-iframe-ph__text {
    margin: 0;
    max-width: 36rem;
}

.lumacookies-iframe-ph__manage {
    font-size: 0.875rem;
}
