/* ==========================================================================
   BApopup – front-end styles
   1. Classic rendering (popups that do not use the visual designer)
   2. Designer rendering (.bap-root)
   ========================================================================== */

:root {
    --ba-color1: #ff2d20;
    --ba-color2: #2d3748;
    --ba-color3: #2d3748;
    --ba-black: #000000;
    --ba-white: white;
}

/* 1. Classic ------------------------------------------------------------- */

.bapopup-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: none;
}

.bapopup-container {
    width: max-content;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    margin: auto;
    height: fit-content;
    z-index: 1000000;
    overflow-y: auto;
}

.bapopup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    text-align: center;
    cursor: pointer;
    font-size: 24px;
    color: var(--ba-color1);
    background: var(--ba-color2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    transition: all 0.3s ease;
}

.bapopup-close:hover {
    background: #e0e0e0;
    color: var(--ba-color3);
}

.bapopup-container.ba_white { height: max-content; }

.ba_white {
    background-color: var(--ba-white);
    padding: 20px;
}

.bapopup-container .elementor {
    width: 100%;
    margin: 0;
    max-width: calc(100vw - 20px);
}

.bapopup-age-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    margin: 10px 0;
}

.bapopup-age-confirm:hover { opacity: 0.9; }

@media (max-width: 420px) {
    .bapopup-container { width: calc(100% - 20px); }
}

/* 2. Designer rendering -------------------------------------------------- */

.bap-root {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    padding: var(--bap-margin);
    box-sizing: border-box;
    container-type: size; /* cqi + cqh: sizes in % of the screen (or of the preview device) */
    container-name: bap;
    font-family: var(--bap-font);
    color: var(--bap-text);
    -webkit-font-smoothing: antialiased;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s linear var(--bap-dur);
}

.bap-root.is-open {
    visibility: visible;
    transition-delay: 0s;
}

.bap-root *,
.bap-root *::before,
.bap-root *::after { box-sizing: border-box; }

.bap-root.bap-is-preview { position: absolute; }

/* Positions */
.bap-pos-center       { align-items: center;     justify-content: center; }
.bap-pos-top          { align-items: flex-start; justify-content: center; }
.bap-pos-bottom       { align-items: flex-end;   justify-content: center; }
.bap-pos-top-left     { align-items: flex-start; justify-content: flex-start; }
.bap-pos-top-right    { align-items: flex-start; justify-content: flex-end; }
.bap-pos-bottom-left  { align-items: flex-end;   justify-content: flex-start; }
.bap-pos-bottom-right { align-items: flex-end;   justify-content: flex-end; }

/* Overlay */
.bap-overlay {
    position: absolute;
    inset: 0;
    background: var(--bap-ov);
    -webkit-backdrop-filter: blur(var(--bap-ov-blur));
    backdrop-filter: blur(var(--bap-ov-blur));
    opacity: 0;
    transition: opacity var(--bap-dur) ease;
}

.bap-root.is-open:not(.bap-no-overlay) .bap-overlay { pointer-events: auto; }
.bap-root.is-open .bap-overlay { opacity: 1; }
.bap-no-overlay .bap-overlay { display: none; }

/* Frame */
.bap-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    width: var(--bap-w);
    max-width: 100%;
    height: var(--bap-h);
    max-height: 100%;
    background: var(--bap-bg);
    border: var(--bap-border);
    border-radius: var(--bap-radius);
    box-shadow: var(--bap-shadow);
    text-align: var(--bap-align);
    pointer-events: auto;
    opacity: 0;
    transition: opacity var(--bap-dur) ease, transform var(--bap-dur) cubic-bezier(.2, .9, .3, 1.15);
}

.bap-root.is-open .bap-frame { opacity: 1; transform: none; }
.bap-frame:focus { outline: none; }

.bap-anim-none .bap-frame,
.bap-anim-none .bap-overlay { transition: none; }
.bap-anim-zoom .bap-frame        { transform: scale(.85); }
.bap-anim-slide-up .bap-frame    { transform: translateY(48px); }
.bap-anim-slide-down .bap-frame  { transform: translateY(-48px); }
.bap-anim-slide-left .bap-frame  { transform: translateX(48px); }
.bap-anim-slide-right .bap-frame { transform: translateX(-48px); }
.bap-anim-flip .bap-frame        { transform: perspective(900px) rotateX(-24deg); transform-origin: top center; }

