/* ========================================
   WYDRAX ON ROAD - CUSTOM STYLES (OPTIMIZED)
   ======================================== */

/* ========== FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

* {
  font-family: 'Space Grotesk', sans-serif;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Parallax effect for hero sections */
.parallax {
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fade in on scroll */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide in from left */
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide in from right */
.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up on scroll */
.scale-up {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-up.visible {
  opacity: 1;
  transform: scale(1);
}

/* ========== NAVIGATION ========== */
.nav-link {
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: black;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Navbar scroll effect */
.navbar-scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
}

/* ========== CARDS ========== */
.card-hover {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  will-change: transform;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ========== ANIMATIONS ========== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.promo-success {
  animation: slideIn 0.3s ease;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* ========== PRODUCT OVERLAY ========== */
.product-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Désactiver l'overlay au hover - PAS de couleur sur l'image */
.card-hover:hover .product-overlay {
  opacity: 0 !important;
}

/* Désactiver l'overlay pour produits hors stock */
.product-card.out-of-stock .product-overlay {
  display: none !important;
}

/* ========== SIZE & COLOR OPTIONS ========== */
.size-option,
.color-option {
  transition: all 0.2s ease;
  cursor: pointer;
}

.size-option:hover {
  border-color: black;
  transform: scale(1.05);
}

.size-option.active {
  background: black;
  color: white;
  border-color: black;
}

.color-option {
  position: relative;
}

.color-option.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.color-option.active.light::after {
  color: black;
}

/* ========== MODAL ========== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========== SHOP FILTERS (Style Nav) ========== */
.category-filter {
  position: relative;
  padding: 0.5rem 1rem;
  background: transparent !important;
  border: none !important;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.1em;
  transition: color 0.3s ease;
}

.category-filter::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: black;
  transition: width 0.3s ease;
}

.category-filter:hover {
  color: black;
}

.category-filter:hover::after {
  width: 100%;
}

.category-filter.active {
  color: black !important;
  font-weight: 700;
}

.category-filter.active::after {
  width: 100%;
}

/* ========== CART ========== */
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: black;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.cart-badge.bounce {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 450px;
  height: 100vh;
  background: white;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.cart-panel.active {
  transform: translateX(0);
}

.cart-item {
  transition: all 0.3s ease;
}

.cart-item:hover {
  background: #f9fafb;
}

/* ========== LOADING STATES ========== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== RESPONSIVE ========== */

/* Mobile (0-640px) */
@media (max-width: 640px) {
  h1 { font-size: 2.5rem !important; }
  h2 { font-size: 2rem !important; }
  .product-card h3 { font-size: 0.875rem; }
  .product-card p { font-size: 0.75rem; }
  .modal-content { padding: 1rem !important; }
  #modalTitle { font-size: 1.5rem !important; }
  #modalPrice { font-size: 1.25rem !important; }
  .cart-panel { max-width: 100%; }
  footer { padding: 2rem 1.5rem !important; }
  .category-filter { font-size: 0.75rem; padding: 0.5rem 0.75rem; }
  #sortSelect { width: 100%; margin-top: 0.5rem; }
  #featuredGrid { grid-template-columns: repeat(2, 1fr) !important; gap: 1.5rem !important; }
  .sticky { position: relative !important; top: 0 !important; }
}

/* Tablet (641-1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  #hoodiesGrid, #teesGrid, #allProductsGrid { grid-template-columns: repeat(3, 1fr) !important; }
  #featuredGrid { grid-template-columns: repeat(3, 1fr) !important; }
  .cart-panel { max-width: 400px; }
  .modal-content { max-width: 700px; }
}

/* Large screens (1024px+) */
@media (min-width: 1024px) {
  .card-hover:hover { transform: translateY(-8px); }
  .product-overlay { display: flex; }
}

/* Touch devices - remove hover effects */
@media (hover: none) and (pointer: coarse) {
  .card-hover:hover { transform: none; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
  .product-overlay { opacity: 0; }
  .nav-link:hover::after { width: 0; }
  .category-filter:hover::after { width: 0; }
}

/* Landscape mobile */
@media (max-width: 920px) and (orientation: landscape) {
  #about { padding-top: 8rem !important; padding-bottom: 4rem !important; }
  .modal-content { max-height: 85vh; }
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Animation de rebond pour l'icône du panier */
.cart-bounce {
  animation: cart-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cart-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Style pour le message d'erreur dans le modal */
#modalError {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}



/* ========================================
   STYLES POUR RÉDUCTIONS / PROMOTIONS
   ======================================== */

/* Badge de réduction (coin haut gauche) */
.discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
  z-index: 10;
  letter-spacing: 0.05em;
}

/* Conteneur des prix (normal + barré) */
.price-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Prix original barré */
.original-price {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Prix en promotion (en rouge/accentué) */
.promo-price {
  color: #dc2626;
  font-weight: 700;
  font-size: 0.875rem;
}