/**
 * Exit Intent Popup Styles - v4 (High-Conversion Replica)
 * Based on the provided v0 layout.
 */

/* Reset and Basic Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  /* Consider a modern, clean sans-serif font stack */
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

/* The full-screen overlay */
#eip-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center; /* Vertical centering */
  justify-content: center; /* Horizontal centering */
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

#eip-popup-overlay.eip-visible {
  opacity: 1;
  visibility: visible;
}

/* Popup Content Container */
#eip-popup-content {
  position: relative;
  width: 100%;
  max-width: 380px; /* Max width for the popup */
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#eip-popup-overlay.eip-visible #eip-popup-content {
  transform: scale(1);
}

/* Close button */
.eip-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.eip-close-button:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

#eip-header-title {
  font-size: 20px;
  font-weight: bold;
}

/* Header */
.eip-header {
  background: linear-gradient(
    to right,
    #ef4444,
    #ec4899
  ); /* red-500 to pink-500 */
  color: #fff;
  text-align: center;
  padding: 10px 16px;
}

.eip-header-line-1,
.eip-header-line-2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.eip-header-line-1 {
  font-size: 14px;
  font-weight: bold;
}

.eip-timer-countdown {
  font-size: 20px;
  font-weight: bold;
  font-family: "ui-monospace", "SFMono-Regular", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.eip-timer-text {
  font-size: 12px;
}

/* Main Content Area */
.eip-main-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Congrats Section */
.eip-congrats-section {
  text-align: center;
}

.eip-congrats-title {
  font-size: 20px;
  font-weight: bold;
  color: #1f2937;
  margin: 0;
}

.eip-congrats-subtitle {
  font-size: 12px;
  color: #4b5563;
  margin: 0;
}

/* Product Section */
.eip-product-section {
  background-color: #f9fafb; /* gray-50 */
  border-radius: 8px;
  padding: 12px;
}

.eip-product-details {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.eip-product-image-container {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: linear-gradient(
    to bottom right,
    #e0f2fe,
    #f3e8ff
  ); /* blue-100 to purple-100 */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eip-product-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
}

.eip-product-pricing {
  flex-grow: 1;
}

.eip-product-pricing-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.eip-price-old {
  font-size: 14px;
  text-decoration: line-through;
  color: #9ca3af;
}

.eip-discount-badge {
  background-color: #ef4444; /* red-500 */
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

.eip-price-new {
  font-size: 24px;
  font-weight: bold;
  color: #16a34a; /* green-600 */
  animation: pulse-glow 2s ease-in-out infinite;
}

.eip-product-reviews {
  font-size: 12px;
  color: #6b7280;
}

.eip-product-reviews,
.eip-price-new,
.eip-price-old {
  line-height: 1.2;
}

/* Value Breakdown */
.eip-value-breakdown {
  font-size: 12px;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eip-value-breakdown-row {
  display: flex;
  justify-content: space-between;
}

.eip-value-breakdown-row span:first-child {
  color: #4b5563;
}

.eip-value-special {
  font-weight: 500;
  color: #16a34a;
}

.eip-value-savings {
  text-align: center;
  font-weight: bold;
  color: #15803d; /* green-700 */
  padding-top: 8px;
  border-top: 1px dashed #d1d5db; /* gray-300 */
  font-size: 11px;
}

/* Key Benefits */
.eip-key-benefits {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eip-benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}

.eip-benefit-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
}

.eip-benefit-icon.truck-icon {
  background-color: #dcfce7;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2316a34a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-truck"><path d="M10 17h4V5H2v12h3"/><path d="M10 5l4 4"/><path d="M20 17h1.7a2.8 2.8 0 0 0 2.8-2.8V9.2A2.8 2.8 0 0 0 21.7 6.4h-5.4a2.8 2.8 0 0 0-2.8 2.8v8.6A2.8 2.8 0 0 0 16.3 21H18"/><circle cx="7" cy="19" r="2"/><circle cx="18" cy="19" r="2"/></svg>');
}

.eip-benefit-icon.shield-icon {
  background-color: #dbeafe;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%232563eb" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-shield"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>');
}

.eip-benefit-icon.gift-icon {
  background-color: #f3e8ff;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%239333ea" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-gift"><polyline points="20 12 20 22 4 22 4 12"/><rect width="20" height="5" x="2" y="7"/><line x1="12" x2="12" y1="22" y2="7"/><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"/><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"/></svg>');
}

/* Form */
.eip-form-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eip-whatsapp-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  border: 2px solid #e5e7eb; /* gray-200 */
  border-radius: 8px !important;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.eip-whatsapp-input:focus {
  outline: none;
  border-color: #22c55e; /* green-500 */
}

.eip-cta-button {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(
    to right,
    #22c55e,
    #16a34a
  ); /* green-500 to green-600 */
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  cursor: pointer;
  transform: scale(1);
  transition: transform 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  animation: pulse-button 2s infinite;
}

.eip-cta-button:hover:not(:disabled) {
  background: linear-gradient(to right, #16a34a, #15803d);
}

.eip-cta-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: scale(1);
  text-shadow: 0 0 5px rgba(22, 163, 74, 0.2);
}

/* Spinner for CTA loading state */
.eip-cta-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Trust & Urgency */
.eip-trust-urgency-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.eip-social-proof {
  font-size: 12px;
  color: #6b7280;
}

.eip-trust-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}

/* Animations */
@keyframes pulse {
  50% {
    opacity: 0.8;
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    transform: scale(1);
    text-shadow: 0 0 5px rgba(22, 163, 74, 0.2);
  }
  50% {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(22, 163, 74, 0.5);
  }
}

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

@keyframes pulse-button {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  }
}

/* Utility to hide (already present) */
.eip-hidden {
  display: none !important;
}

/* Confetti Styles */
.eip-confetti-particle {
  position: absolute;
  width: 8px; /* Slightly smaller */
  height: 8px;
  opacity: 0.8;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100001;
}

/* Responsive adjustments for very small screens */
@media (max-width: 360px) {
  .eip-product-image {
    max-width: 100px;
  }
  .eip-headline-main {
    font-size: 20px;
  }
  .eip-price-new {
    font-size: 20px;
  }
  .eip-discount-badge {
    font-size: 12px;
  }
  .eip-headline-sub-perk {
    font-size: 14px;
  }
  .eip-value-highlight-block li {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .eip-li-icon {
    font-size: 16px;
    width: 20px;
  }
  .eip-whatsapp-input {
    font-size: 14px;
    padding: 12px 14px;
  }
  .eip-input-label {
    font-size: 11px;
  }
  .eip-cta-button {
    height: 46px;
    font-size: 15px;
  }
  .eip-timer-text {
    font-size: 13px;
  }
  .eip-timer-text strong {
    font-size: 13px;
  }
}
