/* ========== CATALOGUE.CSS - VERSION COMPLÈTE ========== */


:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-body: #f5f0eb;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-blue: 0 2px 8px 0 rgba(37, 99, 235, 0.15);
  --transition: all 0.2s ease;
  --header-height: 70px;
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--header-height);
}

/* ========== HEADER FIXE ========== */
.app-header {
  background: white;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
}

.brand-container {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 8px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
  transition: var(--transition);
}

.brand-icon:hover {
  transform: scale(1.05) rotate(3deg);
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: none;
}

@media (min-width: 480px) {
  .brand {
    display: inline;
    font-size: 1.3rem;
  }
}

.search-container {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-container .form-control {
  width: 100%;
  height: 40px;
  font-size: 0.9rem;
  background-color: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 40px;
  padding-left: 40px;
  padding-right: 16px;
  transition: var(--transition);
  font-family: 'Poppins', sans-serif;
}

.search-container .form-control:focus {
  background-color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: var(--transition);
}

.search-container .form-control:focus + .search-icon {
  color: var(--primary);
}

.panier-container {
  position: relative;
  flex-shrink: 0;
}

.panier-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  border: none;
}

.panier-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.4);
}

.panier-compteur {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
  animation: popIn 0.3s ease;
}

/* ========== BANNIÈRE HERO ========== */
.hero-banner {
  background: #f5f0eb;
  padding: 20px 16px;
  text-align: center;
  border-bottom: 3px solid var(--primary);
}

.hero-banner h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hero-banner p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.hero-features {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
  flex-wrap: wrap;
}

