/* Nomad Ballooning – Mobile Bottom Nav */

/* Croix de fermeture CSS (panier, popups, wizard) */
.nb-close-x {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.nb-close-x::before,
.nb-close-x::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nb-close-x::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nb-close-x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.nb-close-x--sm {
  width: 12px;
  height: 12px;
}

.nb-close-x--sm::before,
.nb-close-x--sm::after {
  width: 12px;
  height: 2px;
}

/* Espace en bas du contenu pour ne pas masquer le footer */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /*
   * Barre devise flottante VillaTheme (onglet « EUR » + « + ») :
   * elle chevauche le contenu sur mobile — la devise est déjà dans le header.
   */
  .woocommerce-multi-currency.wmc-sidebar,
  .woocommerce-multi-currency.wmc-bottom.wmc-sidebar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Barre de navigation */
.nb-mnav {
  display: none;
}

@media (max-width: 768px) {
  .nb-mnav {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99990;
    background: #fff;
    border-top: 1px solid rgba(166, 124, 82, 0.15);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    font-family: inherit;
  }

  .nb-mnav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    border: none;
    background: none;
    color: var(--nb-text, #5C4A3A);
    text-decoration: none;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
    min-height: 56px;
  }

  .nb-mnav__item:active {
    opacity: 0.85;
  }

  .nb-mnav__item--book {
    background: var(--nb-primary-light, #F5EDE4);
    color: var(--nb-primary, #A67C52);
    font-weight: 600;
    margin: 0 4px;
    border-radius: 14px;
  }

  .nb-mnav__icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
  }

  .nb-mnav__label {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.01em;
  }

  .nb-mnav__item--book .nb-mnav__label {
    font-size: 10.5px;
  }

  .nb-mnav__badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--nb-primary, #A67C52);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
  }
}

/* Overlay */
.nb-mnav-overlay {
  display: none;
}

@media (max-width: 768px) {
  .nb-mnav-overlay {
    position: fixed;
    inset: 0;
    z-index: 99991;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .nb-mnav-overlay.is-visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }
}

/* Popup */
.nb-mnav-popup {
  display: none;
}

@media (max-width: 768px) {
  .nb-mnav-popup {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 99992;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
    max-height: calc(78vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  body.nb-last-minute-active .nb-mnav-popup {
    bottom: calc(80px + 54px + env(safe-area-inset-bottom, 0px));
    max-height: calc(72vh - 130px);
  }

  .nb-mnav-popup__promos {
    flex-shrink: 0;
    padding: 0 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .nb-mnav-popup__promos .nb-summer-banner--card {
    margin: 0;
  }

  .nb-mnav-popup.is-visible {
    display: flex;
    transform: translateY(0);
    opacity: 1;
  }

  .nb-mnav-popup__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 12px;
    flex-shrink: 0;
  }

  .nb-mnav-popup__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
  }

  .nb-mnav-popup__title-end {
    white-space: nowrap;
  }

  .nb-mnav-popup__close {
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0 !important;
    margin: 0;
    border: none !important;
    background: #f5f5f5;
    border-radius: 50%;
    color: #666;
    cursor: pointer;
    line-height: 1;
    box-sizing: border-box;
    overflow: visible;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .nb-mnav-popup__close .nb-close-x {
    pointer-events: none;
  }

  .nb-mnav-popup__close svg {
    display: none;
  }

  .nb-mnav-popup__close:active {
    background: #e8e8e8;
  }

  .nb-mnav-popup__list {
    list-style: none;
    margin: 0;
    padding: 0 8px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
  }

  .nb-mnav-popup__list li {
    margin: 0;
    padding: 0;
  }

  .nb-mnav-popup__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 12px;
    text-decoration: none;
    color: inherit;
    border: none;
    background: transparent;
    border-radius: 12px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .nb-mnav-popup__link:active,
  .nb-mnav-popup__link:hover {
    background: var(--nb-primary-light, #F5EDE4);
  }

  .nb-mnav-popup__list li + li {
    border-top: 1px solid #f0f0f0;
  }

  .nb-mnav-popup__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
  }

  .nb-mnav-popup__name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
  }

  .nb-mnav-popup__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--nb-primary, #A67C52);
  }

  .nb-mnav-popup__arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nb-primary, #A67C52);
  }
}

/* Bloquer le scroll quand panier / popup ouvert */
body.nb-mnav-open {
  overflow: hidden;
}

/* ── Éléments flottants : au-dessus du menu mobile ── */
@media (max-width: 768px) {
  /* Back to top : masqué (chevauche "Mon compte") */
  #scrollUp {
    display: none !important;
  }

  /* Badge reCAPTCHA Google */
  .grecaptcha-badge {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 99980 !important;
    transform: scale(0.82) !important;
    transform-origin: bottom right !important;
  }

  /* Badge avis Google : masqué sur mobile (affiché dans le hero) */
  .nb-google-badge {
    display: none !important;
  }

  /* Sélecteur de devise WooCommerce */
  .woocommerce-multi-currency.wmc-bottom {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 99980 !important;
  }
}

