/* ═══════════════════════════════════════════════════════════════
   🎨 CLICK-SHOP - STYLESHEET MODERNE & RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* 🔧 Réinitialisations & Styles de base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background-color: #f9fafb;
  color: #1f2937;
  line-height: 1.6;
}

/* 📱 Utilitaires */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 🔍 Suggestions de recherche mobile uniquement */
@media (max-width: 768px) {
  .md\:hidden form[action*="search"] {
    position: relative;
  }

  .md\:hidden input[name="q"] {
    position: relative;
    z-index: 35;
  }

  /* Suggestions de recherche autocomplete */
  .ui-autocomplete,
  .autocomplete-suggestions,
  [class*="suggestions"],
  [class*="dropdown"] {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    padding: 0.5rem 0 !important;
    width: 100% !important;
    z-index: 36 !important;
  }
}

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

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* 📝 Toasts & Notifications */
.toast-message {
  animation: slideInUp 0.3s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* 🛍️ Cartes produit */
.product-card {
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card img {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover img {
  transform: scale(1.08);
}

/* 📱 Menu mobile - CORRIGÉ */
.mobile-menu {
  transition: all 0.3s ease;
}

.mobile-menu.hidden {
  display: none !important;
}

/* CORRECTION DU MENU MOBILE */
#mobileMenu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

#mobileMenu.open {
  transform: translateX(0);
}

#mobileMenu:not(.hidden) {
  transform: translateX(0);
}

/* En-tête du menu mobile */
#mobileMenu .sticky-header {
  flex-shrink: 0;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  background: #fff;
}

/* Contenu scrollable */
#mobileMenu .menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Overlay menu mobile */
#mobileMenuOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 49;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#mobileMenuOverlay.active {
  opacity: 1;
  visibility: visible;
}

/* Bouton menu mobile (les 3 barres) */
.menu-toggle {
  background: none;
  border: none;
  color: #333;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
  display: block !important; /* Toujours visible sur mobile */
  transition: color 0.3s ease;
}

.menu-toggle:hover {
  color: #e1a76c;
}

/* Cacher sur desktop */
@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }
}

/* 🔍 Barre de recherche */
input[type="text"]::placeholder {
  color: #9ca3af;
}

input[type="text"]:focus {
  box-shadow: 0 0 0 3px rgba(139, 127, 118, 0.1);
}

/* 🎨 Couleurs personnalisées - Nude Gray Theme */
:root {
  --clickshop: #613102;
  --clickshop-light: #630000;
  --clickshop-accent: #e1a76c;
}

.text-clickshop {
  color: var(--clickshop) !important;
}

.bg-clickshop {
  background-color: var(--clickshop) !important;
}

.border-clickshop {
  border-color: var(--clickshop) !important;
}

/* 🔗 Liens */
a {
  color: #630000;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--clickshop-light);
}

/* 🎯 Boutons */
button[type="submit"],
.btn {
  transition: all 0.2s ease;
  font-weight: 600;
}

button[type="submit"]:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px #e0b182;
}

/* 📦 Badges & Étiquettes */
.badge {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 🌙 Support du mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #83592f;
    color: #f3f4f6;
  }
}

.search-bar {
  display: flex;
  max-width: 500px;
}

.search-bar input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
}

.search-bar button {
  background-color: #e1a76c;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 0 4px 4px 0;
}

.cart-icon {
  color: #e1a76c;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  font-size: 0.75em;
}

/* Desktop category nav */
.category-nav {
  background-color: #f8f8f8;
  padding: 10px 0;
}

.category-link {
  margin: 0 12px;
  color: #e1a76c;
  font-weight: 500;
  text-decoration: none;
}

.category-link:hover {
  color: var(--clickshop-light);
}

/* Mobile menu links */
.mobile-search {
  display: flex;
  padding: 10px;
}

.mobile-search input {
  flex: 1;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
}

.mobile-search button {
  background: #e1a76c;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
}

