/* ===================== CSS RESET — Isole les optins du thème ===================== */
/* Specificity: .ac-optin-content * = (0,1,0) — les classes des templates
   dans les <style> inline ont la meme specificite mais viennent APRES
   dans le source order, donc elles gagnent naturellement. */

.ac-optin-content {
    all: initial;
    display: block;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: normal;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ac-optin-content *,
.ac-optin-content *::before,
.ac-optin-content *::after {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.ac-optin-content * {
    margin: 0;
    padding: 0;
    border: 0;
    font: inherit;
    color: inherit;
    background: transparent;
    vertical-align: baseline;
    text-decoration: none;
    line-height: inherit;
    letter-spacing: normal;
    text-transform: none;
    word-spacing: normal;
    text-indent: 0;
    text-align: inherit;
    box-shadow: none;
    outline: none;
    list-style: none;
    border-radius: 0;
    float: none;
    clear: none;
    max-width: none;
    min-width: 0;
    max-height: none;
    min-height: 0;
    width: auto;
    height: auto;
    opacity: 1;
    visibility: visible;
    overflow: visible;
    position: static;
    transform: none;
    transition: none;
    animation: none;
}

/* ===================== POPUP STYLES ===================== */

.ac-optin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ac-optin-overlay.ac-visible {
    opacity: 1;
}

.ac-optin-popup {
    position: relative;
    max-width: 820px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.ac-optin-overlay.ac-visible .ac-optin-popup {
    transform: scale(1) translateY(0);
}

.ac-optin-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ac-optin-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ac-optin-content style {
    display: none;
}

/* Banner body push — desktop only */
body.ac-banner-active {
    padding-top: var(--ac-banner-h, 0px) !important;
    transition: padding-top 0.4s ease;
}

@media (max-width: 768px) {
    body.ac-banner-active {
        padding-top: 0 !important;
    }
}

/* ===================== BANNER STYLES ===================== */
/* Toujours position:fixed (dans wp_footer, hors du flow).
   Desktop: fixe en haut, JS ajoute padding-top au body.
   Mobile: fixe en bas, pas de padding. */

.ac-optin-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999998;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.ac-optin-banner.ac-visible {
    transform: translateY(0);
}

.ac-optin-banner-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.ac-optin-banner .ac-optin-content {
    width: 100%;
}

.ac-optin-banner-close {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: background 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.ac-optin-banner-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

@media (max-width: 768px) {
    .ac-optin-banner {
        top: auto;
        bottom: 0;
        transform: translateY(100%);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    }

    .ac-optin-banner.ac-visible {
        transform: translateY(0);
    }

    .ac-optin-banner-close {
        right: 8px;
        top: 8px;
        transform: none;
    }
}

/* ===================== SLIDE-IN STYLES ===================== */

.ac-optin-slidein {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999997;
    max-width: 360px;
    width: calc(100% - 40px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    transform: translateY(120%) scale(0.95);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.ac-optin-slidein.ac-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.ac-optin-slidein-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    color: #fff;
    z-index: 10;
    transition: background 0.2s;
    padding: 0;
}

.ac-optin-slidein-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 480px) {
    .ac-optin-slidein {
        bottom: 0;
        right: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 12px 12px 0 0;
    }
}
