/* ============================================
   modal.css - Modales a pantalla completa (sin overlay)
   El Bocadón · Hamburguesería
   VERSIÓN CORREGIDA - SIN :has(), CON modal-open
   ============================================ */

/* ============================================================
   OCULTAR SCROLL DEL BODY CUANDO HAY UN MODAL ABIERTO
   (usando la clase modal-open que se añade desde JavaScript)
   ============================================================ */
body.modal-open {
  overflow: hidden !important;
  height: 100% !important;
  position: fixed !important;
  width: 100% !important;
  top: 0 !important;
  left: 0 !important;
}

/* ============================================================
   MODAL CON OVERLAY (centrado)
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 24px;
  padding: 2rem 2rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  box-sizing: border-box;
  animation: modalFadeIn 0.3s ease;
}

/* ============================================================
   SCROLL PERSONALIZADO DEL MODAL
   ============================================================ */
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f5f0eb;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 10px;
  transition: background 0.3s;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #b8942f;
}

/* Firefox */
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #f5f0eb;
}

/* ============================================================
   BOTÓN DE CIERRE (X) - ESTILO UNIFICADO (FIJO)
   ============================================================ */
.modal-close,
.modal-close-x {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  background: #c0392b !important;
  color: white !important;
  border: none !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  font-size: 1.8rem !important;
  cursor: pointer !important;
  z-index: 100001 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transition: transform 0.2s !important;
  font-family: 'Montserrat', sans-serif;
  padding: 0;
  line-height: 1;
  float: none;
  margin: 0;
}

.modal-close:hover,
.modal-close-x:hover {
  transform: scale(1.05) !important;
  color: white !important;
  background: #a93226 !important;
}

.modal-close:active,
.modal-close-x:active {
  transform: scale(0.95) !important;
}

/* ============================================================
   MODAL FULLSCREEN (pantalla completa sin overlay)
   ============================================================ */
.modal-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 99999;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: none;
  padding: 0;
  box-sizing: border-box;
}

.modal-fullscreen.active,
.modal-fullscreen:not(.hidden) {
  display: block !important;
}

.modal-fullscreen.hidden {
  display: none !important;
}

.modal-fullscreen-content {
  width: 100%;
  height: 100%;
  padding: 2rem 1.5rem;
  position: relative;
  overflow-y: auto;
}

/* ============================================================
   SCROLL PERSONALIZADO DEL MODAL FULLSCREEN
   ============================================================ */
.modal-fullscreen::-webkit-scrollbar {
  width: 8px;
}

.modal-fullscreen::-webkit-scrollbar-track {
  background: #f5f0eb;
}

.modal-fullscreen::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 4px;
  transition: background 0.3s;
}

.modal-fullscreen::-webkit-scrollbar-thumb:hover {
  background: #b8942f;
}

/* Firefox */
.modal-fullscreen {
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #f5f0eb;
}

/* ============================================================
   BOTÓN DE CIERRE PARA MODAL FULLSCREEN (hereda el estilo unificado)
   ============================================================ */
.modal-fullscreen .modal-close-x {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  background: #c0392b !important;
  color: white !important;
  border: none !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  font-size: 1.8rem !important;
  cursor: pointer !important;
  z-index: 100001 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  transition: transform 0.2s !important;
  font-family: 'Montserrat', sans-serif;
  padding: 0;
  line-height: 1;
}

.modal-fullscreen .modal-close-x:hover {
  transform: scale(1.05) !important;
  background: #a93226 !important;
  color: white !important;
}

.modal-fullscreen .modal-close-x:active {
  transform: scale(0.95) !important;
}

/* Eliminamos el estilo antiguo de modal-fullscreen-close que ya no se usa */
.modal-fullscreen-close {
  display: none !important;
}

/* ============================================================
   MODALES DE ÉXITO (pantalla completa sin overlay)
   ============================================================ */
.modal#modalExito .modal-content,
.modal#modalExitoKiosko .modal-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: #ffffff;
  max-height: 90vh;
}

.exito-content {
  max-width: 600px;
  width: 100%;
  text-align: center;
  padding: 1rem;
}

.exito-icono {
  font-size: 5rem;
  color: #27ae60;
  margin-bottom: 1rem;
}

.exito-content h2 {
  font-family: 'Bangers', cursive;
  font-size: 2.2rem;
  color: #3e2a21;
  margin-bottom: 0.5rem;
}

.exito-numero {
  font-size: 1.2rem;
  color: #555;
}

.exito-numero strong {
  color: var(--color-marca);
  font-size: 1.6rem;
}

.exito-mensaje {
  font-size: 1rem;
  color: #555;
  margin: 1rem 0;
  line-height: 1.6;
}

.exito-tiempo {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-marca-oscuro);
  background: #fef9f0;
  padding: 0.5rem 1.5rem;
  border-radius: 40px;
  display: inline-block;
  margin: 0.5rem 0 1.5rem;
}

.exito-content .btn-primary {
  margin-top: 0.5rem;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .modal-content {
    padding: 1.5rem 1rem;
    max-height: 95vh;
    border-radius: 20px;
  }
  
  .modal-close,
  .modal-close-x,
  .modal-fullscreen .modal-close-x {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.4rem !important;
    top: 12px !important;
    right: 12px !important;
  }
  
  .modal-fullscreen-content {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 400px) {
  .modal-content {
    padding: 1rem 0.8rem;
    border-radius: 16px;
  }
  
  .modal-close,
  .modal-close-x,
  .modal-fullscreen .modal-close-x {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
    top: 8px !important;
    right: 8px !important;
  }
  
  .modal-fullscreen-content {
    padding: 1rem 0.8rem;
  }
}

/* ============================================================
   SCROLL DEL MODAL PERSONALIZADO (TIENDA)
   ============================================================ */
/* Para el modal de personalización en tienda */
#modalPersonalizar .modal-content {
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
}

#modalPersonalizar .modal-content::-webkit-scrollbar {
  width: 6px;
}

#modalPersonalizar .modal-content::-webkit-scrollbar-track {
  background: #f5f0eb;
  border-radius: 10px;
}

#modalPersonalizar .modal-content::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 10px;
  transition: background 0.3s;
}

#modalPersonalizar .modal-content::-webkit-scrollbar-thumb:hover {
  background: #b8942f;
}

#modalPersonalizar .modal-content {
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #f5f0eb;
}

/* Para el modal de detalle de producto en tienda */
#modalProductoDetalle .modal-content {
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
}

#modalProductoDetalle .modal-content::-webkit-scrollbar {
  width: 6px;
}

#modalProductoDetalle .modal-content::-webkit-scrollbar-track {
  background: #f5f0eb;
  border-radius: 10px;
}

#modalProductoDetalle .modal-content::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 10px;
  transition: background 0.3s;
}

#modalProductoDetalle .modal-content::-webkit-scrollbar-thumb:hover {
  background: #b8942f;
}

#modalProductoDetalle .modal-content {
  scrollbar-width: thin;
  scrollbar-color: #d4af37 #f5f0eb;
}