.bap-inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden auto;
    border-radius: var(--bap-inner-radius);
}

.bap-body {
    display: flex;
    flex-direction: column;
    align-items: var(--bap-justify);
    justify-content: center;
    gap: var(--bap-gap);
    padding: var(--bap-pad);
    flex: 1 1 auto;
    min-width: 0;
}

/* Media */
.bap-media { flex: 0 0 auto; overflow: hidden; }
.bap-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: var(--bap-img-fit);
    margin: 0;
    border: 0;
    border-radius: 0;
}

.bap-img-top .bap-media { width: var(--bap-img-top-w, 100%); max-width: 100%; height: var(--bap-img-top); align-self: center; }
.bap-img-left .bap-inner  { flex-direction: row; }
.bap-img-right .bap-inner { flex-direction: row-reverse; }
.bap-img-left .bap-media,
.bap-img-right .bap-media { width: var(--bap-img-side); max-width: 100%; height: var(--bap-img-side-h, auto); align-self: stretch; }

/* Image behind the content */
.bap-img-background .bap-inner { position: relative; min-height: var(--bap-img-top); }
.bap-img-background .bap-media--bg { position: absolute; inset: 0; z-index: 0; width: var(--bap-img-bg-w, 100%); max-width: 100%; height: auto; margin: 0 auto; }
.bap-img-background .bap-media--bg::after { content: ""; position: absolute; inset: 0; background: var(--bap-img-ov); }
.bap-img-background .bap-body { position: relative; z-index: 1; }

/* Popup made of an image only: the image takes the whole frame width. */
.bap-image-only.bap-img-left .bap-media,
.bap-image-only.bap-img-right .bap-media { flex: 1 1 auto; width: 100%; }
/* Background image without content: the image itself gives the popup its height (natural size, or the minimum height). */
.bap-image-only.bap-img-background .bap-media--bg { position: relative; inset: auto; flex: 1 1 auto; }

/* "Adapter l'image au cadre": the image takes the frame's width and height.
   Automatic frame height: the image keeps its proportions and gives the frame its height.
   Fixed frame height: the image fills the remaining height (cropped or whole, see "Recadrage"). */
.bap-img-fit-frame.bap-img-top .bap-media { width: 100%; height: auto; flex: 1 1 auto; min-height: 0; }
.bap-img-fit-frame.bap-img-top .bap-media img { height: 100%; }
.bap-h-auto.bap-img-fit-frame.bap-img-top .bap-media img { height: auto; }
.bap-img-fit-frame.bap-img-background .bap-inner { min-height: 0; }
.bap-img-fit-frame.bap-img-background .bap-media--bg { width: 100%; }
.bap-h-auto.bap-image-only.bap-img-fit-frame.bap-img-background .bap-media--bg img { height: auto; }

.bap-logo {
    display: block;
    width: var(--bap-img-inline);
    max-width: 100%;
    height: var(--bap-img-inline-h, auto);
    object-fit: contain;
    border-radius: var(--bap-img-radius);
    margin: 0;
}

/* Typography */
.bap-root .bap-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bap-badge-bg);
    color: var(--bap-badge-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.2;
}

.bap-root .bap-title {
    margin: 0;
    padding: 0;
    font-family: var(--bap-title-font);
    font-size: clamp(16px, 8cqi, var(--bap-title-size));
    font-weight: var(--bap-title-weight);
    color: var(--bap-title-color);
    line-height: 1.15;
    letter-spacing: -.01em;
    text-transform: none;
    text-align: var(--bap-align);
    border: 0;
    background: none;
}

.bap-root .bap-text {
    font-size: var(--bap-text-size);
    line-height: 1.6;
    color: var(--bap-msg-color, inherit);
    max-width: 100%;
}
.bap-root .bap-text p { margin: 0 0 .6em; }
.bap-root .bap-text p:last-child { margin-bottom: 0; }
.bap-root .bap-text a { color: inherit; text-decoration: underline; }

