body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  margin: 0;
  padding: 0;
}

header {
  background-color: #fff;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  font-size: 1.8em;
  font-weight: bold;
}

main {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 30px;
  justify-content: center;
}


/* === LAYOUT GENERAL: MENU IZQUIERDA + GALERÍA DERECHA === */
.catalogo-container {
  display: flex;
  height: auto;
  overflow: hidden;

}

/* === SIDEBAR IZQUIERDA === */

.sidebar {
  position: fixed;
  top: 0;
  left: 0; /* o left: 0 si la quieres a la izquierda */
  width: 200px;
  height: 100vh; /* ocupa toda la altura visible */
  background: #ffffff;
  border-left: 2px solid #e3e6ea;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow-y: auto;
  z-index: 100;
}




.sidebar h2 {
  font-size: 1.1rem;
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 20px;
}

.folder-list {
  flex: 1;
  overflow-y: auto;
}

/* === GALERÍA DERECHA === */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 220px; /* deja espacio visible sin mover todo el bloque */
  box-sizing: border-box;
}

.main-content h1 {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 25px;
  color: #333;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

/* === SCROLL PERSONALIZADO === */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
#folderList {
  flex: 1 1 280px;
  max-width: 200px;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.folder h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2em;
  cursor: pointer;
}


.folder ul {
  list-style: none;
  padding-left: 20px;
}

.folder ul li a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.folder ul li a:hover {
  text-decoration: underline;
}

#gallery {
  flex: 2 1 450px;
  background: white;
  border-radius: 12px;
  padding: 0px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#gallery img {
  max-width: 200px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#gallery img:hover {
  transform: scale(1.05);
}

/* Lightbox */
#lightbox {
  position: fixed;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

/* =============================
   📱 MODO MÓVIL (Responsive)
   ============================= */
@media (max-width: 768px) {
  main {
    flex-direction: column;
    padding: 15px;
  }

  #folderList {
    max-width: 100%;
    flex: 1 1 100%;
    font-size: 1.1em;
    padding: 25px;
  }

  .folder h3 {
    font-size: 1.3em;
  }

  .folder ul li a {
    font-size: 1.1em;
    padding: 6px 0;
  }

  #gallery {
    flex: 1 1 100%;
    padding: 15px;
  }

  #gallery img {
    max-width: 45%;
  }

  header {
    font-size: 1.5em;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  #gallery img {
    max-width: 90%;
  }

  #folderList {
    font-size: 1.2em;
  }
}

/* === BOTÓN FLOTANTE GLOBAL === */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background-color: #25D366;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float img {
  width: 55px;
  height: 55px;
}

/* === BOTÓN DE WHATSAPP DENTRO DEL LIGHTBOX === */
.whatsapp-lightbox {
  position: fixed;
  display: none;
  bottom: 40px;
  right: 40px;
  background-color: #25D366;
  border-radius: 50%;
  padding: 12px;
  z-index: 2000;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.whatsapp-lightbox:hover {
  transform: scale(1.1);
}

.whatsapp-lightbox img {
  width: 60px;
  height: 60px;
}

/* Ajuste para móviles */
@media (max-width: 768px) {
  .whatsapp-float img,
  .whatsapp-lightbox img {
    width: 65px;
    height: 65px;
  }

  .whatsapp-lightbox {
    bottom: 20px;
    right: 20px;
  }
}
/* === BOTÓN FLOTANTE GLOBAL === */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background-color: #25D366;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float img {
  width: 55px;
  height: 55px;
}

/* === BOTÓN DENTRO DEL LIGHTBOX === */
.whatsapp-lightbox {
  position: fixed;
  display: none;
  bottom: 40px;
  right: 40px;
  background-color: #25D366;
  border-radius: 50px;
  padding: 12px 20px;
  z-index: 2000;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.whatsapp-lightbox img {
  width: 40px;
  height: 40px;
}

.whatsapp-lightbox span {
  white-space: nowrap;
}

.whatsapp-lightbox:hover {
  transform: scale(1.05);
  background-color: #20b95d;
}

/* Ajuste para móviles */
@media (max-width: 768px) {
  .whatsapp-float img {
    width: 65px;
    height: 65px;
  }

  .whatsapp-lightbox {
    bottom: 20px;
    right: 20px;
    padding: 14px 18px;
    font-size: 1rem;
  }

  .whatsapp-lightbox img {
    width: 35px;
    height: 35px;
  }
}

/* 🛒 Botón dentro del Lightbox */
.order-btn {
  position: absolute;
  bottom: 40px;
  right: 50%;
  transform: translateX(50%);
  background-color: #25D366;
  color: white;
  font-weight: bold;
  padding: 12px 22px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 1.1em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 2001;
}

.order-btn:hover {
  background-color: #1ebe57;
  transform: translateX(50%) scale(1.05);
}

/* 💬 Botón flotante de WhatsApp */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: #25D366;
  color: white;
  font-size: 28px;
  text-align: center;
  padding: 15px;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  z-index: 100;
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  background-color: #1ebe57;
  transform: scale(1.1);
}

/* 💡 Lightbox por encima de todo */
#lightbox {
  z-index: 2000 !important;
}
#lightbox-whatsapp {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #25D366;
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  border-radius: 50px;
  padding: 12px 18px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
  z-index: 2000;
}

