/* Estilos para el popup de bienvenida */
.popup-bienvenida {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.popup-bienvenida.show {
  opacity: 1;
  visibility: visible;
}

.popup-bienvenida-content {
  background: #ffffff;
  border-radius: 15px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.7);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.popup-bienvenida.show .popup-bienvenida-content {
  transform: scale(1);
}

.popup-header {
  background: linear-gradient(135deg, #006ca9 0%, #1c2331 100%);
  color: white;
  padding: 25px;
  text-align: center;
  border-radius: 15px 15px 0 0;
  position: relative;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.popup-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.popup-title {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.popup-subtitle {
  font-size: 16px;
  margin: 8px 0 0 0;
  opacity: 0.9;
}

.popup-body {
  padding: 30px 25px;
  text-align: center;
}

.popup-icon {
  font-size: 60px;
  color: #e41660;
  margin-bottom: 20px;
}

.popup-message {
  font-size: 18px;
  color: #333;
  line-height: 1.6;
  margin-bottom: 25px;
}

.popup-discount {
  background: linear-gradient(135deg, #e41660, #df3472);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.popup-discount::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.discount-percent {
  font-size: 48px;
  font-weight: bold;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.discount-text {
  font-size: 16px;
  margin: 5px 0;
  opacity: 0.9;
}

.popup-code {
  background: linear-gradient(135deg, #a2cfe8, #006ca9);
  color: white;
  padding: 15px 25px;
  border-radius: 10px;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
  margin: 20px 0;
  text-align: center;
  border: 3px solid #e41660;
  box-shadow: 0 4px 15px rgba(228, 22, 96, 0.3);
}

/* Formulario de email */
.popup-email-form {
  margin: 20px 0;
}

.popup-email-group {
  position: relative;
  margin-bottom: 15px;
}

.popup-email-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #a2cfe8;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f8fbfd;
  color: #1c2331;
  box-sizing: border-box;
}

.popup-email-input:focus {
  outline: none;
  border-color: #006ca9;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 108, 169, 0.1);
}

.popup-email-input::placeholder {
  color: #a2cfe8;
}

.popup-submit-btn {
  width: 100%;
  padding: 15px 25px;
  background: linear-gradient(135deg, #e41660, #df3472);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.popup-submit-btn:hover {
  background: linear-gradient(135deg, #df3472, #e41660);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(228, 22, 96, 0.3);
}

.popup-submit-btn:active {
  transform: translateY(0);
}

.popup-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.popup-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes spin {
  0% {
    transform: translateY(-50%) rotate(0deg);
  }
  100% {
    transform: translateY(-50%) rotate(360deg);
  }
}

.popup-success-message {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  margin: 15px 0;
  font-weight: bold;
}

.popup-error-message {
  background: linear-gradient(135deg, #dc3545, #fd7e14);
  color: white;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  margin: 15px 0;
  font-weight: bold;
}

.popup-warning-message {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: white;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  margin: 15px 0;
  font-weight: bold;
}

.popup-newsletter-info {
  background: rgba(162, 207, 232, 0.1);
  border: 1px solid #a2cfe8;
  border-radius: 8px;
  padding: 12px;
  margin: 15px 0;
  font-size: 14px;
  color: #1c2331;
  text-align: center;
}

.popup-privacy-link {
  color: #006ca9;
  text-decoration: none;
}

.popup-privacy-link:hover {
  color: #e41660;
  text-decoration: underline;
}

.code-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.code-value {
  font-size: 24px;
  font-weight: bold;
  color: #006ca9;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

.popup-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.popup-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  min-width: 140px;
}

.popup-btn-primary {
  background: linear-gradient(135deg, #006ca9, #1c2331);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 108, 169, 0.4);
}

.popup-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 108, 169, 0.6);
}

.popup-btn-secondary {
  background: transparent;
  color: #006ca9;
  border: 2px solid #006ca9;
}

.popup-btn-secondary:hover {
  background: #006ca9;
  color: white;
  transform: translateY(-2px);
}

.popup-footer {
  padding: 20px 25px;
  background: #a2cfe8;
  border-radius: 0 0 15px 15px;
  text-align: center;
}

.popup-footer-text {
  font-size: 12px;
  color: #1c2331;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .popup-bienvenida-content {
    margin: 20px;
    width: calc(100% - 40px);
  }

  .popup-title {
    font-size: 24px;
  }

  .popup-message {
    font-size: 16px;
  }

  .discount-percent {
    font-size: 36px;
  }

  .code-value {
    font-size: 20px;
  }

  .popup-buttons {
    flex-direction: column;
    align-items: center;
  }

  .popup-btn {
    width: 100%;
    max-width: 250px;
  }
}

/* ======================================
   ESTILOS ESPECÍFICOS PARA MÓVIL
   ====================================== */

/* Versión móvil del popup */
.popup-mobile .popup-bienvenida-content {
  max-width: 95%;
  width: 95%;
  margin: 10px;
  max-height: 85vh;
  border-radius: 12px;
}

.popup-mobile .popup-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #006ca9 0%, #1c2331 100%);
  border-radius: 12px 12px 0 0;
}

.popup-mobile .popup-title {
  font-size: 20px;
  margin: 0;
  text-align: center;
}

.popup-mobile .popup-subtitle {
  display: none; /* Ocultar subtítulo en móvil */
}

.popup-mobile .popup-body {
  padding: 20px 15px;
}

.popup-mobile .popup-icon {
  display: none; /* Ocultar icono grande en móvil */
}

/* Descuento compacto para móvil */
.popup-discount-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #e41660, #df3472);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  margin: 15px 0;
}

.popup-discount-compact .discount-percent {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
}

.popup-discount-compact .discount-text {
  font-size: 14px;
  margin: 0;
  line-height: 1.2;
}

/* Mensaje compacto */
.popup-message-compact {
  font-size: 16px;
  color: #333;
  text-align: center;
  margin: 15px 0;
  line-height: 1.4;
}

/* Formulario móvil */
.popup-mobile .popup-email-form {
  margin: 15px 0;
}

.popup-mobile .popup-email-input {
  padding: 12px 15px;
  font-size: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.popup-mobile .popup-submit-btn {
  padding: 12px 20px;
  font-size: 15px;
  border-radius: 8px;
  width: 100%;
}

/* Información de newsletter específica para móvil */
.popup-newsletter-info-mobile {
  background: rgba(162, 207, 232, 0.1);
  border: 1px solid #a2cfe8;
  border-radius: 6px;
  padding: 10px;
  margin: 12px 0;
  font-size: 13px;
  color: #1c2331;
  text-align: center;
  line-height: 1.4;
}

.popup-newsletter-info-mobile .popup-privacy-link {
  color: #006ca9;
  text-decoration: none;
  font-weight: 500;
}

.popup-newsletter-info-mobile .popup-privacy-link:hover {
  color: #e41660;
  text-decoration: underline;
}

/* Footer específico para móvil */
.popup-footer-mobile {
  padding: 12px 15px;
  background: #a2cfe8;
  border-radius: 0 0 12px 12px;
  text-align: center;
}

.popup-footer-mobile .popup-footer-text {
  font-size: 11px;
  color: #1c2331;
  margin: 0;
  line-height: 1.3;
}

/* Botones móvil */
.popup-buttons-mobile {
  text-align: center;
  margin-top: 15px;
}

.popup-btn-close {
  background: transparent;
  border: 1px solid #ccc;
  color: #666;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.popup-btn-close:hover {
  background: #f5f5f5;
  border-color: #999;
}

/* Ajustes para pantallas muy pequeñas (menos de 400px) */
@media (max-width: 400px) {
  .popup-mobile .popup-bienvenida-content {
    width: 98%;
    margin: 5px;
  }

  .popup-mobile .popup-header {
    padding: 12px 15px;
  }

  .popup-mobile .popup-title {
    font-size: 18px;
  }

  .popup-mobile .popup-body {
    padding: 15px 12px;
  }

  .popup-discount-compact {
    padding: 10px 15px;
  }

  .popup-discount-compact .discount-percent {
    font-size: 24px;
  }

  .popup-message-compact {
    font-size: 15px;
  }

  .popup-newsletter-info-mobile {
    font-size: 12px;
    padding: 8px;
    margin: 10px 0;
  }

  .popup-footer-mobile {
    padding: 10px 12px;
  }

  .popup-footer-mobile .popup-footer-text {
    font-size: 10px;
  }
}

/* Mejoras para el estado de éxito en móvil */
.popup-mobile .popup-success-message {
  font-size: 14px;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
}

.popup-mobile .popup-error-message,
.popup-mobile .popup-warning-message {
  font-size: 14px;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
}

/* Ajustes para orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .popup-mobile .popup-bienvenida-content {
    max-height: 95vh;
    overflow-y: auto;
  }

  .popup-mobile .popup-header {
    padding: 10px 15px;
  }

  .popup-mobile .popup-body {
    padding: 15px 12px 10px;
  }

  .popup-discount-compact {
    margin: 10px 0;
    padding: 8px 15px;
  }

  .popup-mobile .popup-message-compact {
    margin: 10px 0;
    font-size: 14px;
  }

  .popup-newsletter-info-mobile {
    font-size: 11px;
    padding: 6px;
    margin: 8px 0;
  }

  .popup-footer-mobile {
    padding: 8px 10px;
  }

  .popup-footer-mobile .popup-footer-text {
    font-size: 9px;
  }
}

/* Fix para evitar zoom en iOS cuando se hace focus en input */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .popup-mobile .popup-email-input {
    font-size: 16px !important;
  }
}

/* Animación específica para móvil */
.popup-mobile.show .popup-bienvenida-content {
  animation: slideInUpMobile 0.4s ease;
}

@keyframes slideInUpMobile {
  from {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Botón de cerrar optimizado para móvil */
.popup-mobile .popup-close {
  width: 30px;
  height: 30px;
  font-size: 20px;
  top: 10px;
  right: 15px;
}

/* Touch targets mínimos para móvil */
.popup-mobile .popup-close,
.popup-mobile .popup-submit-btn,
.popup-mobile .popup-btn-close {
  min-height: 44px; /* Tamaño mínimo recomendado para touch */
  min-width: 44px;
}

.popup-mobile .popup-submit-btn {
  padding: 12px 20px;
  font-weight: 600;
}

/* Animación de entrada */
@keyframes slideInUp {
  from {
    transform: translateY(100px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.popup-bienvenida.show .popup-bienvenida-content {
  animation: slideInUp 0.5s ease;
}
