/**
 * ============================================
 * POPUP.CSS - Estilos para Popups y Modales
 * ============================================
 * 
 * Este archivo contiene todos los estilos relacionados con popups y modales
 * utilizados en la aplicación, incluyendo:
 * - Popup de mensaje copiado (popup-pedido)
 * - Modal de producto (modal-producto)
 * - Animaciones de apertura y cierre
 */

/* ============================================
   POPUP DE MENSAJE COPIADO
   ============================================ */

.popup-pedido-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: popup-fade-in 0.2s ease;
}

/* En móvil (cuando aparece el menú hamburguesa), popups encima de la navbar (navbar usa z-index: 9999) */
@media (max-width: 767px) {
  .popup-pedido-overlay {
    z-index: 10000;
  }
}

.popup-pedido-box {
  position: relative;
  min-width: 280px;
  max-width: 360px;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: popup-scale-in 0.25s ease;
}

/* Cuando está cerrando, sobrescribir la animación de apertura */
.popup-pedido-overlay.cerrando {
  animation: popup-fade-out 0.2s ease forwards !important;
}

.popup-pedido-box.cerrando {
  animation: popup-scale-out 0.25s ease forwards !important;
}

/* Fondos y texto según paleta neutra (theme.css) – popup un poco más oscuro */
.popup-pedido-box.light {
  background-color: #EBEBEB;
  color: #000000;
}

html.dark .popup-pedido-box.dark {
  background-color: #1a1a1a;
  color: var(--gray-soft);
}

.popup-pedido-texto {
  padding: 2rem 2.5rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

/* Popup "¿Cómo comprar?" – 3 pasos (estilo Nuestro proceso, compacto) */
.popup-como-comprar-box {
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.popup-como-pasos {
  padding: 0 1.5rem 1rem;
}

.popup-como-paso {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.popup-como-paso:last-child {
  margin-bottom: 0;
}

/* Paso 1 y 3: imagen izquierda, texto derecha (igual que Nuestro proceso) */
.popup-como-paso:nth-child(odd) {
  flex-direction: row;
  text-align: left;
}

/* Paso 2: imagen derecha, texto izquierda */
.popup-como-paso:nth-child(even) {
  flex-direction: row-reverse;
  text-align: right;
}

.popup-como-paso-imagen-container {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 0.75rem;
  overflow: hidden;
}

.popup-como-paso-imagen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.75rem;
}

/* Invertir colores de la imagen en modo oscuro para el paso 3 de cotizar */
html.dark .popup-como-paso-imagen-invertible {
  filter: invert(1);
}

.popup-como-paso-contenido {
  flex: 1;
  min-width: 0;
}

.popup-como-paso-numero {
  font-family: 'Noto Serif Display', serif;
  font-size: 1.75rem;
  font-weight: 100;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.popup-pedido-box.light .popup-como-paso-numero {
  color: var(--gray-deep);
}

html.dark .popup-pedido-box.dark .popup-como-paso-numero {
  color: var(--gray-soft);
}

.popup-como-paso-texto {
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0;
}

.popup-pedido-box.light .popup-como-paso-texto {
  color: #333333;
}

html.dark .popup-pedido-box.dark .popup-como-paso-texto {
  color: var(--gray-soft);
}

.popup-como-paso-texto em {
  font-style: italic;
}

.popup-pedido-actions {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  justify-content: center;
}

.popup-pedido-ok {
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.popup-pedido-ok.light {
  background-color: var(--gray-base);
  color: #FFFFFF;
}

@media (hover: hover) {
  .popup-pedido-ok.light:hover {
    opacity: 0.9;
  }
}

html.dark .popup-pedido-ok.dark {
  background-color: #B3B3B3;
  color: #000000;
}

html.dark .popup-pedido-ok.dark:hover {
  opacity: 0.9;
}

/* ============================================
   MODAL DE PRODUCTO
   ============================================ */

.modal-producto-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: popup-fade-in 0.2s ease;
}

@media (max-width: 767px) {
  .modal-producto-overlay {
    z-index: 10000;
  }
}

.modal-producto-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: popup-scale-in 0.25s ease;
  background: #FFFFFF;
  color: #000000;
}

/* Modal en dark: paleta neutra (theme.css) */

/* Cuando está cerrando, sobrescribir la animación de apertura */
.modal-producto-overlay.cerrando {
  animation: popup-fade-out 0.2s ease forwards !important;
}

.modal-producto-box.cerrando {
  animation: popup-scale-out 0.25s ease forwards !important;
}

/* Modal en dark: paleta neutra (theme.css) */
html.dark .modal-producto-box {
  background-color: var(--gray-deep);
  color: var(--gray-soft);
}

.modal-producto-cerrar {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

@media (hover: hover) {
  .modal-producto-cerrar:hover {
    background: rgba(0, 0, 0, 0.12);
  }
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes popup-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popup-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes popup-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes popup-scale-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}
