/* ═══════════════════════════════════════════════════════════════════
   AXIAN Group — Cookie Consent
   Modal centré · Carte blanche · Cookie illustration droite
   ═══════════════════════════════════════════════════════════════════ */


/* ── Variables ── */
#axian-cookie-banner {
    --cc-bg:              #ffffff;
    --cc-border:          rgba(0, 0, 0, 0.10);
    --cc-text:            #111827;
    --cc-text-muted:      #6b7280;
    --cc-text-dim:        #9ca3af;
    --cc-separator:       rgba(0, 0, 0, 0.08);
    --cc-btn-dark:        #111827;
    --cc-btn-dark-hover:  #1f2937;
    --cc-btn-soft:        #f3f4f6;
    --cc-btn-soft-hover:  #e5e7eb;
    --cc-red:             #d6254f;
    --cc-pad:             1.75rem;
    --cc-radius:          20px;
}


/* ── Overlay plein écran ── */
#axian-cookie-banner {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#axian-cookie-banner.axian-visible {
    display: flex;
    animation: ccOverlayIn 0.3s ease forwards;
}

@keyframes ccOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* ── Carte blanche ── */
.axian-bar-inner {
    background: var(--cc-bg);
    border-radius: var(--cc-radius);
    border: 1.5px solid var(--cc-border);
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.14),
        0  8px 24px rgba(0, 0, 0, 0.06);
    position: relative;
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

#axian-cookie-banner.axian-visible .axian-bar-inner {
    animation: ccCardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ccCardIn {
    from { opacity: 0; transform: scale(0.93) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}


/* ── Bouton fermer (X) — coin supérieur droit ── */
.axian-btn-close {
    position: absolute;
    top: 1.125rem;
    right: 1.125rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--cc-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10;
    padding: 0;
    flex-shrink: 0;
}

.axian-btn-close:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--cc-text);
}


/* ── Zone principale : contenu gauche + cookie droite ── */
.axian-bar-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: var(--cc-pad);
    padding-top: calc(var(--cc-pad) + 0.25rem);
    padding-right: 1.5rem;
}


/* ── Contenu gauche ── */
.axian-bar-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.axian-bar-title {
    font-family: roboto_black, 'Arial Black', sans-serif;
    font-size: 1.625rem;
    font-weight: 900;
    color: var(--cc-red);
    line-height: 1.15;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: block;
}

.axian-bar-desc {
    font-family: roboto_light, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    color: var(--cc-text-muted);
    line-height: 1.68;
    margin: 0;
}


/* ── Illustration cookie — masquée ── */
.axian-bar-cookie-icon {
    display: none;
}

/* Rétro-compat shield */
.axian-bar-shield {
    display: none;
}


/* ── Panneau catégories (expansion vers le bas) ── */
.axian-bar-categories-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.axian-bar-categories-wrap.axian-open {
    max-height: 340px;
}

.axian-categories-inner {
    padding: 0 var(--cc-pad) 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--cc-separator);
}

.axian-consent-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--cc-separator);
}

.axian-consent-category:last-child {
    border-bottom: none;
}

.axian-category-num {
    font-family: roboto_black, 'Arial Black', sans-serif;
    font-size: 0.875rem;
    color: var(--cc-red);
    flex-shrink: 0;
    letter-spacing: 0.05em;
    align-self: center;
    min-width: 1.5rem;
}

.axian-category-info {
    flex: 1;
    min-width: 0;
}

.axian-category-name {
    font-family: roboto_medium, sans-serif;
    font-size: 0.8125rem;
    color: var(--cc-text);
    display: block;
    margin-bottom: 0.15rem;
}

.axian-category-desc {
    font-family: roboto_light, sans-serif;
    font-size: 0.6875rem;
    color: var(--cc-text-dim);
    margin: 0;
    line-height: 1.45;
}

.axian-badge-required {
    font-family: roboto_medium, sans-serif;
    font-size: 0.475rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cc-text-dim);
    border: 1px solid rgba(0, 0, 0, 0.14);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}


