/* =============================================
   Mapharma France - Conversion Booster Styles
   Elements dynamiques de conversion & urgence
   ============================================= */

/* ===== URGENCY BADGES ===== */
.urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  animation: urgency-pulse 1.5s ease infinite;
}
.urgency-badge-stock {
  background: var(--promo-bg);
  color: var(--promo);
  border: 1px solid #FECACA;
}
.urgency-badge-discount {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #92400E;
  border: 1px solid #FCD34D;
}
.urgency-badge-shipping {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #A7F3D0;
}
.urgency-badge-hot {
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  color: #991B1B;
  border: 1px solid #FCA5A5;
  animation: urgency-shake 1s ease infinite;
}
.urgency-badge svg { flex-shrink: 0; }
@keyframes urgency-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}
@keyframes urgency-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* ===== PRICE COMPARISON ===== */
.price-comparison {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.price-old {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-old .discount-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--promo);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  animation: discount-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes discount-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
.price-new {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.price-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}
.price-per-pill {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== STOCK INDICATOR ===== */
.stock-indicator {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stock-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.stock-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stock-bar-fill.high { background: linear-gradient(90deg, var(--primary), #34D399); }
.stock-bar-fill.medium { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.stock-bar-fill.low { background: linear-gradient(90deg, var(--promo), #EF4444); }
.stock-text {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stock-text.high { color: var(--primary); }
.stock-text.medium { color: #D97706; }
.stock-text.low { color: var(--promo); animation: urgency-pulse 1.5s ease infinite; }
.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.stock-dot.high { background: var(--primary); }
.stock-dot.medium { background: #F59E0B; }
.stock-dot.low { background: var(--promo); animation: blink 1s ease infinite; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== RECENT PURCHASE NOTIFICATION ===== */
.purchase-notification {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 960;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 360px;
  border: 1px solid var(--border-light);
  animation: purchase-slide-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.purchase-notification.hiding {
  animation: purchase-slide-out 0.4s ease forwards;
}
.purchase-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.purchase-content { flex: 1; min-width: 0; }
.purchase-header {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.purchase-header strong {
  color: var(--text);
  font-weight: 600;
}
.purchase-product {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.purchase-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.purchase-meta .verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--success);
  font-weight: 500;
}
.purchase-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  transition: var(--transition);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.purchase-close:hover { color: var(--promo); background: var(--promo-bg); }
@keyframes purchase-slide-in {
  0% { transform: translateX(-150%) scale(0.8); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes purchase-slide-out {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(-150%) scale(0.8); opacity: 0; }
}

/* ===== SHIPPING COUNTDOWN ===== */
.shipping-countdown {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.shipping-countdown.urgent {
  background: linear-gradient(135deg, var(--promo-bg), #FECACA);
  border-color: #FCA5A5;
}
.shipping-countdown svg {
  color: #3B82F6;
  flex-shrink: 0;
}
.shipping-countdown.urgent svg { color: var(--promo); }
.shipping-countdown-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.shipping-countdown-text strong {
  font-weight: 600;
}
.shipping-countdown-text .timer {
  color: var(--promo);
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}
.shipping-countdown.urgent .timer {
  animation: urgency-pulse 1s ease infinite;
}

/* ===== BUNDLE OFFERS ===== */
.bundle-offer {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}
.bundle-offer::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(232,181,61,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.bundle-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bundle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.bundle-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.bundle-items {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.bundle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bundle-item-image {
  width: 64px;
  height: 64px;
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  overflow: hidden;
}
.bundle-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bundle-item-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bundle-separator {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}
.bundle-savings {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bundle-savings-text {
  font-size: 14px;
  color: var(--text);
}
.bundle-savings-text strong {
  color: var(--promo);
  font-weight: 700;
}
.bundle-savings-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

/* ===== EXIT INTENT MODAL ===== */
.exit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.exit-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.exit-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 90%;
  padding: 0;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  position: relative;
}
.exit-modal-overlay.active .exit-modal {
  transform: scale(1) translateY(0);
}
.exit-modal-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 32px 32px 48px;
  text-align: center;
  color: #fff;
  position: relative;
}
.exit-modal-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: #fff;
  border-radius: 50% 50% 0 0;
}
.exit-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.exit-modal-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.exit-modal-subtitle {
  font-size: 16px;
  opacity: 0.9;
}
.exit-modal-body {
  padding: 0 32px 32px;
  text-align: center;
}
.exit-modal-discount {
  font-size: 56px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
  font-family: 'Poppins', sans-serif;
}
.exit-modal-discount span {
  font-size: 24px;
}
.exit-modal-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  margin: 16px 0;
}
.exit-modal-code .code-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.exit-modal-code .code-value {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}
.exit-modal-timer {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}
.exit-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}
.exit-modal-close:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}
.exit-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exit-modal-cta {
  width: 100%;
  padding: 14px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}
.exit-modal-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(14,143,88,0.3);
}
.exit-modal-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
}
.exit-modal-dismiss:hover {
  color: var(--text);
}

/* ===== CART ABANDONMENT BANNER ===== */
.cart-abandonment-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, var(--promo), #EF4444);
  color: #fff;
  padding: 16px 20px;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(220,38,38,0.3);
  animation: slide-down 0.4s ease;
}
.cart-abandonment-banner.visible { display: flex; }
.cart-abandonment-banner .banner-text {
  font-size: 15px;
  font-weight: 500;
}
.cart-abandonment-banner .banner-text strong {
  font-weight: 700;
}
.cart-abandonment-banner .banner-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  border: 1px dashed rgba(255,255,255,0.4);
}
.cart-abandonment-banner .banner-cta {
  background: #fff;
  color: var(--promo);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.cart-abandonment-banner .banner-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.cart-abandonment-banner .banner-close {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: var(--transition);
}
.cart-abandonment-banner .banner-close:hover { opacity: 1; }
@keyframes slide-down {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ===== TRUST SEALS (Product Page) ===== */
.product-trust-seals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
}
.trust-seal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.trust-seal-item svg {
  color: var(--primary);
  flex-shrink: 0;
}
.trust-seal-item strong {
  color: var(--text);
  font-weight: 600;
}

/* ===== SAVINGS CALCULATOR ===== */
.savings-calculator {
  background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 16px 0;
}
.savings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}
.savings-row.total {
  border-top: 1px solid #A7F3D0;
  margin-top: 8px;
  padding-top: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.savings-row .savings-amount {
  color: var(--promo);
  font-weight: 600;
  text-decoration: line-through;
}
.savings-row.total .savings-amount {
  color: var(--primary);
  text-decoration: none;
  font-size: 20px;
}

/* ===== FAQ ACCORDION (Conversion) ===== */
.faq-accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 20px 0;
}
.faq-item {
  border-bottom: 1px solid var(--border-light);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.faq-question:hover { background: var(--bg-alt); }
.faq-question svg { transition: transform 0.3s ease; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 20px 16px;
}
.faq-answer p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== RECENTLY VIEWED ===== */
.recently-viewed-section {
  background: var(--bg-alt);
  padding: 50px 0;
  border-top: 1px solid var(--border-light);
}
.recently-viewed-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.recently-viewed-title svg { color: var(--primary); }
.recently-viewed-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.recently-viewed-item {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
}
.recently-viewed-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.recently-viewed-image {
  aspect-ratio: 1;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.recently-viewed-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.recently-viewed-info {
  padding: 12px;
}
.recently-viewed-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recently-viewed-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .recently-viewed-grid { grid-template-columns: repeat(4, 1fr); }
  .product-trust-seals { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .purchase-notification { max-width: calc(100vw - 32px); left: 12px; bottom: 12px; }
  .exit-modal { width: 95%; }
  .exit-modal-header { padding: 24px 24px 40px; }
  .exit-modal-body { padding: 0 20px 24px; }
  .exit-modal-discount { font-size: 42px; }
  .bundle-items { justify-content: center; }
  .cart-abandonment-banner { flex-direction: column; gap: 10px; text-align: center; padding: 12px; }
  .cart-abandonment-banner .banner-close { position: static; }
  .recently-viewed-grid { grid-template-columns: repeat(3, 1fr); }
  .shipping-countdown { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .recently-viewed-grid { grid-template-columns: repeat(2, 1fr); }
  .price-new { font-size: 22px; }
  .exit-modal-discount { font-size: 36px; }
}
