:root {
  --coral-red: #f57c00;
  --coral-red-dark: #ef6c00;
  --green-cta: #27ae60;
  --green-cta-dark: #229954;
  --green-light: #43a047;
  --green-lighter: #43a047; /* New lighter green for hover */
  --gray-light: #f8f9fa;
  --gray-medium: #6c757d;
  --gray-dark: #343a40;
  --white: #ffffff;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.2);
  --shadow-heavy: rgba(0, 0, 0, 0.4);
  /* Added from product rankings section */
  --primary-600: #0d9488; /* Teal */
  --primary-700: #0f766e; /* Darker Teal */
  --primary-800: #115e59; /* Even Darker Teal */
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modal Base Styles */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.product-modal.show {
  display: flex;
}

.product-modal-content {
  max-width: 320px;
  width: 100%;
  background-color: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 40px var(--shadow-heavy);
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

/* Animation */
.animate-popup {
  animation: popupEffect 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popupEffect {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(50px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Close Button */
.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 24px;
  color: var(--white);
  cursor: pointer;
  z-index: 10;
  padding: 8px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.close-modal:hover {
  background-color: rgba(0, 0, 0, 0.5);
  transform: rotate(90deg);
}

/* Header Banner */
.offer-header {
  background: linear-gradient(135deg, var(--coral-red) 0%, var(--coral-red-dark) 100%);
  color: var(--white);
  padding: 12px 20px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.offer-icon {
  font-size: 24px;
}

.offer-text {
  font-size: 14px;
  letter-spacing: 0.3px;
}

/* Product Image */
.product-image-container {
  padding: 30px 20px 20px;
  background-color: var(--gray-light);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

.product-image {
  max-width: 100%;
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Discount Section */
.discount-section {
  padding: 20px 20px 15px;
  text-align: center;
}

.discount-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-dark);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* Product Description */
.product-description {
  padding: 0 20px 15px;
  text-align: center;
}

.product-description p {
  font-size: 14px;
  color: var(--gray-medium);
  margin: 0;
  line-height: 1.4;
}

.product-description strong {
  color: var(--gray-dark);
  font-weight: 600;
}

/* Social Proof */
.social-proof {
  padding: 0 20px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-medium);
  font-weight: 500;
}

/* CTA Button */
.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: var(--white);
  text-decoration: none;
  padding: 16px 20px;
  margin: 0 20px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: pulse 2s infinite;
}

.cta-btn:hover {
  background: linear-gradient(90deg, var(--primary-700) 0%, var(--primary-800) 100%);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  animation: none;
}

.cta-btn:active {
  background: linear-gradient(90deg, var(--primary-700) 0%, var(--primary-800) 100%);
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.cta-btn .arrow {
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.3s ease;
}

.cta-btn:hover .arrow {
  transform: translateX(5px);
}

/* Desktop Responsive Styles */
@media (min-width: 769px) {
  .product-modal-content {
    max-width: 700px;
    display: flex;
    flex-direction: column;
    height: auto;
  }

  /* Updated header to span full width on desktop */
  .offer-header {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
  }

  /* Created horizontal two-column layout below header */
  .desktop-content {
    display: flex;
    flex-direction: row;
    min-height: 300px;
  }

  .desktop-left {
    width: 50%;
    padding: 40px 30px;
    background-color: var(--gray-light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .desktop-right {
    width: 50%;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
  }

  /* Larger product image for desktop left side */
  .desktop-product-image {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
  }

  .desktop-brand-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--green-cta);
    text-align: center;
  }

  /* Right side content styling for desktop */
  .desktop-discount-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--gray-dark);
    margin: 0 0 20px 0;
    line-height: 1.1;
    letter-spacing: -1px;
  }

  .desktop-product-description {
    font-size: 16px;
    color: var(--gray-medium);
    margin-bottom: 20px;
    line-height: 1.4;
  }

  .desktop-product-description strong {
    color: var(--gray-dark);
    font-weight: 600;
  }

  .desktop-social-proof {
    background-color: var(--gray-medium);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
  }

  .desktop-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(90deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: var(--white);
    text-decoration: none;
    padding: 18px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    -webkit-tap-highlight-color: transparent;
    animation: pulse 2s infinite;
  }

  .desktop-cta-btn:hover {
    background: linear-gradient(90deg, var(--primary-700) 0%, var(--primary-800) 100%);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    animation: none;
  }

  .desktop-cta-btn:active {
    background: linear-gradient(90deg, var(--primary-700) 0%, var(--primary-800) 100%);
    transform: translateY(0);
    box-shadow: var(--shadow-md);
  }

  .desktop-cta-btn .desktop-arrow {
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s ease;
  }

  .desktop-cta-btn:hover .desktop-arrow {
    transform: translateX(5px);
  }

  /* Hide mobile layout on desktop */
  .mobile-layout {
    display: none;
  }
}

/* Show mobile layout only on mobile */
@media (max-width: 768px) {
  .desktop-content,
  .desktop-left,
  .desktop-right {
    display: none;
  }

  .product-modal-content {
    max-width: 320px;
    width: 100%;
    background-color: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 40px var(--shadow-heavy);
    overflow: hidden;
    position: relative;
    margin: 0 auto;
  }

  .product-image-container {
    padding: 30px 20px 20px;
    background-color: var(--gray-light);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
  }

  .product-image {
    max-width: 100%;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
  }

  .discount-section {
    padding: 20px 20px 15px;
    text-align: center;
  }

  .discount-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-dark);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.5px;
  }

  .product-description {
    padding: 0 20px 15px;
    text-align: center;
  }

  .product-description p {
    font-size: 14px;
    color: var(--gray-medium);
    margin: 0;
    line-height: 1.4;
  }

  .product-description strong {
    color: var(--gray-dark);
    font-weight: 600;
  }

  .social-proof {
    padding: 0 20px 20px;
    text-align: center;
    font-size: 12px;
    color: var(--gray-medium);
    font-weight: 500;
  }

  .mobile-layout {
    display: block;
  }
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .product-modal {
    padding: 15px;
  }

  .product-modal-content {
    max-width: 300px;
  }

  .discount-title {
    font-size: 28px;
  }

  .product-description p {
    font-size: 13px;
  }

  .cta-btn {
    font-size: 14px;
    padding: 15px 18px;
  }
}

@media (max-width: 360px) {
  .product-modal-content {
    max-width: 280px;
  }

  .discount-title {
    font-size: 26px;
  }

  .product-image-container {
    min-height: 160px;
    padding: 25px 15px 15px;
  }

  .product-image {
    max-height: 140px;
  }
}

/* Pulse Animation */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4); /* Matches --primary-600 */
  }
  70% {
    box-shadow: 0 0 0 10px rgba(13, 148, 136, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
  }
}