.bap-root .bap-footnote {
    margin: 0;
    font-size: .8em;
    color: var(--bap-foot-color, inherit);
    opacity: var(--bap-foot-opacity, .7);
}

.bap-root .bap-editor { width: 100%; text-align: initial; }
.bap-root .bap-editor .elementor { max-width: 100%; }

/* Buttons */
.bap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: var(--bap-justify);
    align-items: center;
    width: 100%;
}
.bap-actions-stacked { flex-direction: column; align-items: var(--bap-justify); }
.bap-actions-full .bap-btn { flex: 1 1 0; }
.bap-actions-stacked.bap-actions-full { align-items: stretch; }

.bap-root .bap-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: var(--bap-btn-py) var(--bap-btn-px);
    min-height: 0;
    width: auto;
    background: var(--bap-btn-bg);
    color: var(--bap-btn-color);
    border: var(--bap-btn-border);
    border-radius: var(--bap-btn-radius);
    font-family: var(--bap-btn-font);
    font-size: var(--bap-btn-size);
    font-weight: var(--bap-btn-weight);
    letter-spacing: var(--bap-btn-ls);
    text-transform: var(--bap-btn-transform);
    line-height: 1.2;
    text-decoration: none;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.bap-root .bap-btn:hover,
.bap-root .bap-btn:focus-visible {
    background: var(--bap-btn-hbg);
    color: var(--bap-btn-hcolor);
    text-decoration: none;
}

.bap-root .bap-btn:focus-visible { outline: 2px solid var(--bap-btn-bg); outline-offset: 3px; }

.bap-root .bap-fx-lift:hover   { transform: translateY(-2px); box-shadow: 0 12px 24px -10px var(--bap-btn-bg); }
.bap-root .bap-fx-grow:hover   { transform: scale(1.05); }
.bap-root .bap-fx-shadow:hover { box-shadow: 0 14px 30px -8px rgba(0, 0, 0, .4); }
.bap-root .bap-fx-pulse        { animation: bap-pulse 2s infinite; }
.bap-root .bap-fx-shine::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .5), transparent);
    transform: skewX(-20deg);
    transition: left .7s ease;
    pointer-events: none;
}
.bap-root .bap-fx-shine:hover::after { left: 130%; }

