/* ==========================================================================
   AT Workshop Popup — styles isolés
   Tous les sélecteurs sont préfixés .atwk- pour éviter tout conflit avec
   Bootstrap, style.css, se-vitrine.css, etc. Aucun style global.
   ========================================================================== */


.atwk-popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999999;
  width: 410px;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  padding: 18px 24px 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 60px -12px rgba(8, 40, 90, 0.35),
    0 6px 18px -6px rgba(8, 40, 90, 0.18);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #0f172a;
  text-align: left;
  -webkit-font-smoothing: antialiased;

  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.45s;
}

.atwk-popup[dir='rtl'] { right: auto; left: 24px; text-align: right; }

.atwk-popup.atwk-is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.atwk-popup,
.atwk-popup *,
.atwk-popup *::before,
.atwk-popup *::after { box-sizing: border-box; }

/* Neutralise les styles globaux (Bootstrap, thème) sur les éléments utilisés */
.atwk-popup p,
.atwk-popup h2,
.atwk-popup h3,
.atwk-popup div,
.atwk-popup span,
.atwk-popup a,
.atwk-popup button {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
}
.atwk-popup p,
.atwk-popup h2,
.atwk-popup h3 { margin: 0; padding: 0; }
.atwk-popup svg { display: inline-block; flex-shrink: 0; vertical-align: middle; }

/* ---------- En-tête ---------- */
.atwk-popup .atwk-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.atwk-popup .atwk-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff6b00;
  animation: atwk-pulse 2s ease-out infinite;
}

.atwk-popup .atwk-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #6b1f74 0%, #93388e 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 2px 10px -2px rgba(107, 31, 116, 0.45);
  overflow: hidden;
}

/* Reflet de brillance moderne (Shimmer sweep style Linear / Stripe) */
.atwk-popup .atwk-badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 100%
  );
  transform: rotate(25deg);
  animation: atwk-shine 3.5s ease-in-out infinite;
  pointer-events: none;
}

/* Animation de cloche moderne dorée (Chime / Ring fluide & naturel - Best 2026 UX/UI) */
.atwk-popup .atwk-badge svg {
  width: 13.5px;
  height: 13.5px;
  color: #facc15;
  fill: #facc15;
  stroke: #eab308;
  stroke-width: 1.2;
  transform-origin: top center;
  animation: atwk-bell-ring 4s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
  display: inline-block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(250, 204, 21, 0.45));
}

@keyframes atwk-bell-ring {
  0%, 45%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(14deg);
  }
  55% {
    transform: rotate(-12deg);
  }
  60% {
    transform: rotate(9deg);
  }
  65% {
    transform: rotate(-6deg);
  }
  70% {
    transform: rotate(3deg);
  }
  75% {
    transform: rotate(0deg);
  }
}

@keyframes atwk-shine {
  0%, 25% { left: -100%; }
  65%, 100% { left: 180%; }
}

