/* AxessPharma — Auto-injection styles (ticker + promos + lightbox + stack container).
   Chargé conditionnellement par Frontend\Injector quand au moins une feature est ON.

   Regroupe :
     - Stack container (.ax-injected-stack)
     - Ticker (.ax-ticker)
     - Promos carrousel image-dominant + lightbox (.ax-promos, .ax-promos-lightbox)

   Branding AxessPharma : marine #01386C, cyan #006E96, cyan dark #005471,
   accent #03DF97, texte #353535, muted #5A5A5A, bordure #EDEDED, surface #FFF.
   Font Lato. Radius cartes 14px, boutons pill 999px.
*/

/* === MENU NAV : une seule ligne — DESKTOP UNIQUEMENT (>1025px) ===
   Sous 1025px on laisse Elementor gérer son menu mobile natif : forcer
   le nowrap sur petit écran provoquait un débordement horizontal et
   cassait le responsive sur tout le site. */
@media (min-width: 1025px) {
  .elementor-nav-menu,
  .elementor-nav-menu--main,
  .elementor-nav-menu--main .elementor-nav-menu {
    flex-wrap: nowrap !important;
    white-space: nowrap;
  }
  .elementor-nav-menu li.menu-item { flex: 0 0 auto; }
  .elementor-nav-menu li.menu-item a.elementor-item {
    white-space: nowrap;
    padding-left: 14px !important;
    padding-right: 14px !important;
    font-size: clamp(0.82rem, 1vw, 0.95rem);
  }
}

/* === STACK : container des injections (promos + magazine banner) === */
.ax-injected-stack {
  max-width: 1200px;
  margin: 48px auto 64px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 64px; /* espace généreux entre promos et magazine */
  box-sizing: border-box;
}
@media (max-width: 760px) {
  .ax-injected-stack { margin: 32px auto 48px; gap: 40px; padding: 0 16px; }
}
.ax-injected-stack > .ax-promos-shell { max-width: 100%; margin: 0; }
.ax-injected-stack > .ax-mag-banner { margin: 0; }

