/* ============================================
   UNIFIED BOTTOM BAR - Recap + Nav Buttons
   Loaded LAST to win cascade
   ============================================ */

/* ── Hide old nav-buttons that were inside steps (removed from HTML but just in case) ── */
.step-content .nav-buttons {
  display: none !important;
}

/* ── UNIFIED BOTTOM BAR: Container ── */
.unified-bottom-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: #fff !important;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.12) !important;
  display: flex !important;
  flex-direction: column !important;
  border-top: 2px solid #e5e5e5 !important;
}

/* iOS safe area */
@supports (padding: env(safe-area-inset-bottom)) {
  .unified-bottom-bar {
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
}

/* ── RECAP SECTION (top part of bar) ── */
.unified-recap {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 16px !important;
  background: #f8f9fa !important;
  border-bottom: 1px solid #e5e5e5 !important;
  min-height: 0 !important;
  overflow: visible !important;
  max-height: none !important;
  position: relative !important;
  white-space: nowrap !important;
  flex-wrap: wrap !important;
}

/* Price */
.unified-recap-price {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #12262F !important;
  flex-shrink: 0 !important;
  letter-spacing: -0.02em !important;
}

/* Details row - horizontal scroll */
.unified-recap-details {
  display: flex !important;
  gap: 8px !important;
  font-size: 11px !important;
  color: #666 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  white-space: nowrap !important;
  flex: 1 !important;
  align-items: center !important;
  min-width: 0 !important;
}

.unified-recap-details::-webkit-scrollbar {
  display: none !important;
}

.unified-recap-item {
  display: inline-flex !important;
  gap: 3px !important;
  flex-shrink: 0 !important;
  align-items: center !important;
}

.unified-recap-item .label {
  font-weight: 600 !important;
  color: #999 !important;
  font-size: inherit !important;
}

.unified-recap-item .value {
  font-weight: 700 !important;
  color: #12262F !important;
  font-size: inherit !important;
}

/* Pipe separator between items */
.unified-recap-item + .unified-recap-item::before {
  content: "·" !important;
  color: #ccc !important;
  margin-right: 8px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
}

/* ── NAVIGATION BUTTONS (bottom part of bar) ── */
.unified-nav {
  display: flex !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  align-items: center !important;
  background: #fff !important;
}

.unified-nav .btn-back {
  flex: 0 0 auto !important;
  min-width: 110px !important;
  height: 52px !important;
  padding: 0 18px !important;
  border-radius: 12px !important;
  background: #fff !important;
  border: 2px solid #12262F !important;
  color: #12262F !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
}

.unified-nav .btn-back:hover {
  background: #f8f9fa !important;
  box-shadow: 0 4px 12px rgba(18, 38, 47, 0.15) !important;
}

.unified-nav .btn-back:active {
  transform: scale(0.97) !important;
}

.unified-nav .btn-next {
  flex: 1 !important;
  height: 52px !important;
  padding: 0 24px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: #12262F !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(18, 38, 47, 0.25) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

.unified-nav .btn-next:hover {
  background: #0f1d27 !important;
  box-shadow: 0 6px 20px rgba(18, 38, 47, 0.3) !important;
  transform: translateY(-2px) !important;
}

.unified-nav .btn-next:active {
  transform: scale(0.98) !important;
}

.unified-nav .btn-next:disabled {
  background: #ccc !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* ── DESKTOP (768px+) — SAME MODERN STYLE AS MOBILE (rounded, modern) ── */
@media (min-width: 768px) {
  .unified-recap {
    padding: 10px 20px !important;
    gap: 16px !important;
  }
  
  .unified-recap-price {
    font-size: 20px !important;
    min-width: 90px !important;
  }
  
  .unified-recap-details {
    font-size: 13px !important;
    gap: 12px !important;
  }
  
  .unified-recap-item + .unified-recap-item::before {
    margin-right: 12px !important;
  }
  
  .unified-nav {
    display: flex !important;
    padding: 16px 20px !important;
    gap: 16px !important;
    justify-content: space-between !important;
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
  }
  
  /* Retour: Outlined/Ghost — même style que mobile */
  .unified-nav .btn-back {
    flex: 0 0 30% !important;
    min-width: 140px !important;
    height: 52px !important;
    padding: 14px 20px !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: 2px solid #12262F !important;
    color: #12262F !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
  }
  
  .unified-nav .btn-back:hover {
    background: rgba(18, 38, 47, 0.05) !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
  }
  
  .unified-nav .btn-back:active {
    transform: scale(0.97) !important;
    opacity: 1 !important;
  }
  
  /* Suivant: Filled — même style que mobile, PLUS GROS */
  .unified-nav .btn-next {
    flex: 0 0 65% !important;
    height: 52px !important;
    padding: 14px 48px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    background: #12262F !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(18, 38, 47, 0.25) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
  }
  
  .unified-nav .btn-next:hover {
    background: #1a3644 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(18, 38, 47, 0.3) !important;
  }
  
  .unified-nav .btn-next:active {
    transform: scale(0.98) !important;
    opacity: 1 !important;
  }
  
  .unified-nav .btn-next:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    opacity: 1 !important;
  }
}

/* ── MOBILE (< 768px) — RECAP: no horizontal scroll, wrap to 2 lines ── */
@media (max-width: 767px) {
  .unified-recap {
    padding: 6px 12px !important;
    gap: 4px 8px !important;
    white-space: normal !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }
  
  .unified-recap-price {
    font-size: 15px !important;
    flex-shrink: 0 !important;
  }
  
  .unified-recap-details {
    font-size: 10px !important;
    gap: 4px !important;
    overflow-x: visible !important;
    overflow: visible !important;
    white-space: normal !important;
    flex-wrap: wrap !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
  }
  
  .unified-recap-item {
    flex-shrink: 1 !important;
    white-space: nowrap !important;
  }
  
  /* Hide labels on mobile — just show values */
  .unified-recap-item .label {
    display: none !important;
  }
  
  .unified-recap-item + .unified-recap-item::before {
    content: "·" !important;
    margin-right: 4px !important;
    font-size: 10px !important;
  }
}

/* ── MOBILE SMALL (< 480px) ── */
@media (max-width: 480px) {
  .unified-recap {
    padding: 5px 10px !important;
    gap: 3px 6px !important;
  }
  
  .unified-recap-price {
    font-size: 14px !important;
  }
  
  .unified-recap-details {
    font-size: 9.5px !important;
    gap: 3px !important;
  }
  
  .unified-recap-item + .unified-recap-item::before {
    margin-right: 3px !important;
    font-size: 9px !important;
  }
  
  .unified-nav {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  
  .unified-nav .btn-back {
    min-width: 100px !important;
    height: 48px !important;
    font-size: 14px !important;
    padding: 0 14px !important;
  }
  
  .unified-nav .btn-next {
    height: 48px !important;
    font-size: 15px !important;
    padding: 0 18px !important;
  }
}

/* ── VERY SMALL (320px — iPhone SE) ── */
@media (max-width: 350px) {
  .unified-recap {
    padding: 4px 8px !important;
    gap: 2px 5px !important;
  }
  
  .unified-recap-price {
    font-size: 13px !important;
  }
  
  .unified-recap-details {
    font-size: 9px !important;
    gap: 2px !important;
  }
}

/* ── BODY PADDING: enough space for unified bar ── */
body {
  padding-bottom: 140px !important;
}

.step-content {
  padding-bottom: 40px !important;
}

.configurateur {
  padding-bottom: 140px !important;
}

@media (max-width: 480px) {
  body {
    padding-bottom: 130px !important;
  }
  .configurateur {
    padding-bottom: 130px !important;
  }
}

/* ── OVERRIDE old global-recap styles from other CSS files ── */
.global-recap {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  z-index: auto !important;
  max-height: none !important;
  overflow: visible !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  white-space: nowrap !important;
}

.global-recap-inner {
  display: contents !important;
}

/* ── OVERRIDE: old .nav-buttons from inline styles and other CSS ── */
.nav-buttons {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  z-index: auto !important;
  box-shadow: none !important;
  display: none !important;
}

/* ── OVERRIDE: price-bar-wrapper ── */
.price-bar-wrapper {
  display: none !important;
}
