/* ACROSS countdown V5 - mobile rules activate only when a visible timer exists. */

/* =========================================
   ACROSS - COUNTDOWN V3
   Desktop + Mobile
   ========================================= */

.topbar .across-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  gap: 10px;
  margin-left: 12px;
  color: #fff;
  font-family: inherit;
  white-space: nowrap;
}

.topbar .across-countdown[hidden] {
  display: none !important;
}

.topbar .across-countdown-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
}

.topbar .across-countdown-digits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topbar .across-countdown-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 33px;
  height: 30px;
  padding: 3px 5px;
  background: #fff;
  color: #252525;
  border-radius: 2px;
  line-height: 1;
}

.topbar .across-countdown-value {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
}

.topbar .across-countdown-unit {
  display: block;
  font-size: 8px;
  font-weight: 500;
  line-height: 9px;
  color: #666;
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 767px) {

  .topbar:has(.across-countdown:not([hidden])) {
    box-sizing: border-box;
    min-height: 76px;
    height: auto !important;
    padding: 8px 38px 8px 10px;
    line-height: 1.4;
  }

  .topbar.text-center:has(.across-countdown:not([hidden])) {
    text-align: center;
  }

  .topbar .across-countdown {
    display: flex;
    width: 100%;
    margin: 6px auto 0;
    gap: 8px;
    white-space: nowrap;
  }

  .topbar .across-countdown-label {
    font-size: 10px;
    letter-spacing: 0.2px;
  }

  .topbar .across-countdown-digits {
    gap: 4px;
  }

  .topbar .across-countdown-box {
    min-width: 30px;
    height: 28px;
    padding: 3px 4px;
  }

  .topbar .across-countdown-value {
    font-size: 12px;
    line-height: 13px;
  }

  .topbar .across-countdown-unit {
    font-size: 7px;
    line-height: 8px;
  }
}

/* Très petits écrans */
@media (max-width: 375px) {

  .topbar .across-countdown {
    gap: 5px;
  }

  .topbar .across-countdown-label {
    font-size: 9px;
  }

  .topbar .across-countdown-box {
    min-width: 27px;
    padding: 3px;
  }
}

/* =========================================
   ACROSS - CORRECTION TOP BAR MOBILE V3.1
   ========================================= */

@media (max-width: 767px) {

  /* Conteneur principal */
  .topbar.topbar.text-center:has(.across-countdown:not([hidden])) {
    height: auto !important;
    min-height: 78px !important;
    padding: 10px 35px 10px 10px !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
    overflow: visible !important;
    display: block !important;
    text-align: center !important;
  }

  /* Texte du bloc CMS */
  .topbar.topbar.text-center:has(.across-countdown:not([hidden])) > span,
  .topbar.topbar.text-center:has(.across-countdown:not([hidden])) > p {
    display: block !important;
    position: static !important;
    transform: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    line-height: 20px !important;
    white-space: normal !important;
  }

  /* Compteur */
  .topbar .across-countdown {
    display: flex !important;
    position: static !important;
    transform: none !important;
    clear: both !important;
    width: 100% !important;
    margin: 7px auto 0 !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
  }

  /* Libellé */
  .topbar .across-countdown-label {
    font-size: 10px !important;
    line-height: 14px !important;
    white-space: nowrap !important;
  }

  /* Chiffres */
  .topbar .across-countdown-digits {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    gap: 4px !important;
  }

  .topbar .across-countdown-box {
    min-width: 29px !important;
    height: 29px !important;
    padding: 3px 4px !important;
  }

  /* Bouton de fermeture */
  .topbar:has(.across-countdown:not([hidden])) .cross {
    position: absolute !important;
    top: 12px !important;
    right: 10px !important;
  }
}
/* =========================================
   ACROSS - ALIGNEMENT HEADER MOBILE V4
   ========================================= */

@media screen and (max-width: 767px) {

  /* Aligner le header avec la hauteur de la top-bar */
  body.showTopbar:has(.topbar .across-countdown:not([hidden])) .sticky__header,
  body.showTopbar:has(.topbar .across-countdown:not([hidden])) .sticky__header.nav-down {
    transform: translateY(78px) !important;
  }

  /* Conserver l'espace nécessaire dans la page */
  body.showTopbar:has(.topbar .across-countdown:not([hidden])) {
    padding-top: 153px !important;
  }

  /* Conserver le comportement du header au scroll */
  body.showTopbar:has(.topbar .across-countdown:not([hidden])) .sticky__header.nav-up {
    transform: translateY(-100%) !important;
  }

}