/* === TICKER : full-width edge-to-edge === */
.ax-ticker {
  width: 100%;
  margin: 0;
  background: linear-gradient(90deg, #005471, #006E96);
  color: #fff;
  overflow: hidden;
  font-size: .8rem;
  position: relative;
  padding: 8px 0;
  box-sizing: border-box;
}
.ax-ticker__track {
  display: inline-block;
  padding-left: 100%;
  white-space: nowrap;
  animation: ax-ticker var(--ticker-speed, 35s) linear infinite;
  will-change: transform;
}
.ax-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Lato", sans-serif;
  font-weight: 500;
  letter-spacing: .01em;
  margin-right: 64px;
}
.ax-ticker__item:last-child { margin-right: 0; }
.ax-ticker__item a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.ax-ticker__item a:hover { color: #03DF97; }
.ax-ticker:hover .ax-ticker__track { animation-play-state: paused; }
@keyframes ax-ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ===== PROMOS — carrousel + lightbox (cards 4:5 image-dominantes, clic → lightbox) ===== */
/* Shell : conteneur extérieur (réservé pour respiration au-dessus du bandeau) */
.ax-promos-shell { position: relative; padding-top: 6px; }
.ax-promos {
  background: #fff;
  border: 1px solid #EDEDED;
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 8px 28px rgba(0, 84, 113, .08);
  display: flex;
  align-items: stretch;
  position: relative;
}

/* Bandeau (head) — encart vertical avec le label (carrousel à droite) */
.ax-promos__head {
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 18px;
  background: linear-gradient(135deg, #006E96, #005471);
  color: #fff;
  font-family: "Lato", sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  min-width: 132px;
  text-align: center;
  line-height: 1.2;
  border-radius: 16px 0 0 16px;
}
.ax-promos__head-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ax-promos__viewport { flex: 1; overflow: hidden; position: relative; min-width: 0; padding: 14px 0; }
.ax-promos__track { display: flex; gap: 12px; padding: 0 12px; will-change: transform; align-items: stretch; }

/* CARD : ratio 4:5 — image-dominante, clic → lightbox. Le bouton occupe toute la card. */
.ax-promos__card {
  flex-shrink: 0;
  position: relative;
  width: 220px;
  aspect-ratio: 4 / 5;
  background: #fff;
  border: 1px solid #EDEDED;
  border-radius: 14px;
  padding: 0;
  cursor: zoom-in;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, border-color .25s ease;
  box-shadow: 0 2px 8px rgba(0, 84, 113, .06);
}
.ax-promos__card:hover { transform: translateY(-3px) scale(1.025); box-shadow: 0 10px 28px rgba(0, 84, 113, .14); border-color: #006E96; }
.ax-promos__card:focus-visible { outline: 2px solid #006E96; outline-offset: 3px; }
.ax-promos__card:active { transform: translateY(-1px) scale(1.005); }
.ax-promos__img { display: block; width: 100%; height: 100%; object-fit: contain; background: #FAFAFA; padding: 10px; }
.ax-promos__icon { width: 100%; height: 100%; background: rgba(0, 110, 150, .06); color: #006E96; display: flex; align-items: center; justify-content: center; }

/* Badge discount flottant top-right */
.ax-promos__discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #006E96;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: "Lato", sans-serif;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .02em;
  box-shadow: 0 4px 12px rgba(0, 110, 150, .35);
  z-index: 2;
  pointer-events: none;
}

/* Caption (brand + product) — ruban bas */
.ax-promos__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px 10px;
  background: linear-gradient(to top, rgba(255, 255, 255, .96) 60%, rgba(255, 255, 255, 0));
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1;
  pointer-events: none;
}
.ax-promos__caption-brand { font-family: "Lato", sans-serif; font-size: .64rem; font-weight: 700; letter-spacing: .08em; color: #5A5A5A; text-transform: uppercase; }
.ax-promos__caption-name {
  font-family: "Lato", sans-serif;
  font-size: .86rem;
  font-weight: 700;
  color: #353535;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ax-promos__dots { display: none; }

/* DESKTOP : marquee infinite seamless (track dupliqué 2×, translate -50%) */
@media (min-width: 761px) {
  .ax-promos__track { animation: ax-promos-marquee var(--promos-speed, 40s) linear infinite; }
  .ax-promos:hover .ax-promos__track { animation-play-state: paused; }
  @keyframes ax-promos-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
}

/* MOBILE : carousel fade — une seule card visible, ratio 4:5 dominant (image ~140) */
@media (max-width: 760px) {
  .ax-promos { flex-direction: column; align-items: stretch; border-radius: 18px; }
  .ax-promos__head { flex-direction: row; justify-content: center; align-items: center; gap: 14px; padding: 14px 16px; min-width: 0; width: 100%; flex-shrink: 0; font-size: .74rem; border-radius: 18px 18px 0 0; }
  .ax-promos__head-label { padding: 5px 10px; font-size: .7rem; }
  .ax-promos__viewport { flex: none !important; position: relative; min-height: 0; height: auto; padding: 14px 16px 0; overflow: hidden; width: 100%; background: #fff; }
  .ax-promos__track { position: relative; display: block; animation: none !important; transform: none !important; padding: 0; gap: 0; aspect-ratio: 4 / 5; max-height: 60vh; }
  .ax-promos__card { position: absolute; inset: 0; width: 100%; aspect-ratio: auto; height: 100%; border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .55s ease-in-out; transform: none; }
  .ax-promos__card.is-current { opacity: 1; pointer-events: auto; z-index: 2; }
  .ax-promos__card:hover { transform: none; }
  .ax-promos__img { padding: 8px; }
  .ax-promos__discount-badge { font-size: .88rem; padding: 5px 14px; font-weight: 800; }
  .ax-promos__caption { padding: 10px 14px 12px; }
  .ax-promos__caption-brand { font-size: .68rem; }
  .ax-promos__caption-name { font-size: .96rem; -webkit-line-clamp: 2; }
  .ax-promos__dots { display: flex; justify-content: center; gap: 7px; padding: 12px 0 16px; background: #fff; flex-shrink: 0; }
  .ax-promos__dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(0, 110, 150, .22); transition: all .25s; cursor: pointer; }
  .ax-promos__dot.is-active { background: #006E96; width: 24px; border-radius: 4px; }
}

@media (max-width: 380px) {
  .ax-promos__viewport { padding: 12px 12px 0; }
  .ax-promos__caption-name { font-size: .86rem; }
}

/* Reduced motion : désactive l'auto-scroll */
@media (prefers-reduced-motion: reduce) {
  .ax-promos__track { animation: none !important; }
  .ax-promos__card { transition: none; }
  .ax-promos__card:hover { transform: none; }
}

/* ===== LIGHTBOX PROMOS — affichage grand format au clic ===== */
.ax-promos-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(1, 20, 33, .92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.ax-promos-lightbox.is-open { opacity: 1; pointer-events: auto; }
.ax-promos-lightbox__inner {
  position: relative;
  max-width: min(960px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  transform: scale(.96);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.ax-promos-lightbox.is-open .ax-promos-lightbox__inner { transform: scale(1); }
.ax-promos-lightbox__img { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; object-fit: contain; border-radius: 10px; background: #FAFAFA; }
.ax-promos-lightbox__meta { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; width: 100%; max-width: 600px; }
.ax-promos-lightbox__brand { font-family: "Lato", sans-serif; font-size: .74rem; font-weight: 700; letter-spacing: .1em; color: #5A5A5A; text-transform: uppercase; }
.ax-promos-lightbox__name { font-family: "Lato", sans-serif; font-size: 1.4rem; font-weight: 700; color: #353535; line-height: 1.25; }
.ax-promos-lightbox__price-row { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.ax-promos-lightbox__discount { background: #006E96; color: #fff; padding: 5px 14px; border-radius: 999px; font-family: "Lato", sans-serif; font-weight: 800; font-size: .9rem; letter-spacing: .04em; box-shadow: 0 4px 12px rgba(0, 110, 150, .3); }
.ax-promos-lightbox__price-old { color: #5A5A5A; text-decoration: line-through; font-size: 1rem; }
.ax-promos-lightbox__price-new { font-family: "Lato", sans-serif; font-weight: 700; color: #005471; font-size: 1.35rem; }
.ax-promos-lightbox__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  background: #006E96;
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: "Lato", sans-serif;
  font-weight: 700;
  font-size: .94rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 110, 150, .32);
  transition: background .2s ease, transform .2s ease;
}
.ax-promos-lightbox__cta:hover { background: #005471; transform: translateY(-2px); }
.ax-promos-lightbox__cta[hidden] { display: none; }

/* Close button */
.ax-promos-lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .95);
  color: #01386C;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  z-index: 2;
  transition: background .2s ease, transform .2s ease;
}
.ax-promos-lightbox__close:hover { background: #fff; transform: scale(1.08); }

/* Nav buttons (prev/next) */
.ax-promos-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .92);
  color: #01386C;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  z-index: 2;
  transition: background .2s ease, transform .2s ease;
}
.ax-promos-lightbox__nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.ax-promos-lightbox__nav--prev { left: 24px; }
.ax-promos-lightbox__nav--next { right: 24px; }

@media (max-width: 760px) {
  .ax-promos-lightbox { padding: 14px; }
  .ax-promos-lightbox__inner { padding: 16px; gap: 12px; max-height: 94vh; }
  .ax-promos-lightbox__img { max-height: 55vh; }
  .ax-promos-lightbox__name { font-size: 1.15rem; }
  .ax-promos-lightbox__price-new { font-size: 1.15rem; }
  .ax-promos-lightbox__close { top: 10px; right: 10px; width: 38px; height: 38px; }
  .ax-promos-lightbox__nav { width: 42px; height: 42px; background: rgba(255, 255, 255, .88); }
  .ax-promos-lightbox__nav--prev { left: 8px; }
  .ax-promos-lightbox__nav--next { right: 8px; }
}