@keyframes bap-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bap-btn-bg) 55%, transparent); }
    70%  { box-shadow: 0 0 0 14px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.bap-root .bap-btn-sec-outline {
    background: transparent;
    color: var(--bap-btn-bg);
    box-shadow: inset 0 0 0 2px var(--bap-btn-bg);
}
.bap-root .bap-btn-sec-outline:hover { background: var(--bap-btn-bg); color: var(--bap-btn-color); }

.bap-root .bap-btn-sec-soft {
    background: color-mix(in srgb, var(--bap-btn-bg) 14%, transparent);
    color: var(--bap-btn-bg);
}
.bap-root .bap-btn-sec-soft:hover { background: color-mix(in srgb, var(--bap-btn-bg) 24%, transparent); color: var(--bap-btn-bg); }

.bap-root .bap-btn-sec-ghost {
    background: transparent;
    color: var(--bap-text);
}
.bap-root .bap-btn-sec-ghost:hover { background: color-mix(in srgb, var(--bap-text) 10%, transparent); color: var(--bap-text); }

.bap-root .bap-btn-sec-link {
    background: transparent;
    color: var(--bap-text);
    padding-left: 4px;
    padding-right: 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.bap-root .bap-btn-sec-link:hover { background: transparent; color: var(--bap-title-color); text-decoration: underline; }

/* Close button */
.bap-root .bap-close {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--bap-x-size);
    height: var(--bap-x-size);
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: var(--bap-x-bg);
    color: var(--bap-x-color);
    border: var(--bap-x-border);
    border-radius: 50%;
    font-size: var(--bap-x-icon);
    line-height: 1;
    box-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, opacity .3s ease;
}
.bap-root .bap-close:hover,
.bap-root .bap-close:focus-visible { background: var(--bap-x-hbg); color: var(--bap-x-hcolor); }
.bap-root .bap-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.bap-root .bap-close svg { width: var(--bap-x-icon); height: var(--bap-x-icon); display: block; }
.bap-root .bap-close-icon-text { width: auto; padding: 0 14px; font-size: var(--bap-x-icon); font-weight: 600; font-family: inherit; }

.bap-close-shape-rounded { border-radius: 30% !important; }
.bap-close-shape-square  { border-radius: 0 !important; }
.bap-close-icon-text.bap-close-shape-circle { border-radius: 999px !important; }

.bap-close-inside-right  { top: var(--bap-x-offset); right: var(--bap-x-offset); }
.bap-close-inside-left   { top: var(--bap-x-offset); left: var(--bap-x-offset); }
.bap-close-outside-right { bottom: calc(100% + var(--bap-x-offset) / 2); right: 0; }
.bap-close-outside-left  { bottom: calc(100% + var(--bap-x-offset) / 2); left: 0; }
.bap-close-corner-right  { top: 0; right: 0; transform: translate(40%, -40%); }
.bap-close-corner-left   { top: 0; left: 0; transform: translate(-40%, -40%); }

.bap-root .bap-close-delayed { opacity: 0; pointer-events: none; }

/* Modes */
.bap-mode-fullscreen { padding: 0; }
.bap-mode-fullscreen .bap-frame { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
.bap-mode-fullscreen .bap-inner { border-radius: 0; }
.bap-mode-fullscreen .bap-body { max-width: 760px; margin: 0 auto; width: 100%; }

.bap-mode-bar { padding: 0; }
.bap-mode-bar .bap-frame { width: 100%; height: auto; border-left: 0; border-right: 0; }
.bap-mode-bar .bap-body {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding-right: calc(var(--bap-pad) + var(--bap-x-size) + 12px);
}
.bap-mode-bar .bap-actions { width: auto; }
.bap-mode-bar .bap-close { top: 50%; transform: translateY(-50%); }
.bap-mode-bar.bap-pos-top .bap-frame { border-top: 0; }
.bap-mode-bar.bap-pos-bottom .bap-frame { border-bottom: 0; }

/* Frame and image sizes per device (set in the designer for Ordinateur / Tablette / Mobile). */
@container bap (max-width: 1024px) {
    .bap-frame {
        --bap-w: var(--bap-w--t);
        --bap-h: var(--bap-h--t);
        --bap-img-side: var(--bap-img-side--t);
        --bap-img-side-h: var(--bap-img-side-h--t);
        --bap-img-top-w: var(--bap-img-top-w--t);
        --bap-img-top: var(--bap-img-top--t);
        --bap-img-bg-w: var(--bap-img-bg-w--t);
        --bap-img-inline: var(--bap-img-inline--t);
        --bap-img-inline-h: var(--bap-img-inline-h--t);
    }
}
@container bap (max-width: 640px) {
    .bap-frame {
        --bap-w: var(--bap-w--m);
        --bap-h: var(--bap-h--m);
        --bap-img-side: var(--bap-img-side--m);
        --bap-img-side-h: var(--bap-img-side-h--m);
        --bap-img-top-w: var(--bap-img-top-w--m);
        --bap-img-top: var(--bap-img-top--m);
        --bap-img-bg-w: var(--bap-img-bg-w--m);
        --bap-img-inline: var(--bap-img-inline--m);
        --bap-img-inline-h: var(--bap-img-inline-h--m);
    }
}

/* Responsive (container = viewport on the site, preview stage in the designer) */
@container bap (max-width: 640px) {
    .bap-img-left .bap-inner,
    .bap-img-right .bap-inner { flex-direction: column; }
    .bap-img-hide-mobile .bap-media,
    .bap-img-hide-mobile .bap-logo { display: none; }
    .bap-body { padding: min(var(--bap-pad), 28px); }
    .bap-mode-bar .bap-body { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .bap-frame, .bap-overlay { transition-duration: 1ms !important; }
    .bap-root .bap-fx-pulse { animation: none; }
}

html.bap-locked, html.bap-locked body { overflow: hidden !important; }