/* ── Actions principales ── */
#axian-main-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
}

#axian-customize-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
}

#axian-btn-save { flex: 1; }


/* ── Boutons ── */
.axian-btn {
    font-family: roboto_medium, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8125rem;
    padding: 0.6875rem 1.375rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    transition:
        background   0.2s ease,
        color        0.2s ease,
        border-color 0.2s ease,
        transform    0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.axian-btn:active { transform: scale(0.975); }

/* Primaire — rouge cerise */
.axian-btn-primary {
    background: var(--cc-red);
    color: #ffffff;
    border-color: var(--cc-red);
}

.axian-btn-primary:hover {
    background: #b81e42;
    border-color: #b81e42;
}

/* Secondaire — gris clair */
.axian-btn-outline {
    background: var(--cc-btn-soft);
    color: var(--cc-text);
    border-color: transparent;
}

.axian-btn-outline:hover {
    background: var(--cc-btn-soft-hover);
}

/* Ghost */
.axian-btn-ghost {
    background: transparent;
    color: var(--cc-text-dim);
    border-color: transparent;
    font-family: roboto_light, sans-serif;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 0, 0, 0.18);
}

.axian-btn-ghost:hover { color: var(--cc-text-muted); }


/* ── Toggle switch ── */
.axian-toggle {
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 23px;
    flex-shrink: 0;
}

.axian-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.axian-toggle-slider {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    border-radius: 23px;
    cursor: pointer;
    transition: background 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.axian-toggle-slider::before {
    content: '';
    position: absolute;
    height: 17px;
    width: 17px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.axian-toggle input:checked + .axian-toggle-slider {
    background: var(--cc-red);
    border-color: var(--cc-red);
}

.axian-toggle input:checked + .axian-toggle-slider::before {
    transform: translateX(17px);
}

.axian-toggle input:focus-visible + .axian-toggle-slider {
    outline: 2px solid rgba(214, 37, 79, 0.4);
    outline-offset: 2px;
}


/* ── Lien footer ── */
a.axian-manage-cookies {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: inherit;
}


/* ══════════════════════════════════════════════════
   RESPONSIVE — mobile < 600px
   Bottom sheet : layout colonne, cookie masqué
   ══════════════════════════════════════════════════ */
@media (max-width: 599px) {

    #axian-cookie-banner {
        align-items: flex-end;
        padding: 0;
        background: rgba(0, 0, 0, 0.4);
    }

    .axian-bar-inner {
        border-radius: 20px 20px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        max-width: 100%;
    }

    #axian-cookie-banner.axian-visible .axian-bar-inner {
        animation: ccCardInMobile 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes ccCardInMobile {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0);    }
    }

    /* Colonne : texte + boutons empilés, pas de cookie à côté */
    .axian-bar-main {
        flex-direction: column;
        padding: 1.5rem 1.25rem 1.25rem;
        gap: 0.875rem;
        align-items: stretch;
    }

    /* Masquer le cookie — évite le chevauchement avec le bouton X */
    .axian-bar-cookie-icon {
        display: none;
    }

    /* Laisser de la place pour le bouton X en haut à droite */
    .axian-bar-title {
        padding-right: 2.25rem;
    }

    .axian-categories-inner {
        padding: 0 1.25rem 1.25rem;
    }

    .axian-bar-categories-wrap.axian-open {
        max-height: 480px;
    }

    #axian-main-actions {
        flex-direction: row;
        align-items: stretch;
    }

    #axian-main-actions .axian-btn {
        flex: 1;
    }

    #axian-customize-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #axian-btn-save { flex: none; width: 100%; }
}


/* ══════════════════════════════════════════════════
   RESPONSIVE — très petit mobile < 380px
   ══════════════════════════════════════════════════ */
@media (max-width: 380px) {

    .axian-bar-title   { font-size: 1.1875rem; }
    .axian-bar-desc    { font-size: 0.75rem; }

    .axian-btn {
        font-size: 0.75rem;
        padding: 0.5625rem 1rem;
    }
}
