/* ======================= Estilos Notificación tipo WhatsApp ======================= */

/* -------------------- Popup flotante (toasts) -------------------- */
.notif-popup {
  display: none; /* oculto por defecto */
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 85%;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
}

/* Burbuja estilo WhatsApp */
.notif-bubble {
  background: #dcf8c6;
  color: #111;
  padding: 12px 16px;
  border-radius: 20px;
  border-bottom-right-radius: 5px;
  font-size: 14px;
  max-width: 320px;
  width: auto;
  word-wrap: break-word;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  position: relative;
  animation: slideIn 0.4s ease forwards;
  font-family: "Segoe UI", sans-serif;
}

/* Triángulo estilo burbuja de chat */
.notif-bubble::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -5px;
  width: 0;
  height: 0;
  border-left: 8px solid #dcf8c6;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* Título de la burbuja */
.notif-bubble strong {
  display: block;
  margin-bottom: 4px;
  color: #075e54;
  font-weight: 600;
}

/* Texto */
.notif-bubble p {
  margin: 0;
  line-height: 1.3;
}

/* Animación de entrada */
@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(120%);
  }
  70% {
    opacity: 1;
    transform: translateX(-4%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Ocultar con transición */
.notif-bubble.hide {
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.3s ease;
}

/* -------------------- Contenedor de toasts -------------------- */
#notification-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  max-width: 85%;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Toast individual */
.notification {
  background: #fff;
  border-radius: 15px;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  font-size: 14px;
  color: #111;
  word-wrap: break-word;
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.5s ease;
}

.notification-show {
  opacity: 1;
  transform: translateX(0);
}

.notification-hide {
  opacity: 0;
  transform: translateX(120%);
}

.notification-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 14px;
}

/* -------------------- Animación campana -------------------- */
@keyframes vibrar {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(15deg);
  }
  50% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.icon-vibrate {
  animation: vibrar 0.5s infinite;
}

/* -------------------- Campana -------------------- */
#notif-wrapper {
  position: relative;
  display: inline-block;
  z-index: 9999;
}
#notif-icon {
  font-size: 32px;
  cursor: pointer;
  color: #333;
  position: relative;
  z-index: 10000;
}
#notif-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: red;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* -------------------- Animación campana -------------------- */
@keyframes vibrar {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(15deg);
  }
  50% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
.icon-vibrate {
  animation: vibrar 0.5s infinite;
}

/* -------------------- Panel de notificaciones -------------------- */

/* #notif-panel .notif-item {
    background: #DCF8C6;
    border-radius: 16px;
    border-bottom-right-radius: 6px;
    padding: 12px 16px;
    margin: 6px 0;
    position: relative;
}

#notif-panel .notif-item::after {
    content: "";
    position: absolute;
    bottom: 8px;
    right: -6px;
    width: 0; height: 0;
    border-left: 8px solid #DCF8C6;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
} */

/* Notificación nueva (no leída) */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  background: #e6f7ff; /* color discreto de "no leído" */
  transition: background 0.3s;
}

/* Notificación vista */
.notif-item.visto {
  background: #fff; /* color normal de leída */
}

.notif-panel {
  position: absolute;
  top: 40px;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: #e6f7ff;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 10px 0;
  z-index: 9999;
}

/* Notificación individual */
/* ================= Notificaciones estilo Facebook ================= */

/* Panel de notificaciones */
.notif-panel {
  position: absolute;
  top: 45px;
  right: 0;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 8px 0;
  z-index: 9999;
}

/* Scroll suave */
.notif-panel::-webkit-scrollbar {
  width: 6px;
}
.notif-panel::-webkit-scrollbar-thumb {
  background: #b0b3b8;
  border-radius: 3px;
}

/* Item individual */
/* ================= Notificaciones estilo Facebook (mejorado) ================= */

/* Panel de notificaciones */
.notif-panel {
  position: absolute;
  top: 45px;
  right: 0;
  width: 360px;
  max-height: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 8px 0;
  z-index: 9999;
}

/* Scroll suave */
.notif-panel::-webkit-scrollbar {
  width: 6px;
}
.notif-panel::-webkit-scrollbar-thumb {
  background: #b0b3b8;
  border-radius: 3px;
}

/* Item individual */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  background: #f0f2f5; /* fondo para no leído */
  transition: background 0.3s, transform 0.2s;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 12px;
  margin: 4px 8px;
  word-break: break-word;
}

/* Item leído */
.notif-item.visto {
  background: #fff;
}

.notif-item:hover {
  background: #e4e6eb;
  transform: translateY(-1px);
}

/* Avatar o icono */
.notif-item .notif-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  overflow: hidden;
}

/* Contenido del item */
.notif-item .notif-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

/* Título */
.notif-item .notif-content .title {
  font-weight: 600;
  font-size: 14px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mensaje */
.notif-item .notif-content .message {
  font-size: 13px;
  color: #555;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* máximo 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fecha/Hora */
.notif-item .notif-content .datetime {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  align-self: flex-end;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* -------------------- Toasts flotantes -------------------- */
#notification-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  max-width: 85%;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notification {
  background: #fff;
  border-radius: 15px;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  font-size: 14px;
  color: #111;
  word-wrap: break-word;
  opacity: 0;
  transform: translateX(120%);
  transition: all 0.5s ease;
}
.notification-show {
  opacity: 1;
  transform: translateX(0);
}
.notification-hide {
  opacity: 0;
  transform: translateX(120%);
}
.notification-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 14px;
}

/* -------------------- Modal con fondo bloqueador -------------------- */
/* Backdrop */
/* Backdrop */
/* BACKDROP */
#notif-modal-backdrop {
    display: none; /* siempre oculto al cargar */
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

#notif-modal {
    display: none; /* oculto por defecto */
    background: #fff;
    border-radius: 20px;
    width: 420px;
    max-width: 95%;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    flex-direction: column;
    overflow: hidden;
    animation: scaleFadeIn 0.3s ease-out;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

/* HEADER */
.notif-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1d3557;
    padding: 15px 20px;
    color: #fff;
}

.notif-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 600;
}

.bag-icon {
    font-size: 1.5rem;
}

#notif-modal-close {
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s ease;
}

#notif-modal-close:hover {
    color: #f77f00;
    transform: scale(1.2);
}

/* INFO CLIENTE */
.notif-modal-info {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8f9fa;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.info-icon {
    font-size: 1.2rem;
    color: #1d3557;
}

/* LISTA DE PEDIDOS */
.notif-modal-order {
    padding: 15px 20px;
}

.notif-modal-order h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1d3557;
    margin-bottom: 12px;
}

.notif-modal-order ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.notif-modal-order ul li {
    background: #e0f7fa;
    padding: 12px 15px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.notif-modal-order ul li:hover {
    background: #b2ebf2;
    transform: translateY(-2px);
}

/* BOTÓN DE ACCIÓN */
.notif-modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    border-top: 1px solid #e0e0e0;
}

.btn-confirm {
    padding: 12px 25px;
    border-radius: 14px;
    background: #1d3557;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirm:hover {
    background: #FFB03C;
    transform: scale(1.05);
}

/* ANIMACIÓN */
@keyframes scaleFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* SCROLL ESTILO MODERNO */
.notif-modal-order ul::-webkit-scrollbar {
    width: 6px;
}

.notif-modal-order ul::-webkit-scrollbar-thumb {
    background: #81ecec;
    border-radius: 3px;
}
/* Icono campana más pequeño */
#notif-icon i {
  font-size: 20px;
}