.atwk-popup .atwk-close {
  margin-inline-start: auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.atwk-popup .atwk-close:hover { background: rgba(15, 23, 42, 0.16); color: #0f172a; transform: rotate(90deg); }

/* ---------- Contenu ---------- */
.atwk-popup .atwk-kicker {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #0b4fa8;
}

.atwk-popup .atwk-title {
  margin-top: 4px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #0f172a;
}

/* ---------- Bloc infos ---------- */
.atwk-popup .atwk-info {
  margin-top: 14px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.06);
}

.atwk-popup .atwk-info-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.atwk-popup .atwk-info-wide {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.atwk-popup .atwk-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.atwk-popup .atwk-ico-blue { background: #a655a12e;color: #a655a1; }
.atwk-popup .atwk-ico-orange { background: #a655a12e;color: #a655a1; }
.atwk-popup .atwk-ico-green { background: #a655a12e;color: #a655a1; }

.atwk-popup .atwk-info-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #94a3b8;
  line-height: 1.2;
}
.atwk-popup .atwk-info-value {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.atwk-popup .atwk-info-value em { font-style: normal; color: #0b4fa8; }

.atwk-popup .atwk-desc {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- CTA ---------- */
.atwk-popup .atwk-cta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(100deg, #75227f 0%, #a655a1 45%, #7c2983 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(11, 79, 168, 0.55);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.atwk-popup .atwk-cta:hover,
.atwk-popup .atwk-cta:focus {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 26px -6px rgba(11, 79, 168, 0.6);
}
.atwk-popup .atwk-cta svg { transition: transform 0.2s; }
.atwk-popup .atwk-cta:hover svg { transform: translateX(3px); }
.atwk-popup[dir='rtl'] .atwk-cta svg { transform: scaleX(-1); }
.atwk-popup[dir='rtl'] .atwk-cta:hover svg { transform: scaleX(-1) translateX(3px); }

.atwk-popup .atwk-note {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10.5px;
  color: #64748b;
  text-align: center;
}
.atwk-popup .atwk-note svg {color: #a655a1; }

/* ---------- Accessibilité ---------- */
.atwk-popup .atwk-close:focus-visible,
.atwk-popup .atwk-cta:focus-visible {
  outline: 3px solid rgba(255, 107, 0, 0.55);
  outline-offset: 2px;
}

@keyframes atwk-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 107, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .atwk-popup,
  .atwk-popup .atwk-cta,
  .atwk-popup .atwk-close { transition: none; }
  .atwk-popup .atwk-dot,
  .atwk-popup .atwk-badge::after,
  .atwk-popup .atwk-badge svg { animation: none; }
}

/* ---------- Mobile : UX/UI Responsive (Mobile First Bottom Sheet) ---------- */
@media (max-width: 575px) {
  .atwk-popup,
  .atwk-popup[dir='rtl'] {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    width: auto;
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 16px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.38),
                0 4px 12px -2px rgba(15, 23, 42, 0.12);
  }

  /* En-tête mobile */
  .atwk-popup .atwk-head {
    padding-bottom: 9px;
  }
  .atwk-popup .atwk-badge {
    font-size: 10px;
    padding: 4px 9px;
    gap: 5px;
    letter-spacing: 0.3px;
  }
  .atwk-popup .atwk-badge svg {
    width: 12px;
    height: 12px;
  }
  .atwk-popup .atwk-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
  }
  .atwk-popup .atwk-close:active {
    background: rgba(15, 23, 42, 0.15);
    transform: scale(0.92);
  }

  /* Textes & Titre */
  .atwk-popup .atwk-kicker {
    margin-top: 10px;
    font-size: 10.5px;
  }
  .atwk-popup .atwk-title {
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.32;
    letter-spacing: -0.01em;
  }

  /* Bloc infos compact */
  .atwk-popup .atwk-info {
    margin-top: 10px;
    padding: 8px 10px;
    gap: 8px 10px;
    border-radius: 13px;
    background: rgba(248, 250, 252, 0.85);
  }
  .atwk-popup .atwk-info-wide {
    padding-top: 8px;
  }
  .atwk-popup .atwk-ico {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .atwk-popup .atwk-ico svg {
    width: 13px;
    height: 13px;
  }
  .atwk-popup .atwk-info-label {
    font-size: 8.5px;
    letter-spacing: 0.3px;
  }
  .atwk-popup .atwk-info-value {
    font-size: 11.5px;
  }

  /* Description & Bouton CTA */
  .atwk-popup .atwk-desc {
    margin-top: 9px;
    font-size: 11.5px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
  }
  .atwk-popup .atwk-cta {
    margin-top: 11px;
    padding: 12px 14px;
    min-height: 44px;
    font-size: 13.5px;
    border-radius: 12px;
    box-shadow: 0 6px 18px -4px rgba(117, 34, 127, 0.45);
  }
  .atwk-popup .atwk-cta:active {
    transform: scale(0.98);
    filter: brightness(0.96);
  }
  .atwk-popup .atwk-note {
    margin-top: 7px;
    font-size: 9.5px;
  }
}

/* Écrans très étroits (< 360px, ex: iPhone SE, Galaxy Fold) */
@media (max-width: 360px) {
  .atwk-popup,
  .atwk-popup[dir='rtl'] {
    left: 8px;
    right: 8px;
    padding: 12px 12px 10px;
  }
  .atwk-popup .atwk-title {
    font-size: 14px;
  }
  .atwk-popup .atwk-info {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .atwk-popup .atwk-info-wide {
    padding-top: 6px;
  }
}
