/* Abeille3D — Alertes : styles front des 4 types (barre, popup, toast, plein écran).
   Tout est piloté par des variables --a3da-* posées par alerte (cf. a3da_style_inline_css).
   Préfixe .a3da pour ne rien casser dans le thème (Divi). La police est héritée du thème. */

.a3da, .a3da * { box-sizing: border-box; }

.a3da {
  --a3da-z: 100000;
  font-family: inherit;
  color: var(--a3da-text, #1f2937);
  font-size: var(--a3da-fs, 16px);
  line-height: 1.45;
}

/* Bloc interne commun (icône + corps + CTA + fermer) */
.a3da-inner, .a3da-modal {
  display: flex;
  align-items: var(--a3da-valign, center);
  gap: var(--a3da-gap, 14px);
}
.a3da-icon { font-size: 1.5em; line-height: 1; flex: 0 0 auto; color: var(--a3da-accent, #f5a623); }
/* Alignement / taille fins (barre & toast ; les modales gardent leur mise en page centrée) */
.a3da-bar .a3da-icon, .a3da-toast .a3da-icon { align-self: var(--a3da-icon-align, auto); font-size: var(--a3da-icon-size, 1.5em); }
/* Alignement vertical de la croix — mode INLINE (align-self) */
.a3da-bar.a3da-cv-top .a3da-close, .a3da-toast.a3da-cv-top .a3da-close { align-self: flex-start; }
.a3da-bar.a3da-cv-middle .a3da-close, .a3da-toast.a3da-cv-middle .a3da-close { align-self: center; }
.a3da-bar.a3da-cv-bottom .a3da-close, .a3da-toast.a3da-cv-bottom .a3da-close { align-self: flex-end; }
.a3da-icon.dashicons { width: 1.4em; height: 1.4em; font-size: 1.4em; }
.a3da-body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.a3da-title { font-weight: var(--a3da-title-weight, 800); letter-spacing: -.2px; }
.a3da-bar .a3da-title, .a3da-toast .a3da-title { font-size: var(--a3da-title-size, 1.05em); }
.a3da-bar .a3da-body, .a3da-toast .a3da-body { text-align: var(--a3da-text-align, left); }
.a3da-message { opacity: .92; }
.a3da-message a { color: var(--a3da-accent, #f5a623); font-weight: 700; text-decoration: underline; }
.a3da-countdown {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-weight: 700; color: var(--a3da-accent, #f5a623); font-variant-numeric: tabular-nums;
}
.a3da-countdown:empty { display: none; }

/* Bouton CTA */
.a3da-cta {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--a3da-cta-bg, #f5a623);
  color: var(--a3da-cta-text, #3a2400) !important;
  border-radius: var(--a3da-cta-radius, 10px);
  padding: 10px 18px;
  font-weight: 800; font-size: .95em; text-decoration: none !important;
  border: 0; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  transition: filter .12s ease, transform .06s ease, background-color .12s ease;
}
.a3da-cta:hover { background: var(--a3da-cta-hover, #e0911a); filter: brightness(1.02); }
.a3da-cta:active { transform: translateY(1px); }

/* Bouton fermer */
.a3da-close {
  flex: 0 0 auto;
  width: calc(var(--a3da-close-size, 24px) + 10px); height: calc(var(--a3da-close-size, 24px) + 10px); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--a3da-text, #1f2937);
  border: 0; border-radius: 8px; cursor: pointer;
  font-size: var(--a3da-close-size, 24px); opacity: .55; transition: opacity .12s ease, background-color .12s ease;
}
.a3da-close:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* Croix « collée au bord droit » (barre / toast) : positionnée par rapport à la boîte. */
.a3da-bar.a3da-ce .a3da-close, .a3da-toast.a3da-ce .a3da-close {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); align-self: auto; margin: 0;
}
.a3da-bar.a3da-ce .a3da-inner { padding-right: 54px; }
.a3da-toast.a3da-ce .a3da-inner { padding-right: 46px; }
/* En mode collé au bord, la position verticale se fait par top/bottom (align-self est inopérant en absolu). */
.a3da-ce.a3da-cv-top .a3da-close { top: 10px; bottom: auto; transform: none; }
.a3da-ce.a3da-cv-bottom .a3da-close { top: auto; bottom: 10px; transform: none; }
.a3da-ce.a3da-cv-middle .a3da-close { top: 50%; bottom: auto; transform: translateY(-50%); }

/* ===========================  BARRE  =========================== */
.a3da-bar {
  position: fixed; left: 0; right: 0;
  z-index: var(--a3da-z);
  background: var(--a3da-bg, #fff7e9);
  border-bottom: var(--a3da-border-w, 1px) solid var(--a3da-border, #f1cf95);
  box-shadow: var(--a3da-shadow, none);
}
.a3da-bar--top { top: 0; }
.a3da-bar--bottom { bottom: 0; top: auto; border-bottom: 0; border-top: var(--a3da-border-w, 1px) solid var(--a3da-border, #f1cf95); }
.a3da-bar .a3da-inner {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(8px, var(--a3da-pad, 16px), 22px) 20px;
}
.a3da-bar .a3da-body { gap: 3px; }
.a3da-bar .a3da-countdown { margin-top: 0; }

/* ===========================  TOAST  =========================== */
.a3da-toaststack {
  position: fixed; z-index: var(--a3da-z);
  display: flex; flex-direction: column; gap: 12px;
  max-width: min(92vw, 420px); pointer-events: none;
}
.a3da-toaststack > .a3da { pointer-events: auto; }
.a3da-toaststack--top-left     { top: 20px; left: 20px; }
.a3da-toaststack--top-right    { top: 20px; right: 20px; }
.a3da-toaststack--bottom-left  { bottom: 20px; left: 20px; flex-direction: column-reverse; }
.a3da-toaststack--bottom-right { bottom: 20px; right: 20px; flex-direction: column-reverse; }
.a3da-toast {
  position: relative;
  background: var(--a3da-bg, #fff7e9);
  border: var(--a3da-border-w, 1px) solid var(--a3da-border, #f1cf95);
  border-radius: var(--a3da-radius, 14px);
  box-shadow: var(--a3da-shadow, 0 16px 40px -12px rgba(15,23,42,.35));
}
.a3da-toast .a3da-inner { padding: var(--a3da-pad, 16px); align-items: var(--a3da-valign, flex-start); }
.a3da-toast .a3da-close { margin: -4px -4px 0 0; }
.a3da-toast .a3da-cta { margin-top: 6px; }
.a3da-toast .a3da-inner { flex-wrap: wrap; }

/* ====================  POPUP / PLEIN ÉCRAN  ==================== */
.a3da-overlay {
  position: fixed; inset: 0;
  z-index: calc(var(--a3da-z) + 10);
  background: var(--a3da-overlay, rgba(15,23,42,.55));
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.a3da-popup .a3da-modal {
  position: relative;
  width: 100%; max-width: var(--a3da-maxw, 460px);
  flex-direction: column; align-items: center; text-align: center; gap: 10px;
  background: var(--a3da-bg, #fff7e9);
  border: var(--a3da-border-w, 1px) solid var(--a3da-border, #f1cf95);
  border-radius: var(--a3da-radius, 14px);
  box-shadow: var(--a3da-shadow, 0 16px 40px -12px rgba(15,23,42,.35));
  padding: calc(var(--a3da-pad, 16px) + 14px);
}
.a3da-popup .a3da-icon { font-size: 2.6em; }
.a3da-popup .a3da-body { align-items: center; text-align: center; }
.a3da-popup .a3da-title { font-size: 1.25em; }
.a3da-popup .a3da-cta { margin-top: 6px; }
.a3da-popup .a3da-close { position: absolute; top: 8px; right: 8px; }

/* Plein écran : panneau qui occupe tout l'écran, fond plein. */
.a3da-fullscreen .a3da-modal {
  position: relative;
  width: 100%; height: 100%; max-width: none;
  flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px;
  background: var(--a3da-bg, #fff7e9);
  padding: 6vh 24px;
}
.a3da-fullscreen .a3da-icon { font-size: 3.4em; }
.a3da-fullscreen .a3da-title { font-size: clamp(1.4em, 4vw, 2.2em); }
.a3da-fullscreen .a3da-body { align-items: center; text-align: center; max-width: 720px; }
.a3da-fullscreen .a3da-cta { margin-top: 10px; padding: 13px 26px; font-size: 1.05em; }
.a3da-fullscreen .a3da-close { position: absolute; top: 16px; right: 18px; font-size: 30px; }

/* ===========================  ANIMATIONS  =========================== */
.a3da[hidden] { display: none !important; }

.a3da-bar { transition: transform .32s cubic-bezier(.22,.61,.36,1); }
.a3da-bar--top { transform: translateY(-110%); }
.a3da-bar--bottom { transform: translateY(110%); }
.a3da-bar.a3da-show { transform: translateY(0); }

.a3da-overlay { opacity: 0; transition: opacity .25s ease; }
.a3da-overlay .a3da-modal { transform: translateY(12px) scale(.97); transition: transform .28s cubic-bezier(.22,.61,.36,1); }
.a3da-overlay.a3da-show { opacity: 1; }
.a3da-overlay.a3da-show .a3da-modal { transform: none; }

.a3da-toast { opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .26s ease, transform .26s cubic-bezier(.22,.61,.36,1); }
.a3da-toaststack--top-left .a3da-toast,
.a3da-toaststack--bottom-left .a3da-toast { transform: translateX(-16px); }
.a3da-toaststack--top-right .a3da-toast,
.a3da-toaststack--bottom-right .a3da-toast { transform: translateX(16px); }
.a3da-toast.a3da-show { opacity: 1; transform: none; }

/* Désactivation des animations (réglage global) ou préférence système. */
.a3da-no-anim .a3da, .a3da-no-anim .a3da .a3da-modal { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .a3da, .a3da .a3da-modal { transition: none !important; }
}

/* ===========================  RESPONSIVE  =========================== */
@media (max-width: 640px) {
  .a3da-bar .a3da-inner { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .a3da-bar .a3da-cta { order: 3; }
  .a3da-toaststack { left: 12px !important; right: 12px !important; max-width: none; }
  .a3da-popup .a3da-modal { padding: 22px 18px; }
}
