/* ============================================
   PANIER MODERN 2026 - Design mobile-first
   Cahier des charges : Vue Panier Premium Marketplace
   ============================================ */

/* ============================================
   1. HEADER PANIER
   ============================================ */
.panier-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-primary, #fff);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.panier-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panier-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary, #f3f4f6);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary, #111827);
}

.panier-back-btn:active {
  transform: scale(0.92);
}

.panier-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

.panier-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panier-header-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary, #f3f4f6);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary, #6b7280);
  font-size: 16px;
}

.panier-header-btn:active {
  transform: scale(0.92);
  background: var(--border-color, #d1d5db);
}

/* ============================================
   2. OVERLAY & DRAWER (mobile slide-up)
   ============================================ */
.panier-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.panier-drawer {
  position: relative;
  background: var(--bg-primary, #fff);
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.panier-drawer.active {
  display: flex;
}

.panier-drawer-handle {
  display: none;
}

/* ============================================
   3. RÉSUMÉ GLOBAL (above the fold)
   ============================================ */
.panier-global-summary {
  padding: 12px 16px 8px;
  flex-shrink: 0;
}

.panier-global-summary-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 14px;
  padding: 12px 16px;
  gap: 12px;
}

.panier-global-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panier-global-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.panier-global-count span {
  color: var(--accent-color, #3b82f6);
}

.panier-global-sub {
  font-size: 12px;
  color: var(--text-tertiary, #9ca3af);
}

.panier-global-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-color, #3b82f6);
  text-align: right;
  white-space: nowrap;
}

.panier-free-shipping-bar {
  margin: 8px 16px 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  font-size: 12px;
  color: var(--success-color, #059669);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.panier-free-shipping-bar .progress-track {
  flex: 1;
  height: 4px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.panier-free-shipping-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-color, #059669), #34d399);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.panier-free-shipping-bar .progress-text {
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================
   4. BATCH ACTIONS BAR
   ============================================ */
.panier-batch-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-secondary, #f3f4f6);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  flex-shrink: 0;
}

.panier-batch-bar.active {
  display: flex;
}

.panier-batch-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-color, #d1d5db);
  accent-color: var(--accent-color, #3b82f6);
  cursor: pointer;
}

.panier-batch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  flex: 1;
}

.panier-batch-actions {
  display: flex;
  gap: 6px;
}

.panier-batch-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #d1d5db);
  background: var(--bg-primary, #fff);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary, #6b7280);
}

.panier-batch-btn:hover {
  background: var(--bg-secondary, #f3f4f6);
}

.panier-batch-btn.danger {
  color: var(--danger-color, #ef4444);
  border-color: rgba(239, 68, 68, 0.2);
}

.panier-batch-btn.danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* ============================================
   5. LISTE DES ARTICLES
   ============================================ */
.panier-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
  display: none;
}

.panier-items-container.active {
  display: block;
}

.panier-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color, #f3f4f6);
  transition: all 0.2s ease;
  position: relative;
}

.panier-item:active {
  transform: scale(0.99);
}

.panier-item.out-of-stock {
  opacity: 0.6;
}

.panier-item-check {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

.panier-item-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border-color, #d1d5db);
  accent-color: var(--accent-color, #3b82f6);
  cursor: pointer;
}

.panier-item-image-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary, #f3f4f6);
  cursor: pointer;
  position: relative;
}

.panier-item-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.panier-item-image-wrap:active img {
  transform: scale(1.05);
}

.panier-item-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary, #9ca3af);
  font-size: 24px;
}

.panier-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.panier-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.panier-item-name:active {
  color: var(--accent-color, #3b82f6);
}

.panier-item-variant {
  font-size: 12px;
  color: var(--text-tertiary, #9ca3af);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.panier-item-variant-tag {
  background: var(--bg-secondary, #f3f4f6);
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
}

/* Stock status badges */
.panier-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
}

.panier-stock-badge.in-stock {
  color: var(--success-color, #059669);
  background: rgba(16, 185, 129, 0.08);
}

.panier-stock-badge.low-stock {
  color: #d97706;
  background: rgba(245, 158, 11, 0.08);
}

.panier-stock-badge.out-of-stock {
  color: var(--danger-color, #ef4444);
  background: rgba(239, 68, 68, 0.08);
}

.panier-item-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.panier-item-unit-price {
  font-size: 12px;
  color: var(--text-tertiary, #9ca3af);
}

.panier-item-unit-price .original {
  text-decoration: line-through;
  margin-right: 4px;
}

.panier-item-unit-price .discounted {
  color: var(--danger-color, #ef4444);
  font-weight: 600;
}

.panier-item-subtotal {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

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

.panier-qty-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 10px;
  padding: 2px;
}

.panier-qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--bg-primary, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary, #111827);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.panier-qty-btn:active {
  transform: scale(0.9);
  background: var(--accent-color, #3b82f6);
  color: white;
}

.panier-qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.panier-qty-value {
  font-size: 15px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
  color: var(--text-primary, #111827);
}

.panier-item-actions {
  display: flex;
  gap: 4px;
}

.panier-item-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-tertiary, #9ca3af);
  font-size: 13px;
}

.panier-item-action-btn:active {
  transform: scale(0.9);
}

.panier-item-action-btn.delete-btn {
  color: var(--danger-color, #ef4444);
}

.panier-item-action-btn.delete-btn:active {
  background: rgba(239, 68, 68, 0.1);
}

.panier-item-action-btn.fav-btn:active {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
}

/* ============================================
   6. RÉSUMÉ & TOTAL
   ============================================ */
.panier-summary {
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-primary, #fff);
  flex-shrink: 0;
}

.panier-summary-content {
  background: var(--bg-secondary, #f9fafb);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.panier-price-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.panier-price-label {
  color: var(--text-secondary, #6b7280);
}

.panier-price-value {
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.panier-price-row.savings .panier-price-label,
.panier-price-row.savings .panier-price-value {
  color: var(--success-color, #059669);
}

.panier-divider {
  border: none;
  height: 1px;
  background: var(--border-color, #e5e7eb);
  margin: 10px 0;
}

.panier-price-row.total {
  padding: 8px 0 4px;
}

.panier-total-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

.panier-total-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-color, #3b82f6);
}

.panier-tax-note {
  font-size: 11px;
  color: var(--text-tertiary, #9ca3af);
  text-align: right;
  margin-top: 2px;
}

/* Coupon info */
.panier-coupon-applied {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--success-color, #059669);
}

.panier-coupon-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

/* CTA buttons */
.panier-cta-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panier-checkout-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-color, #3b82f6), #2563eb);
  color: white;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.panier-checkout-btn:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.panier-checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.panier-secondary-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-secondary, #6b7280);
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.panier-secondary-btn:active {
  background: var(--bg-secondary, #f3f4f6);
  transform: scale(0.98);
}

/* ============================================
   7. RÉASSURANCE BADGES
   ============================================ */
.panier-reassurance {
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.panier-reassurance-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.panier-reassurance-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
}

.panier-reassurance-item i {
  font-size: 14px;
  color: var(--success-color, #059669);
  width: 18px;
  text-align: center;
}

/* ============================================
   8. CROSS-SELL / RECOMMANDATIONS
   ============================================ */
.panier-cross-sell {
  padding: 0 16px 16px;
  flex-shrink: 0;
}

.panier-cross-sell-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panier-cross-sell-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.panier-cross-sell-scroll::-webkit-scrollbar {
  height: 2px;
}

.panier-cross-sell-scroll::-webkit-scrollbar-track {
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 1px;
}

.panier-cross-sell-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color, #d1d5db);
  border-radius: 1px;
}

.panier-cross-sell-card {
  flex-shrink: 0;
  width: 130px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #f3f4f6);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  scroll-snap-align: start;
}

.panier-cross-sell-card:active {
  transform: scale(0.96);
}

.panier-cross-sell-card-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  background: var(--bg-secondary, #f3f4f6);
}

.panier-cross-sell-card-body {
  padding: 8px 10px;
}

.panier-cross-sell-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.panier-cross-sell-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-color, #3b82f6);
  margin-bottom: 6px;
}

.panier-cross-sell-add-btn {
  width: 100%;
  padding: 6px;
  background: var(--accent-color, #3b82f6);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.panier-cross-sell-add-btn:active {
  opacity: 0.8;
  transform: scale(0.96);
}

/* ============================================
   9. ÉTAT VIDE (amélioré)
   ============================================ */
.panier-empty {
  text-align: center;
  padding: 60px 20px 40px;
  display: none;
  flex-direction: column;
  align-items: center;
}

.panier-empty.active {
  display: flex;
}

.panier-empty-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.panier-empty-icon i {
  font-size: 38px;
  color: var(--text-tertiary, #9ca3af);
}

.panier-empty-icon .dot-badge {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--danger-color, #ef4444);
  border-radius: 50%;
  top: 22px;
  right: 26px;
  border: 2px solid var(--bg-primary, #fff);
}

.panier-empty-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin-bottom: 8px;
}

.panier-empty-desc {
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 24px;
  max-width: 280px;
}

.panier-empty-actions {
  display: flex;
  gap: 10px;
  flex-direction: column;
  width: 100%;
  max-width: 300px;
}

.panier-shop-btn {
  padding: 14px 24px;
  background: var(--accent-color, #3b82f6);
  color: white;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.panier-shop-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.panier-empty-link {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  text-decoration: none;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.panier-empty-link:active {
  color: var(--accent-color, #3b82f6);
}

/* Empty recommendations */
.panier-empty-recos {
  margin-top: 32px;
  width: 100%;
  max-width: 340px;
}

.panier-empty-recos-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary, #9ca3af);
  margin-bottom: 12px;
  text-align: center;
}

.panier-empty-recos-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.panier-empty-reco-item {
  flex-shrink: 0;
  width: 100px;
  text-align: center;
}

.panier-empty-reco-item img {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-secondary, #f3f4f6);
  margin-bottom: 6px;
}

.panier-empty-reco-item span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  display: block;
  line-height: 1.2;
}

/* ============================================
   10. SKELETON LOADING
   ============================================ */
.panier-skeleton {
  padding: 8px 16px;
  display: none;
}

.panier-skeleton.active {
  display: block;
}

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

.shimmer {
  background: linear-gradient(90deg, 
    var(--bg-secondary, #f3f4f6) 25%, 
    var(--bg-primary, #fff) 50%, 
    var(--bg-secondary, #f3f4f6) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-panier-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 12px;
}

.skeleton-panier-image {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  flex-shrink: 0;
}

.skeleton-panier-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-secondary, #f3f4f6);
}

.skeleton-line.w-1\/4 { width: 25%; }
.skeleton-line.w-1\/3 { width: 33%; }
.skeleton-line.w-1\/2 { width: 50%; }
.skeleton-line.w-2\/3 { width: 66%; }
.skeleton-line.w-3\/4 { width: 75%; }
.skeleton-line.w-full { width: 100%; }

.skeleton-summary {
  padding: 16px;
  margin: 8px 16px 16px;
  border-radius: 16px;
  background: var(--bg-secondary, #f9fafb);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================
   11. TOAST UNDO
   ============================================ */
.panier-toast-undo {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary, #1f2937);
  color: white;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  max-width: calc(100vw - 40px);
  white-space: nowrap;
}

.panier-toast-undo.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.panier-undo-btn {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panier-undo-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* ============================================
   12. ERROR STATE
   ============================================ */
.panier-error {
  text-align: center;
  padding: 60px 20px;
  display: none;
}

.panier-error.active {
  display: block;
}

.panier-error-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--danger-color, #ef4444);
}

.panier-error-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin-bottom: 8px;
}

.panier-error-desc {
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 20px;
}

.panier-retry-btn {
  padding: 12px 24px;
  background: var(--accent-color, #3b82f6);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panier-retry-btn:active {
  transform: scale(0.97);
}

/* ============================================
   13. HELP / SUPPORT SECTION
   ============================================ */
.panier-help {
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.panier-help-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  width: 100%;
  text-align: left;
}

.panier-help-link:active {
  background: var(--border-color, #e5e7eb);
}

.panier-help-link i {
  font-size: 16px;
  color: var(--accent-color, #3b82f6);
}

/* ============================================
   14. COUPON MODAL
   ============================================ */
.panier-coupon-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.panier-coupon-modal-overlay.active {
  display: flex;
}

.panier-coupon-modal {
  background: var(--bg-primary, #fff);
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.panier-coupon-modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin-bottom: 4px;
}

.panier-coupon-modal p {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 16px;
}

.panier-coupon-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.panier-coupon-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: border-color 0.2s;
  outline: none;
}

.panier-coupon-input:focus {
  border-color: var(--accent-color, #3b82f6);
}

.panier-coupon-apply-btn {
  padding: 12px 20px;
  background: var(--accent-color, #3b82f6);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.panier-coupon-apply-btn:active {
  transform: scale(0.96);
}

.panier-coupon-error {
  font-size: 12px;
  color: var(--danger-color, #ef4444);
  display: none;
  margin-bottom: 8px;
}

.panier-coupon-success {
  font-size: 12px;
  color: var(--success-color, #059669);
  display: none;
  margin-bottom: 8px;
}

.panier-coupon-close {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: var(--text-secondary, #6b7280);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
}

/* ============================================
   15. QUANTITY CONFIRMATION POPOVER
   ============================================ */
.panier-qty-confirm {
  position: absolute;
  top: -30px;
  right: 0;
  background: var(--success-color, #059669);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.panier-qty-confirm.active {
  opacity: 1;
  top: -36px;
}

/* ============================================
   16. RESPONSIVE - TABLET (≥640px)
   ============================================ */
@media (min-width: 640px) {
  .panier-drawer {
    max-width: 520px;
    margin: 0 auto;
    border-radius: 24px;
    max-height: 90vh;
  }

  .panier-item {
    gap: 14px;
    padding: 14px;
  }

  .panier-item-image-wrap {
    width: 90px;
    height: 90px;
  }

  .panier-item-name {
    font-size: 15px;
  }

  .panier-cross-sell-card {
    width: 140px;
  }

  .panier-cross-sell-card-img {
    height: 110px;
  }

  .panier-reassurance-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   17. RESPONSIVE - DESKTOP (≥1024px)
   ============================================ */
@media (min-width: 1024px) {
  .panier-drawer {
    max-width: 900px;
    max-height: 96vh;
    border-radius: 24px;
  }

  .panier-layout-desktop {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    padding: 16px;
    overflow: hidden;
    flex: 1;
  }

  .panier-layout-desktop .panier-items-container {
    padding: 0;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
  }

  .panier-layout-desktop .panier-right-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .panier-layout-desktop .panier-summary {
    padding: 0;
    border-top: none;
    position: sticky;
    top: 0;
  }

  .panier-layout-desktop .panier-cross-sell {
    padding: 0;
  }

  .panier-layout-desktop .panier-reassurance {
    padding: 0;
  }

  .panier-layout-desktop .panier-help {
    padding: 0;
  }

  .panier-layout-desktop .panier-global-summary {
    padding: 0 0 12px;
  }

  .panier-layout-desktop .panier-batch-bar {
    padding: 8px 0;
  }

  .panier-item:hover {
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
  }

  .panier-cross-sell-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .panier-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
  }
}

/* ============================================
   18. ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .panier-drawer,
  .panier-overlay,
  .panier-toast-undo,
  .panier-item,
  .panier-qty-btn,
  .panier-checkout-btn,
  .shimmer {
    animation: none;
    transition: none;
  }
}

/* Focus styles */
.panier-back-btn:focus-visible,
.panier-header-btn:focus-visible,
.panier-qty-btn:focus-visible,
.panier-checkout-btn:focus-visible,
.panier-item-action-btn:focus-visible,
.panier-batch-btn:focus-visible,
.panier-shop-btn:focus-visible {
  outline: 2px solid var(--accent-color, #3b82f6);
  outline-offset: 2px;
}

/* ============================================
   19. DARK MODE OVERRIDES
   ============================================ */
.dark .panier-header {
  background: rgba(28, 27, 31, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark .panier-drawer {
  background: #1c1b1f;
}

.dark .panier-item {
  background: #2a2930;
  border-color: rgba(255, 255, 255, 0.06);
}

.dark .panier-summary {
  background: #1c1b1f;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.dark .panier-summary-content {
  background: #2a2930;
}

.dark .panier-global-summary-inner {
  background: #2a2930;
}

.dark .panier-empty-icon {
  background: #2a2930;
}

.dark .panier-coupon-modal {
  background: #2a2930;
}

.dark .panier-reassurance-item {
  background: #2a2930;
}

.dark .panier-help-link {
  background: #2a2930;
}

.dark .panier-cross-sell-card {
  background: #2a2930;
  border-color: rgba(255, 255, 255, 0.06);
}

.dark .panier-batch-bar {
  background: #2a2930;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark .panier-batch-btn {
  background: #1c1b1f;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .panier-item-variant-tag {
  background: #1c1b1f;
}

.dark .panier-qty-controls {
  background: #1c1b1f;
}

.dark .panier-qty-btn {
  background: #2a2930;
}

.dark .panier-free-shipping-bar {
  background: rgba(16, 185, 129, 0.06);
}

.dark .panier-coupon-applied {
  background: rgba(16, 185, 129, 0.06);
}

.dark .panier-empty-reco-item img {
  background: #2a2930;
}

/* ============================================
   15. MODAL VARIANTE
   ============================================ */
.panier-variant-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.panier-variant-modal.active {
  opacity: 1;
  pointer-events: all;
}

.panier-variant-modal-content {
  background: var(--bg-primary, #fff);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.panier-variant-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.panier-variant-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0;
}

.panier-variant-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary, #f3f4f6);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary, #6b7280);
  transition: all 0.2s ease;
}

.panier-variant-modal-close:hover {
  background: var(--border-color, #d1d5db);
}

.panier-variant-modal-body {
  padding: 20px;
  overflow-y: auto;
}

.panier-variant-product-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.panier-variant-product-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.panier-variant-product-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.panier-variant-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panier-variant-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.panier-variant-option:hover {
  border-color: var(--accent-color, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
}

.panier-variant-option.selected {
  border-color: var(--accent-color, #3b82f6);
  background: rgba(59, 130, 246, 0.1);
}

.panier-variant-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.panier-variant-info {
  flex: 1;
}

.panier-variant-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 4px;
}

.panier-variant-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-color, #3b82f6);
}

.panier-variant-check {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-color, #3b82f6);
  font-size: 20px;
}

/* ============================================
   16. FAQ PANIER
   ============================================ */
.panier-faq {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 16px;
}

.panier-faq-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin-bottom: 16px;
}

.panier-faq-title i {
  color: var(--accent-color, #3b82f6);
}

.panier-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panier-faq-item {
  background: var(--bg-primary, #fff);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.panier-faq-item[open] {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.panier-faq-item summary {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
}

.panier-faq-item summary:hover {
  background: var(--bg-secondary, #f3f4f6);
}

.panier-faq-item summary::-webkit-details-marker {
  display: none;
}

.panier-faq-item summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  color: var(--text-tertiary, #9ca3af);
  transition: transform 0.2s ease;
}

.panier-faq-item[open] summary::after {
  transform: rotate(180deg);
}

.panier-faq-item p {
  padding: 0 16px 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, #6b7280);
  margin: 0;
}

/* ============================================
   17. LIEN BOUTIQUE VENDEUR
   ============================================ */
.panier-item-boutique-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--accent-color, #3b82f6);
  text-decoration: none;
  margin-top: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panier-item-boutique-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.panier-item-boutique-link i {
  font-size: 10px;
}

/* ============================================
   18. ANIMATION CONFIRMATION QUANTITÉ
   ============================================ */
@keyframes quantityPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.panier-item-subtotal.pulse {
  animation: quantityPulse 0.3s ease;
}

/* ============================================
   19. FOOTER PANIER (SIMPLIFIÉ)
   ============================================ */
.panier-footer {
  margin-top: 2rem;
  padding: 1rem;
  text-align: center;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.panier-footer-copyright {
  color: var(--text-tertiary, #9ca3af);
  font-size: 0.75rem;
}

/* ============================================
   20. LAYOUT DESKTOP (Style )
   ============================================ */
@media (min-width: 1024px) {
  .panier-item {
    padding: 20px;
    gap: 20px;
    margin-bottom: 16px;
  }
  
  .panier-item-image-wrap {
    width: 120px;
    height: 120px;
  }
  
  .panier-item-variants-desktop {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 12px;
    min-width: 80px;
  }
  
  .panier-variant-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background: var(--bg-primary, #fff);
  }
  
  .panier-variant-thumb:hover {
    border-color: var(--accent-color, #3b82f6);
    transform: scale(1.05);
  }
  
  .panier-variant-thumb.selected {
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  }
  
  .panier-variant-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .panier-variant-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary, #9ca3af);
    font-size: 18px;
  }
  
  .panier-item-content {
    flex: 1;
    gap: 8px;
  }
  
  .panier-item-name {
    font-size: 16px;
    font-weight: 600;
  }
  
  .panier-item-boutique-link {
    font-size: 13px;
  }
  
  .panier-item-variant-tag {
    font-size: 12px;
    padding: 4px 10px;
  }
  
  .panier-item-price-row {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  
  .panier-item-unit-price {
    font-size: 15px;
  }
  
  .panier-item-subtotal {
    font-size: 16px;
    font-weight: 700;
  }
  
  .panier-qty-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .panier-qty-value {
    font-size: 16px;
    min-width: 40px;
  }
  
  .panier-item-action-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Mobile : masquer les variantes desktop */
@media (max-width: 1023px) {
  .panier-item-variants-desktop {
    display: none;
  }
}