/* ── Panier latéral (mobile + desktop header) ── */
/* Au-dessus du bandeau trust (.nb-trust-top z-index: 100020) */
.nb-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 100030;
  display: none;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nb-cart-overlay.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.nb-side-cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 400px);
  z-index: 100031;
  background: #fff;
  display: none;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
}

.nb-side-cart.is-visible {
  display: flex;
  transform: translateX(0);
}

@media (min-width: 769px) {
  .nb-side-cart {
    width: min(100%, 420px);
  }
}

.nb-side-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: var(--nb-primary, #A67C52);
  color: #fff;
  flex-shrink: 0;
}

.nb-side-cart__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nb-side-cart__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
}

.nb-side-cart__count--empty {
  display: none;
}

.nb-side-cart__close {
  flex-shrink: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  box-sizing: border-box;
  overflow: visible;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.nb-side-cart__close .nb-close-x {
  pointer-events: none;
}

.nb-side-cart__close svg {
  display: none;
}

.nb-side-cart__close:active {
  background: rgba(255, 255, 255, 0.35);
}

.nb-side-cart__inner {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.nb-side-cart__items {
  list-style: none;
  margin: 0;
  padding: 8px 14px;
  flex: 1;
}

.nb-side-cart__item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.nb-side-cart__item:last-child {
  border-bottom: none;
}

.nb-side-cart__item-media {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--nb-primary-light, #F5EDE4);
}

.nb-side-cart__item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nb-side-cart__item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nb-side-cart__item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.nb-side-cart__item-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: #1a1a1a;
  text-transform: none;
}

.nb-side-cart__item-name a {
  color: inherit;
  text-decoration: none;
}

.nb-side-cart__remove {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  background: #f5f5f5;
  border-radius: 50%;
  color: #888;
  line-height: 1;
  cursor: pointer;
  overflow: visible;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.nb-side-cart__remove .nb-close-x {
  pointer-events: none;
}

.nb-side-cart__remove:active {
  background: #eee;
  color: #c00;
}

.nb-side-cart__item-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: #555;
}

.nb-side-cart__item-meta li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin: 0;
  padding: 0;
}

.nb-side-cart__meta-label {
  font-weight: 600;
  color: #777;
  flex-shrink: 0;
}

.nb-side-cart__meta-label::after {
  content: ' :';
}

.nb-side-cart__meta-value {
  color: #333;
  font-weight: 500;
}

.nb-side-cart__item-meta dl.variation,
.nb-side-cart__item-meta .variation {
  display: grid !important;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
  row-gap: 2px;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

.nb-side-cart__item-meta dl.variation::before,
.nb-side-cart__item-meta dl.variation::after,
.nb-side-cart__item-meta .variation::before,
.nb-side-cart__item-meta .variation::after {
  display: none !important;
  content: none !important;
}

.nb-side-cart__item-meta dt,
.nb-side-cart__item-meta dd {
  display: block !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  clear: none !important;
}

.nb-side-cart__item-meta dt::after,
.nb-side-cart__item-meta dd::after {
  content: none !important;
}

.nb-side-cart__item-meta dd p,
.nb-side-cart__item-meta p {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nb-side-cart__item-qty {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--nb-primary, #A67C52);
}

.nb-side-cart__footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  flex-shrink: 0;
}

.nb-side-cart__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: #333;
}

.nb-side-cart__subtotal strong {
  font-size: 17px;
  color: var(--nb-primary, #A67C52);
}

.nb-side-cart__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
  line-height: 1.2;
  box-sizing: border-box;
}

.nb-side-cart__cta svg {
  flex-shrink: 0;
  display: block;
}

.nb-side-cart__cta--primary {
  background: var(--nb-primary, #A67C52);
  color: #fff;
  margin-bottom: 6px;
}

.nb-side-cart__cta--primary:active {
  opacity: 0.9;
}

.nb-side-cart__cta--secondary {
  background: transparent;
  color: var(--nb-primary, #A67C52);
  border: 1.5px solid var(--nb-primary, #A67C52);
}

.nb-side-cart__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  color: #666;
}

.nb-side-cart__empty-icon {
  color: var(--nb-primary, #A67C52);
  opacity: 0.5;
  margin-bottom: 16px;
}

.nb-side-cart__empty p {
  margin: 0 0 20px;
  font-size: 16px;
}

/* ── Bouton checkout page panier WooCommerce (mobile) ── */
@media (max-width: 768px) {
  .wc-block-cart__submit-container .wc-block-components-button,
  .wc-block-cart__submit-container a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .wc-block-cart__submit-container .wc-block-components-button::before,
  .wc-block-cart__submit-container a::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
