:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --dark: #1f2937;
  --light: #f9fafb;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f3f4f6;
}

.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #0c4a6e 50%, #164e63 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Effet de lumière centrale permanente */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
  pointer-events: none;
  animation: glow-pulse 4s ease-in-out infinite;
}

/* Rideau gauche - texture boutique */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: 
    linear-gradient(to right, 
      #0a0f1f 0%, 
      #0f172a 40%, 
      #1e293b 75%, 
      rgba(30, 41, 59, 0.8) 90%, 
      transparent 100%);
  z-index: 100;
  animation: curtain-left 2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.8),
              inset -2px 0 10px rgba(6, 182, 212, 0.1);
}

/* Animation du rideau gauche - mouvement fluide */
@keyframes curtain-left {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(-100%);
    opacity: 0;
  }
}

/* Animation de pulsation lumineuse douce */
@keyframes glow-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 
    0 0 30px rgba(6, 182, 212, 0.7), 
    0 0 60px rgba(6, 182, 212, 0.4),
    2px 2px 6px rgba(0,0,0,0.4);
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: 
    fade-slide-up 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.8s forwards,
    glow-text 2s ease-in-out 2s infinite;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  animation: fade-slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) 2.1s forwards;
}

/* Animation fade-in avec slide-up et scale */
@keyframes fade-slide-up {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    filter: blur(4px);
  }
  70% {
    opacity: 0.8;
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

/* Effet de pulsation lumineuse sur le texte */
@keyframes glow-text {
  0%, 100% {
    text-shadow: 
      0 0 30px rgba(6, 182, 212, 0.7), 
      0 0 60px rgba(6, 182, 212, 0.4),
      2px 2px 6px rgba(0,0,0,0.4);
  }
  50% {
    text-shadow: 
      0 0 40px rgba(6, 182, 212, 0.9), 
      0 0 80px rgba(6, 182, 212, 0.6),
      2px 2px 6px rgba(0,0,0,0.4);
  }
}

/* Animation des badges avec rebond */
.hero .flex {
  animation: 
    fade-slide-up 1s cubic-bezier(0.16, 1, 0.3, 1) 2.4s forwards,
    float-badges 3s ease-in-out 3.5s infinite;
  opacity: 0;
}

/* Effet de flottement des badges */
@keyframes float-badges {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Rideau droit - texture boutique symétrique */
.hero-curtain-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: 
    linear-gradient(to left, 
      #0a0f1f 0%, 
      #0f172a 40%, 
      #1e293b 75%, 
      rgba(30, 41, 59, 0.8) 90%, 
      transparent 100%);
  z-index: 100;
  animation: curtain-right 2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.8),
              inset 2px 0 10px rgba(6, 182, 212, 0.1);
}

/* Animation du rideau droit - mouvement fluide */
@keyframes curtain-right {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Éclat de lumière centrale à l'ouverture */
.hero-curtain-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  right: -50%;
  bottom: 0;
  background: 
    radial-gradient(ellipse at center, rgba(6, 182, 212, 0.6) 0%, rgba(59, 130, 246, 0.3) 30%, transparent 70%);
  animation: light-burst 2s ease-out forwards;
  opacity: 0;
  z-index: -1;
}

/* Éclat lumineux dramatique */
@keyframes light-burst {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
  60% {
    opacity: 0.6;
    transform: scale(1.5);
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}

/* Particules lumineuses flottantes */
.hero-curtain-right::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle, rgba(6, 182, 212, 0.8) 1px, transparent 1px),
    radial-gradient(circle, rgba(59, 130, 246, 0.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(103, 232, 249, 0.7) 1px, transparent 1px);
  background-size: 100px 100px, 150px 150px, 80px 80px;
  background-position: 0 0, 40px 40px, 70px 70px;
  animation: particles-float 2s ease-out forwards;
  opacity: 0;
  z-index: -1;
}

/* Animation des particules */
@keyframes particles-float {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-50px);
  }
}

.product-card {
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card > div {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card .flex-1 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--secondary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge.promo {
  background: #ef4444;
}

.cart-icon {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.filter-btn {
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

.btn-primary {
  background: var(--primary);
  color: white;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary);
}

.original-price {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 1.125rem;
}

/* Animation individuelle pour chaque badge */
.hero .flex > div:nth-child(1) {
  animation-delay: 2.4s;
}

.hero .flex > div:nth-child(2) {
  animation-delay: 2.6s;
}

.hero .flex > div:nth-child(3) {
  animation-delay: 2.8s;
}

.hero .flex > div {
  animation: badge-appear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0.8) translateY(20px);
}

@keyframes badge-appear {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(40px) rotate(-5deg);
  }
  70% {
    transform: scale(1.05) translateY(-5px) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0deg);
  }
}

/* Effet hover amélioré sur les badges */
.hero .flex > div {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.hero .flex > div:hover {
  transform: translateY(-5px) scale(1.05);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3);
}

/* Ligne de séparation animée (optionnelle) */
.hero::before {
  animation: glow-pulse 4s ease-in-out infinite, expand-glow 2s ease-out forwards;
}

@keyframes expand-glow {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .hero .flex {
    flex-direction: column;
    align-items: center;
  }
  
  .hero .flex > div {
    width: 100%;
    max-width: 300px;
  }
}

/* Ajustement pour les images de tablettes */
.product-card img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  object-position: center;
  padding: 1rem;
  background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
}

/* Style spécial pour les tablettes avec plus d'espace */
.product-card[data-category="Tablettes"] img {
  height: 280px;
  object-fit: contain;
  padding: 1.5rem;
}

/* Style pour les portables */
.product-card[data-category="Portables"] img {
  height: 250px;
  object-fit: contain;
  padding: 1rem;
}

/* Style pour les smartphones - optimisé pour meilleure visibilité */
.product-card[data-category="Smartphones"] img {
  height: 280px;
  object-fit: contain;
  object-position: center;
  padding: 1.5rem;
  background: linear-gradient(to bottom, #f9fafb 0%, #ffffff 100%);
}

/* Assurer que toutes les cartes de produits ont la même hauteur */
#products-container {
  display: grid;
  grid-auto-rows: 1fr;
}

#products-container > .product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 550px;
}

#products-container .product-card > div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Responsive: ajuster la hauteur minimale pour mobile */
@media (max-width: 768px) {
  #products-container > .product-card {
    min-height: auto;
  }
}
