@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --primary-purple: #8b5cf6;
  --primary-purple-dark: #7c3aed;
}

html {
  font-family: var(--font-sans);
  background-color: #07090e;
  color: #f1f5f9;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto; /* Défilement natif vertical fluide */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: #07090e;
  color: #f1f5f9;
  width: 100%;
  min-height: 100%;
  /* CRUCIAL : overflow visible pour ne pas créer de scroll-container parasite qui bloquerait la molette souris */
  overflow: visible !important;
}

/* Sur écran tactile : manipulation rapide. Sur PC avec souris : défilement naturel absolu */
@media (pointer: fine) {
  html, body, .product-card, #products-grid, main, section {
    touch-action: auto !important;
  }
}
@media (pointer: coarse) {
  body {
    touch-action: manipulation;
  }
}

/* ANTI-ZOOM TOTAL ET ABSOLU SUR TOUS LES APPAREILS */
input, select, textarea {
  font-size: 16px !important; /* Empêche l'auto-zoom d'iOS Safari au focus */
  touch-action: manipulation !important;
}

button, a, label {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* SOLID MODAL LOCK (Fenêtres solides qui ne bougent pas sous le pouce) */
.solid-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: auto !important;
}

.solid-modal-card {
  position: relative !important;
  transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
  overflow-x: hidden !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.8);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Smooth Transitions */
.transition-smooth {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.8; filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4)); }
  50% { opacity: 1; filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8)); }
}

.pulse-glow {
  animation: pulseGlow 2.5s infinite ease-in-out;
}

/* Card Glow on Hover */
.product-card {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.5);
}

.product-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -10px rgba(139, 92, 246, 0.25);
}

/* Active Size Pill in Product Card */
.size-badge {
  transition: all 0.18s ease;
  user-select: none;
}

.size-badge.active {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  border-color: #a78bfa !important;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Category Filter Active Pill */
.cat-pill.active {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-color: #a78bfa !important;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

/* Quick Size Preset Pill */
.preset-size-btn {
  transition: all 0.15s ease;
}

.preset-size-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
}

.preset-size-btn.selected {
  background: #7c3aed !important;
  border-color: #a78bfa !important;
  color: white !important;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* Drag and Drop Zone Hover & DragOver */
.dropzone-active {
  border-color: #8b5cf6 !important;
  background: rgba(139, 92, 246, 0.1) !important;
  transform: scale(1.01);
}

/* Image preview thumbnails in modals */
.thumbnail-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.8);
}

.thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-preview .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.thumbnail-preview .remove-btn:hover {
  opacity: 1;
}

/* Toast styling */
.toast-msg {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

/* Brand suggestions scrollbar and styling */
#brand-suggestions-dropdown {
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(139, 92, 246, 0.2);
}

.brand-suggestion-item {
  transition: all 0.15s ease;
}

/* Mobile responsive enhancements */
@media (max-width: 640px) {
  .product-card {
    border-radius: 1rem;
  }
}

/* Mobile Bottom Navigation active item */
.mobile-nav-item.active {
  color: #a78bfa;
}

.mobile-nav-item.active svg, .mobile-nav-item.active span {
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6));
}

/* Apple Liquid Glass Bottom Navigation - Dock iPhone Flottant */
.liquid-glass-nav {
  position: fixed !important;
  bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
  left: 0.75rem !important;
  right: 0.75rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 410px !important;
  width: calc(100% - 1.5rem) !important;
  height: 62px !important;
  padding: 0.3rem 0.35rem !important;
  border-radius: 9999px !important;
  background: rgba(11, 15, 26, 0.82) !important;
  backdrop-filter: blur(28px) saturate(210%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(210%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 
    0 16px 36px -8px rgba(0, 0, 0, 0.85), 
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.35) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  z-index: 50 !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease !important;
}

/* Quand on cherche en écrivant, le menu du bas se masque automatiquement */
.liquid-glass-nav.nav-hidden-search {
  transform: translateY(140%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Bulle active Liquid Glass qui glisse magnétiquement d'un onglet à l'autre */
.nav-liquid-pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.07) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.45),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, width;
  opacity: 0;
}

.nav-liquid-pill.active {
  opacity: 1;
}

/* Boutons de la barre de navigation - Tout sobre monochrome style Apple */
.nav-item-btn {
  position: relative;
  z-index: 2;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #94a3b8;
  border-radius: 9999px;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s ease, transform 0.15s ease;
}

.nav-item-btn:active {
  transform: scale(0.92);
}

.nav-item-btn svg {
  color: #94a3b8;
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.nav-item-btn span {
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

/* Onglet Actif - Blanc brillant / sobre sans couleur criarde */
.nav-item-btn.active {
  color: #ffffff;
}

.nav-item-btn.active svg {
  color: #ffffff;
  transform: translateY(-1px) scale(1.06);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.55));
}

.nav-item-btn.active span {
  color: #ffffff;
  font-weight: 800;
}

/* Apple Liquid Glass Action Sheet / Modal */
.liquid-glass-sheet {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

/* Long press touch feedback & Card rendering optimization */
.product-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  content-visibility: auto;
  contain-intrinsic-size: 290px;
  contain: layout style;
}

.product-card.card-pressing {
  transform: scale(0.97);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  border-color: rgba(139, 92, 246, 0.8);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Sortable photo items in Edit Modal */
.sortable-photo-item {
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.sortable-photo-item.dragging {
  opacity: 0.5;
  transform: scale(1.05);
}

/* Bulle transparente stylée avec chiffre en rouge */
.stock-red-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: rgba(10, 15, 29, 0.55);
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 9999px;
  box-shadow: 0 4px 16px -2px rgba(239, 68, 68, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.stock-red-pulse {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.stock-red-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 900;
  color: #ef4444;
  line-height: 1;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.stock-red-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(252, 165, 165, 0.9);
  letter-spacing: 0.05em;
  line-height: 1;
}

/* Photo Gallery Container & Cards (Organisateur facile pour smartphone) */
.photo-stack-container {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0.75rem 0.5rem 1rem 0.5rem;
  overflow-x: auto;
  gap: 0.75rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.photo-stack-card:hover, .photo-stack-card.active {
  transform: rotate(0deg) translateY(-12px) scale(1.08) !important;
  z-index: 30 !important;
  box-shadow: 0 18px 36px -6px rgba(0, 0, 0, 0.9), 0 0 0 2px rgba(139, 92, 246, 0.8), 0 0 20px rgba(139, 92, 246, 0.4);
}

.photo-stack-card.has-measure {
  box-shadow: -8px 10px 24px -4px rgba(0, 0, 0, 0.75), 0 0 0 2px rgba(14, 165, 233, 0.7);
}

/* Mini Menu Tabs inside Gallery */
.gallery-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.7);
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.gallery-tab-btn:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(100, 116, 139, 0.8);
}

.gallery-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(79, 70, 229, 0.25));
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}