.feature-badge {
  background: var(--primary);
  color: white;
  padding: 5px 15px;
  border-radius: 30px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.feature-badge.warning {
  background: var(--warning);
}

/* ========== CATÉGORIES ========== */
.categories-banner {
  background: white;
  padding: 12px 0 4px 0;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  z-index: 999;
}

.categories-scroll {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px 8px 16px;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

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

.category-link.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.category-count {
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 30px;
  transition: var(--transition);
}

.category-link.active .category-count {
  background: var(--primary);
  color: white;
}

/* ========== CARROUSEL ========== */
.carousel-section {
  width: 100%;
  margin: 0 0 24px 0;
  background: linear-gradient(180deg, #f5f0eb 0%, #ffffff 100%);
}

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-inner {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-item {
  flex: 0 0 100%;
  height: 220px;
  position: relative;
}

@media (min-width: 768px) {
  .carousel-item {
    height: 350px;
  }
}

@media (min-width: 1200px) {
  .carousel-item {
    height: 450px;
  }
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 100%);
  z-index: 1;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 50px 30px 30px;
  z-index: 2;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.carousel-caption h5 {
  font-size: 1.4rem;
  font-weight: 600;
  color: white;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .carousel-caption h5 {
    font-size: 1.2rem;
  }
}

.carousel-caption .product-price {
  font-size: 1.2rem;
  font-weight: 500;
  color: #ffd700;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.carousel-caption .btn-decouvrir {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--primary);
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.carousel-caption .btn-decouvrir:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
}

.carousel-indicators button.active {
  background: white;
  width: 28px;
}

.carousel-control-prev,
.carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 3;
  transition: var(--transition);
  display: none;
}

@media (min-width: 768px) {
  .carousel-control-prev,
  .carousel-control-next {
    display: flex;
  }
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.carousel-position {
  position: absolute;
  bottom: 15px;
  right: 20px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  color: white;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  z-index: 3;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ========== TITRES CATÉGORIES ========== */
.category-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  border-left: 4px solid var(--primary);
  padding-left: 12px;
  margin: 20px 16px 12px 16px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== GRILLE PRODUITS ========== */
.products-grid {
  max-width: 1400px;
  margin: 0 auto 30px auto;
  padding: 0 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  .products-grid {
    gap: 12px;
    padding: 0 16px;
  }
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 20px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.product-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-blue);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
}

.card-img-container {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.card-img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

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

.status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 600;
  background: white;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  text-transform: uppercase;
}

.status-badge.disponible {
  background: var(--success);
  color: white;
}

.status-badge.indisponible {
  background: var(--danger);
  color: white;
}

.modeles-count {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.6rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
}

.card-content {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  width: 100%;
}

.price-share-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.product-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.share-btn {
  width: 28px;
  height: 28px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  padding: 0;
}

.share-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* ========== MODAL PRODUIT ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  overflow-y: auto;
}

.modal.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  max-width: 100%;
  min-height: 100%;
  margin: 0;
  background: white;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@media (min-width: 768px) {
  .modal-dialog {
    max-width: 600px;
    min-height: auto;
    margin: 40px auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title i {
  color: var(--primary);
}

.modal-header .btn-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-header .btn-close:hover {
  background: #fee2e2;
  color: var(--danger);
}

.modal-body {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.modal-product-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.modal-product-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.modal-product-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-product-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-product-description {
  background: #f8fafc;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.modal-product-description h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-product-description h3 i {
  color: var(--primary);
}

.description-text {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.modeles-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 20px 0 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modeles-count-badge {
  background: #f1f5f9;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.modeles-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.modele-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  background: white;
  transition: var(--transition);
}

.modele-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.modele-image {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #f1f5f9;
}

.modele-details {
  flex: 1;
  min-width: 0;
}

.modele-nom {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modele-vendeur {
  font-size: 0.85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modele-prix {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.btn-ajouter-panier {
  padding: 10px 18px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-ajouter-panier:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-ajouter-panier:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--text-muted);
}

.btn-ajouter-panier.ajoute {
  background: var(--success);
}

.modal-footer {
  display: flex;
  justify-content: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
}

.modal-close-btn {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  border: none;
  padding: 14px 50px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
  min-width: 200px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-close-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

.modal-close-btn:active {
  transform: translateY(0);
}

/* ========== MODAL MOBILE ========== */
@media (max-width: 480px) {
  .modal-product-img {
    height: 180px;
  }
  
  .modal-product-title {
    font-size: 1.2rem;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-overflow: clip;
  }
  
  .modal-product-price {
    font-size: 1.3rem;
    margin-bottom: 12px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .modal-product-description {
    padding: 12px;
  }
  
  .modal-product-description h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }
  
  .description-text {
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-overflow: clip;
    max-height: none;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
  }
  
  .modeles-title {
    font-size: 1rem;
    margin: 12px 0 8px;
  }
  
  .modeles-count-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
  
  .modele-card {
    padding: 8px;
    gap: 8px;
    align-items: flex-start;
  }
  
  .modele-image {
    width: 45px;
    height: 45px;
  }
  
  .modele-nom {
    font-size: 0.8rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-overflow: clip;
    max-width: 100%;
  }
  
  .modele-vendeur {
    font-size: 0.65rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-overflow: clip;
    max-width: 100%;
  }
  
  .modele-prix {
    font-size: 0.8rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .btn-ajouter-panier {
    padding: 6px 10px;
    font-size: 0.7rem;
    gap: 4px;
    white-space: nowrap;
  }
  
  .btn-ajouter-panier i {
    font-size: 0.75rem;
  }
  
  .modal-close-btn {
    padding: 10px 30px;
    font-size: 0.9rem;
    min-width: 140px;
  }
}

@media (max-width: 360px) {
  .btn-ajouter-panier {
    padding: 5px 8px;
    font-size: 0.65rem;
    white-space: nowrap;
  }
  
  .btn-ajouter-panier i {
    display: none;
  }
}

/* ========== PANIER MODERNE - HEADER RÉDUIT ========== */

/* Offcanvas principal */
.offcanvas {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: #ffffff;
  z-index: 1500;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.offcanvas.show {
  right: 0;
}

@media (max-width: 480px) {
  .offcanvas {
    max-width: 100%;
  }
}

/* Header du panier - RÉDUIT */
.offcanvas-header {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
}

.offcanvas-header h5 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: white;
}

.offcanvas-header h5 i {
  font-size: 1.1rem;
}

.offcanvas-header .btn-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.offcanvas-header .btn-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Corps du panier */
.offcanvas-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #f8fafc;
  padding: 0;
}

/* Zone scrollable */
.panier-scrollable-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 0 16px;
  scroll-behavior: auto;
}

.panier-scrollable-content::-webkit-scrollbar {
  width: 4px;
}

.panier-scrollable-content::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 10px;
}

.panier-scrollable-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* Informations acheteur */
.buyer-info {
  background: white;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.buyer-info .d-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.buyer-info h5 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.buyer-info h5 i {
  color: var(--primary);
  font-size: 0.9rem;
}

.btn-clear-cart {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-clear-cart:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.buyer-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  font-family: 'Poppins', sans-serif;
  background: white;
  margin-bottom: 10px;
}

.buyer-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.phone-input-group {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  background: white;
}

.phone-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.phone-prefix {
  background: #f8fafc;
  padding: 0 12px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  border-right: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

.phone-input-group .buyer-input {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

.phone-input-group .buyer-input:focus {
  box-shadow: none;
}

/* Liste des articles */
.panier-articles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panier-article {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: white;
  border-radius: 16px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-height: 100px;
}

.panier-article:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--shadow-md);
}

.panier-article.updating {
  background-color: rgba(37, 99, 235, 0.05);
}

.panier-article-image {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  background: #f8fafc;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .panier-article-image {
    width: 60px;
    height: 60px;
  }
  .panier-article {
    min-height: 90px;
  }
}

.panier-article-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panier-article-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.panier-article-nom {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.panier-article-prix {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.panier-article-modele {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 20px;
  width: fit-content;
}

.panier-article-vendeur {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.panier-article-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.panier-article-actions .btn-outline-danger {
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid #e5e7eb;
  color: var(--text-muted);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.panier-article-actions .btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

/* Sélecteur de quantité */
.panier-article-actions .quantity-selector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border-radius: 30px;
  padding: 3px;
}

.panier-article-actions .quantity-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.panier-article-actions .quantity-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.panier-article-actions .quantity-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.panier-article-actions .quantity-value {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 24px;
  text-align: center;
  color: var(--text-main);
}

/* Pied du panier */
.panier-footer-fixed {
  flex-shrink: 0;
  background: white;
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
  position: relative;
  padding: 16px;
}

.panier-recap {
  margin-bottom: 12px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.price-row.total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.price-row.total span:last-child {
  color: var(--primary);
  font-size: 1.1rem;
}

.cart-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .cart-actions {
    flex-direction: column;
    gap: 8px;
  }
}

.btn-continue {
  flex: 1;
  background: #f1f5f9;
  border: none;
  border-radius: 40px;
  padding: 10px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-continue:hover {
  background: #e2e8f0;
}

.btn-checkout {
  flex: 2;
  background: linear-gradient(135deg, #25D366, #128C7E);
  border: none;
  border-radius: 40px;
  padding: 10px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-checkout:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-checkout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Panier vide */
.empty-cart {
  padding: 40px 20px;
  text-align: center;
  background: white;
  border-radius: 20px;
  margin: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-cart h5 {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.empty-cart p {
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.empty-cart .btn-shop {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  border: none;
  border-radius: 40px;
  padding: 10px 24px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.empty-cart .btn-shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Animation d'entrée */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.offcanvas.show {
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive panier */
@media (max-width: 480px) {
  .panier-scrollable-content {
    padding: 12px;
  }
  
  .buyer-info {
    padding: 12px;
  }
  
  .panier-footer-fixed {
    padding: 12px;
  }
  
  .empty-cart {
    padding: 30px 16px;
    margin: 12px;
    min-height: 300px;
  }
  
  .empty-icon {
    font-size: 2.5rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .offcanvas {
    background: #111827;
  }
  
  .offcanvas-body {
    background: #111827;
  }
  
  .buyer-info,
  .panier-article,
  .panier-footer-fixed,
  .empty-cart {
    background: #1f2937;
    border-color: #374151;
  }
  
  .buyer-input,
  .phone-input-group {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
  }
  
  .phone-prefix {
    background: #1f2937;
    border-color: #374151;
  }
  
  .panier-article-modele {
    background: #374151;
  }
  
  .panier-article-vendeur {
    color: #9ca3af;
  }
  
  .btn-continue {
    background: #374151;
    color: #f3f4f6;
  }
  
  .btn-continue:hover {
    background: #4b5563;
  }
  
  .panier-article-actions .quantity-selector {
    background: #374151;
  }
  
  .panier-article-actions .quantity-btn {
    background: #1f2937;
    color: #60a5fa;
  }
  
  .price-row.total {
    border-top-color: #374151;
  }
  
  .empty-cart h5 {
    color: #f3f4f6;
  }
  
  .empty-cart p {
    color: #9ca3af;
  }
}

/* ========== NOTIFICATIONS ========== */
.notification-panier {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 40px;
  background: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3000;
  border-left: 4px solid;
  min-width: 260px;
  max-width: 90%;
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideUp 0.3s ease;
}

@media (max-width: 480px) {
  .notification-panier {
    width: 90%;
    min-width: auto;
    padding: 8px 14px;
    font-size: 0.75rem;
    bottom: 10px;
  }
}

.notification-success {
  border-left-color: var(--success);
}

.notification-success i {
  color: var(--success);
}

.notification-danger {
  border-left-color: var(--danger);
}

.notification-danger i {
  color: var(--danger);
}

.notification-warning {
  border-left-color: var(--warning);
}

.notification-warning i {
  color: var(--warning);
}

.notification-info {
  border-left-color: var(--primary);
}

.notification-info i {
  color: var(--primary);
}

.notification-fade-out {
  opacity: 0;
  transform: translate(-50%, -20px);
  transition: all 0.3s ease;
}

/* ========== BOUTON RETOUR HAUT ========== */
.scroll-to-top {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 900;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

@media (max-width: 480px) {
  .scroll-to-top {
    bottom: 60px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

/* ========== LOADING ========== */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
  min-height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

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

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

/* ========== FOOTER ========== */
footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  footer {
    padding: 15px 0;
    font-size: 0.75rem;
  }
}

/* ========== RESPONSIVE GLOBAL ========== */
@media (max-width: 480px) {
  :root {
    --header-height: 60px;
  }

  .header-container {
    padding: 6px 12px;
    gap: 8px;
  }
  
  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  
  .search-container .form-control {
    height: 36px;
    font-size: 0.8rem;
    padding-left: 36px;
  }
  
  .panier-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .categories-scroll {
    padding: 0 12px 6px 12px;
    gap: 16px;
  }
  
  .category-link {
    font-size: 0.75rem;
  }
  
  .hero-banner {
    padding: 16px 12px;
  }
  
  .hero-banner h2 {
    font-size: 1.2rem;
    flex-direction: column;
    gap: 5px;
  }
  
  .feature-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
  }
  
  .carousel-item {
    height: 180px;
  }
  
  .carousel-caption {
    padding: 30px 16px 20px;
  }
  
  .carousel-caption h5 {
    font-size: 1rem;
  }
  
  .carousel-caption .product-price {
    font-size: 0.9rem;
  }
  
  .carousel-caption .btn-decouvrir {
    padding: 6px 16px;
    font-size: 0.75rem;
  }
  
  .products-grid {
    padding: 0 8px;
    gap: 6px;
  }
  
  .product-name {
    font-size: 0.7rem;
  }
  
  .product-price {
    font-size: 0.75rem;
  }
  
  .share-btn {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }
}

/* ========== SOLUTION CSS ========== */
.card-img-container {
    position: relative;
    overflow: hidden;
}

.card-img-container::after {
    content: "🛒 Voir les modèles";
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--primary), var(--primary-dark));
    color: white;
    text-align: center;
    padding: 12px 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: bottom 0.2s ease;
    z-index: 5;
    pointer-events: none;
}

@media (hover: hover) {
    .product-card:hover .card-img-container::after {
        bottom: 0;
    }
}

@media (hover: none) {
    .product-card:active .card-img-container::after {
        bottom: 0;
    }
}

@media (max-width: 768px) {
    .card-img-container::after {
        content: "🛒 Voir les modèles";
        font-size: 0.8rem;
        padding: 10px 6px;
        bottom: -45px;
    }
}

@media (max-width: 480px) {
    .card-img-container::after {
        content: "🛒 Modèles";
        font-size: 0.7rem;
        padding: 8px 4px;
        bottom: -40px;
    }
}

@media (max-width: 360px) {
    .card-img-container::after {
        content: "🛒";
        background: var(--primary);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        bottom: 10px;
        right: 10px;
        left: auto;
        font-size: 1.2rem;
        border: 2px solid white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
}