@media (max-width: 768px) {
  #email-subscription-popup {
    width: 90vw !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  #email-subscription-popup > div {
    padding: 32px 24px !important;
  }

  #email-subscription-popup div[style*="font-size: 36px"] {
    font-size: 28px !important;
  }

  /* Stack form vertically on mobile */
  #email-subscription-form {
    flex-direction: column !important;
  }

  #popup-submit-btn {
    width: 100% !important;
  }
}

/* Popup banner mobile - show full image */
@media (max-width: 600px) {
  #popup-banner {
    height: 120px !important;
    margin: 0 0 24px 0 !important;
    background-size: contain !important;
    background-color: #ffffff !important;
  }
}

/* Modal Overlay */
.ruby-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.ruby-modal-overlay.ruby-modal-visible {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Modal Content - Simple horizontal layout */
.ruby-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 700px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease-out;
}

.ruby-modal-visible .ruby-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Close Button - Minimal */
.ruby-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
  z-index: 1;
  padding: 0;
}

.ruby-modal-close:hover {
  color: #333;
}

/* Flex Layout - Image Left, Text Right */
.ruby-modal-flex {
  display: flex;
  align-items: stretch;
}

/* Image Side - Left */
.ruby-modal-image-side {
  flex: 0 0 50%;
  box-sizing: border-box;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 50px;
}

.ruby-modal-image {
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
}

/* Text Side - Right */
.ruby-modal-text-side {
  flex: 1;
  padding: 60px 50px 60px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

/* Headline - One bold statement (discount or scarcity) */
.ruby-modal-headline {
  font-size: 34px;
  color: #000;
  margin: 0 0 18px 0;
  font-weight: 700;
  line-height: 1.15;
}

/* Product Name - Small grey */
.ruby-modal-product-name {
  font-size: 16px;
  font-weight: 400;
  margin: 0 0 8px 0;
  color: #666;
  line-height: 1.4;
}

/* Price - Small grey */
.ruby-modal-price {
  font-size: 16px;
  font-weight: 400;
  color: #666;
  margin: 0 0 10px 0;
}

/* Brand modal: collapse image side, center text. */
.ruby-modal-no-image .ruby-modal-text-side {
  padding: 60px 50px;
}

/* Supporting copy (brand message in place of product meta). */
.ruby-modal-body {
  font-size: 16px;
  font-weight: 400;
  color: #666;
  margin: 0 0 14px 0;
  line-height: 1.4;
}

/* Subtle secondary line (e.g. urgency under a savings headline). */
.ruby-modal-subheadline {
  font-size: 15px;
  font-weight: 400;
  color: #666;
  margin: -10px 0 18px 0;
  line-height: 1.4;
}

/* Button - 32px height, full width */
.ruby-modal-button {
  display: block;
  width: 100%;
  background: #000;
  color: white;
  padding: 8px 28px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  border-radius: 0;
  transition: background-color 0.2s ease;
  text-align: center;
  line-height: 16px;
  height: 32px;
  box-sizing: border-box;
}

.ruby-modal-button:hover {
  background: #333;
  color: white;
  text-decoration: none;
}

/* Promo disclaimer footnote */
.ruby-modal-disclaimer {
  font-size: 11px;
  color: #999;
  margin-top: 12px;
  line-height: 1.4;
}

/* Mobile Responsive - Stack vertically */
@media (max-width: 768px) {
  .ruby-modal-flex {
    flex-direction: column;
  }

  .ruby-modal-content {
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
  }

  .ruby-modal-image-side {
    flex: 0 0 auto;
    padding: 32px 24px 20px;
  }

  .ruby-modal-image {
    max-height: 200px;
  }

  .ruby-modal-text-side {
    padding: 20px 24px 32px;
  }

  .ruby-modal-no-image .ruby-modal-text-side {
    padding: 32px 24px;
  }

  .ruby-modal-headline {
    font-size: 26px;
    margin-bottom: 14px;
  }

  .ruby-modal-subheadline {
    font-size: 14px;
    margin: -6px 0 14px 0;
  }

  .ruby-modal-body {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .ruby-modal-product-name {
    font-size: 15px;
    margin-bottom: 6px;
  }

  .ruby-modal-price {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .ruby-modal-button {
    font-size: 16px;
    padding: 12px 24px;
    height: auto;
    border-radius: 6px;
  }

  .ruby-modal-disclaimer {
    font-size: 10px;
    margin-top: 10px;
  }
}
