.product-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1500;
  justify-content: center;
  align-items: center;
  /* Prevent modal from touching the screen edges on small viewports */
  padding: 20px; 
}

.product-modal-overlay.active {
  display: flex;
}

.product-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  max-width: 400px;
  width: 90%;
  padding: 2rem;
  text-align: center;
  border: 2px solid white;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.3s ease;
  
  /* Added to enable internal vertical scroll if content is too tall */
  max-height: 90vh;
  overflow-y: auto;
}

.product-modal img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 1rem;
  border: 3px solid #c8e6c9;
}

.product-modal h3 {
  color: #1b5e20;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.product-modal .benefits {
  text-align: left;
  background: #f1f8e9;
  padding: 1rem;
  border-radius: 15px;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: #2e3b2e;
}

.product-modal .benefits i {
  color: #4caf50;
  margin-right: 0.5rem;
}

.product-modal .modal-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: #2e7d32;
}

.product-modal .modal-old-price {
  text-decoration: line-through;
  color: #81c784;
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.btn-modal-order {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  border: none;
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 10px 20px rgba(46, 125, 50, 0.4);
  transition: all 0.3s ease;
}

.btn-modal-order:hover {
  transform: scale(1.05);
}

.btn-close-modal-small {
  background: transparent;
  border: 1px solid #4caf50;
  color: #2e7d32;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  margin-top: 0.8rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-close-modal-small:hover {
  background: #4caf50;
  color: white;
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 15px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-close:hover {
  color: #ff4444;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2500;
  justify-content: center;
  align-items: center;
  /* Prevent modal from touching the screen edges on small viewports */
  padding: 20px; 
}

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

.modal-box {
  background: white;
  border-radius: 25px;
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.4s ease;
  
  /* Restrict max height to 90% of screen height and enable scrollbar inside modal */
  max-height: 90vh;
  overflow-y: auto;
}

.modal-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2.5rem;
  color: white;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #2e7d32;
  margin-bottom: 0.5rem;
}

.modal-text {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.modal-order-details {
  background: #f1f8e9;
  border-radius: 15px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
  font-size: 0.9rem;
}

.modal-order-details p {
  margin-bottom: 0.3rem;
  color: #333;
}

.modal-order-details strong {
  color: #2e7d32;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #e91e63, #c2185b);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
  transition: all 0.3s ease;
  margin-bottom: 0.8rem;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(233, 30, 99, 0.6);
}

.btn-close-modal {
  display: block;
  width: 100%;
  padding: 0.7rem;
  border-radius: 25px;
  background: #e0e0e0;
  color: #333;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-close-modal:hover {
  background: #bdbdbd;
}