.mobile-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-links li a {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  color: #333;
  text-decoration: none;
}

.mobile-links li a:hover {
  background: #f8f8f8;
  color: #e1a76c;
}

.user-actions {
  gap: 1rem;
}

.cart-icon {
  color: #e1a76c;
  transition: color 0.3s ease;
}

.cart-icon:hover {
  color: #B0671E;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 12px;
}

/* ✨ Utilitaires Clickshop - Couleurs personnalisées Nude Gray */
.text-clickshop {
  color: #B0671E !important;
}

.bg-clickshop {
  background-color: #B0671E !important;
}

.bg-clickshop-light {
  background-color: #83592f !important;
}

.bg-clickshop-accent {
  background-color: #e1a76c !important;
}

.border-clickshop {
  border-color: #B0671E !important;
}

.text-clickshop-light {
  color: #83592f !important;
}

.text-clickshop-accent {
  color: #e1a76c !important;
}

/* Hover states */
.hover\:bg-clickshop:hover {
  background-color: rgb(168, 122, 84) !important;
}

.hover\:bg-clickshop-light:hover {
  background-color: #c48d5d !important;
}

.hover\:text-clickshop:hover {
  color: #c48d5d !important;
}

/* Focus states */
.focus\:ring-clickshop:focus { 
  --tw-ring-color: #B0671E !important;
  box-shadow: 0 0 0 3px rgba(158, 104, 64, 0.3) !important;
}

.focus\:border-clickshop:focus { 
  border-color: #B0671E !important; 
}

/* Classes utilitaires manquantes */
.container { 
  width: 100%; 
  max-width: 1200px; 
  margin-left: auto; 
  margin-right: auto; 
  padding-left: 1rem; 
  padding-right: 1rem; 
}

.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-8 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-12 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* Flexbox */
.flex { display: flex !important; }
.hidden { display: none !important; }
.flex-col { flex-direction: column !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.items-center { align-items: center !important; }
.flex-1 { flex: 1 1 0% !important; }
.space-x-2 > * + * { margin-left: 0.5rem !important; }
.space-x-4 > * + * { margin-left: 1rem !important; }

/* Grid */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }

/* Responsive */
@media (min-width: 769px) {
  .md\:flex { display: flex !important; }
  .md\:hidden { display: none !important; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* Ombre et bordures */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-full { border-radius: 9999px !important; }
.border { border-width: 1px !important; border-style: solid !important; }
.border-2 { border-width: 2px !important; border-style: solid !important; }
.border-t { border-top-width: 1px !important; border-top-style: solid !important; }

/* Text */
.text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }
.text-center { text-align: center !important; }
.text-white { color: white !important; }

/* Couleurs neutres */
.text-gray-400 { color: #fad3ac !important; }
.text-gray-500 { color: #d7a675 !important; }
.text-gray-600 { color: #dea872 !important; }
.text-gray-700 { color: #b17c47 !important; }
.text-gray-900 { color: #83592f !important; }
.bg-gray-50 { background-color: #f9fafb !important; }
.bg-gray-100 { background-color: #f3f4f6 !important; }
.bg-gray-200 { background-color: #e0b182 !important; }
.bg-gray-900 { background-color: #83592f !important; }
.border-gray-200 { border-color: #fff0 !important; }
.border-gray-300 { border-color: #d1d5db !important; }

/* Position */
.sticky { position: sticky !important; }
.top-0 { top: 0 !important; }
.top-12 { top: 3rem !important; }
.fixed { position: fixed !important; }
.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
.right-0 { right: 0 !important; }

/* Z-index */
.z-30 { z-index: 30 !important; }
.z-40 { z-index: 40 !important; }
.z-50 { z-index: 50 !important; }

/* Transitions */
.transition { transition-property: all !important; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important; transition-duration: 150ms !important; }
.transition-transform { transition-property: transform !important; }
.duration-200 { transition-duration: 200ms !important; }
.duration-300 { transition-duration: 300ms !important; }

/* Overflow */
.overflow-x-auto { overflow-x: auto !important; }
.overflow-y-auto { overflow-y: auto !important; }

/* Largeurs et hauteurs */
.w-5 { width: 1.25rem !important; }
.w-16 { width: 4rem !important; }
.w-64 { width: 16rem !important; }
.w-80 { width: 20rem !important; }
.w-full { width: 100% !important; }
.h-5 { height: 1.25rem !important; }
.h-16 { height: 4rem !important; }
.h-full { height: 100% !important; }

/* Espacements margin */
.mt-1 { margin-top: 0.25rem !important; }
.mt-16 { margin-top: 4rem !important; }
.mx-8 { margin-left: 2rem !important; margin-right: 2rem !important; }

/* Position absolue */
.absolute { position: absolute !important; }
.-top-2 { top: -0.5rem !important; }
.-right-2 { right: -0.5rem !important; }
.right-3 { right: 0.75rem !important; }
.top-3 { top: 0.75rem !important; }

/* Background opacity */
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2) !important; }
.bg-white\/30 { background-color: rgba(255, 255, 255, 0.3) !important; }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5) !important; }

/* Opacity */
.opacity-0 { opacity: 0 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-80 { opacity: 0.8 !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }
.pointer-events-none { pointer-events: none !important; }

/* Whitespace */
.whitespace-nowrap { white-space: nowrap !important; }

/* Transform */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important; }
.translate-x-full { --tw-translate-x: 100% !important; }
.translate-x-0 { --tw-translate-x: 0 !important; }
.hover\:scale-110:hover { --tw-scale-x: 1.1 !important; --tw-scale-y: 1.1 !important; }
.hover\:scale-125:hover { --tw-scale-x: 1.25 !important; --tw-scale-y: 1.25 !important; }

/* Animation pour le toast */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out !important;
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slide-out-left {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* Classes utilitaires */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse-soft {
  animation: pulse-soft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-slide-in-left {
  animation: slide-in-left 0.3s ease-out forwards;
}

.animate-slide-out-left {
  animation: slide-out-left 0.3s ease-out forwards;
}

/* CORRECTION DU GRID */
.grid {
  display: grid !important;
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  gap: 2rem !important;
}

/* Sur tablette (md) */
@media (min-width: 769px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Sur desktop (lg) */
@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Styles pour le bouton de menu mobile */
button[onclick*="toggleMobileMenu"],
.mobile-menu-toggle {
  background: none;
  border: none;
  color: #333;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
  display: block !important; /* Toujours visible */
}

button[onclick*="toggleMobileMenu"]:hover,
.mobile-menu-toggle:hover {
  color: #e1a76c;
}

/* Sur desktop, masquer le bouton menu */
@media (min-width: 769px) {
  button[onclick*="toggleMobileMenu"],
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* Animation pour le menu mobile */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}

.animate-slide-out-right {
  animation: slideOutRight 0.3s ease-out forwards;
}

/* Fermer le bouton dans le menu mobile */
.close-btn {
  font-size: 28px;
  background: none;
  border: none;
  color: #333;
  padding: 0;
  cursor: pointer;
}

.close-btn:hover {
  color: #e1a76c;
}

/* Styles spécifiques pour le contenu du menu mobile */
#mobileMenu h3 {
  color: #B0671E;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

#mobileMenu a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #4b5563;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

#mobileMenu a:hover {
  background-color: #f3f4f6;
  color: #B0671E;
}

#mobileMenu a i {
  width: 1.5rem;
  text-align: center;
  margin-right: 0.75rem;
}

/* Styles pour la barre de recherche mobile */
#mobileMenu input[name="q"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

#mobileMenu input[name="q"]:focus {
  outline: none;
  border-color: #B0671E;
  box-shadow: 0 0 0 3px rgba(176, 103, 30, 0.1);
}