#lightbox-whatsapp:hover {
  transform: scale(1.05);
  background-color: #1ebe5b;
}
/* --- Alineación del texto y galería --- */
.main-content {
  display: flex;
  flex-direction: column;  /* 🔹 fuerza que el texto esté arriba */
  align-items: center;
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin-top: 20px;
}


#catalogo-dm {
  all: unset;
  display: block;
}

#catalogo-dm * {
  box-sizing: border-box;
  font-family: 'Segoe UI', Arial, sans-serif !important;
}
#gallery img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
}
/* ✨ Placeholder shimmer effect */
#gallery img.placeholder {
  background: linear-gradient(90deg, #eee, #f5f5f5, #eee);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 200px;
  opacity: 0.5;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ✨ Fade-in suave */
#gallery img.loaded {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease, transform 0.3s ease;
}

/* 🔸 Estado inicial */
#gallery img {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.5s ease, transform 0.3s ease;
}
/* 🔹 Cursor de mano en las carpetas principales */
.folder-header {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 8px;
  border-radius: 8px;
}

/* 🔹 Efecto hover visual */
.folder-header:hover {
  background-color: #f0f0f0;
  color: #007bff;
}
/* === PANEL LATERAL MODERNO === */
#folderList {
  background: #f8fafc;
  border-right: 2px solid #e3e6ea;
  width: 280px;
  padding: 25px 15px;
  box-shadow: inset -1px 0 4px rgba(0, 0, 0, 0.05);
  overflow-y: auto;
  max-height: 90vh;
  border-radius: 12px;
}

/* Categorías principales */
.folder-header {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  border-radius: 8px;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.folder-header:hover {
  background: #e2e8f0;
  color: #2563eb;
  transform: translateX(2px);
}

/* Subcarpetas */
.subfolder-list {
  list-style: none;
  margin-top: 5px;
  padding-left: 20px;
  border-left: 2px solid #e3e6ea;
}

.subfolder-list li a {
  display: block;
  padding: 6px 10px;
  color: #475569;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.3s, color 0.3s, padding-left 0.3s;
}

.subfolder-list li a:hover {
  background: #e0f2fe;
  color: #0284c7;
  padding-left: 14px;
}

/* Scroll suave */
#folderList::-webkit-scrollbar {
  width: 8px;
}
#folderList::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}
#folderList::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
@media (max-width: 768px) {
  #gallery img {
    height: 180px;
  }
  #folderList {
    font-size: 1.1em;
  }
}
/* === RESPONSIVE === */
@media (max-width: 768px) {
  .catalogo-container {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 2px solid #e3e6ea;
  }

  .main-content {
    height: auto;
    overflow-y: visible;
    padding: 20px;
  }
}
@media (max-width: 768px) {

  /* 🔹 La barra lateral ya NO es fija */
  .sidebar {
    position: relative;   /* deja de estar fija */
    width: 100%;          /* ocupa todo el ancho */
    height: auto;         /* su altura depende del contenido */
    border-left: none;
    border-top: 2px solid #e3e6ea;
    box-shadow: none;
    padding: 15px 20px;
  }

  /* 🔹 El contenido vuelve a ocupar todo el ancho */
  .main-content {
    margin-right: 0; /* elimina el margen */
    padding: 20px;
  }

  .gallery {
    gap: 10px;
  }
}
/* === 📺 Escritorio (mantiene espacio para la barra lateral fija) === */
@media (min-width: 769px) {
  .main-content {
    padding: 30px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding-right: 30px; /* espacio interior normal */
    margin-left:  220px; /* 🔹 deja espacio para la barra lateral fija */
    box-sizing: border-box;
  }
}

/* === 📱 Móviles (la barra deja de ser fija) === */
@media (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 2px solid #e3e6ea;
    box-shadow: none;
    padding: 15px 20px;
  }

  .main-content {
    margin-right: 0;   /* 🔹 elimina el espacio extra */
    padding-right: 0;  /* 🔹 usa todo el ancho */
  }
}
/* === 🍔 BOTÓN HAMBURGUESA FIJO Y VISIBLE === */
.menu-toggle {
  display: none;
  position: fixed;      /* 🔹 Siempre visible */
  top: 15px;            /* 🔹 Ajusta la altura */
  left: 15px;           /* 🔹 Separado del borde */
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px 18px;
  font-size: 1.2em;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  z-index: 3000;        /* 🔹 Por encima de todo */
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.menu-toggle:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

/* === 📱 SOLO SE MUESTRA EN MÓVIL === */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -260px; /* Oculta fuera de pantalla */
    width: 240px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    transition: left 0.3s ease;
    z-index: 2500;
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
  }

  body.sidebar-open::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 2000;
  }
}
@media (max-width: 768px) {
  .sidebar {
    padding-top: 70px; /* 🔹 Espacio para el botón */
  }
}
.empty-message {
  text-align: center;
  color: #777;
  font-size: 1.2em;
  margin-top: 40px;
  opacity: 0.8;
}

.loading-msg {
  text-align: center;
  color: #555;
  font-style: italic;
  margin-top: 30px;
}
@media (max-width: 768px) {
  #lightboxContent {
    flex-direction: column !important;
  }
  #imgContainer, #pedidoBox {
    flex: 1 1 100% !important;
  }
}