/* ===== DIGITALDJIN - LAYOUT Y ESTRUCTURA ===== */
/* Contenedores, grids, scroll behavior, estructura de página */

/* ===== CONTENEDORES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-fluid {
  width: 100%;
  padding: 0 20px;
}

/* ===== FIX: Scroll correcto al navegar con anclas o JS ===== */
/* Evita que el header fijo tape el contenido al hacer scroll */
#productos-container,
main {
  scroll-margin-top: 160px; /* Header 100px + barra categorías 60px */
  scroll-behavior: smooth;
}

/* Ajuste para móvil: header más compacto */
@media (max-width: 768px) {
  #productos-container,
  main {
    scroll-margin-top: 145px;
  }
}

/* ===== GRIDS DE PRODUCTOS ===== */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columnas en escritorio */
  gap: 20px;
  margin: 40px 0;
}

/* Responsive: columnas adaptables */
@media (max-width: 1200px) {
  .productos-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
  .productos-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .productos-grid { grid-template-columns: 1fr; }
}

/* ===== GALERÍA DE PRODUCTO (ver_producto.php) ===== */
.galeria-principal {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.imagen-grande {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--color-border);
}

.imagen-grande img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--transition-normal);
}

.imagen-grande img:hover {
  transform: scale(1.02);
}

.miniaturas {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 0;
  scrollbar-width: none;
}

.miniaturas::-webkit-scrollbar {
  display: none;
}

.miniatura {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background: var(--color-bg-secondary);
}

.miniatura:hover,
.miniatura.activa {
  border-color: var(--color-primary);
  transform: scale(1.05);
}

.miniatura img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* ===== DETALLE DE PRODUCTO - LAYOUT ===== */
.producto-detalle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 40px 0;
  background: var(--color-bg-primary);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-md);
}

@media (max-width: 900px) {
  .producto-detalle {
    grid-template-columns: 1fr;
  }
  .imagen-grande {
    aspect-ratio: 4/3;
  }
}

/* ===== SECCIONES GENERALES ===== */
main {
  min-height: calc(100vh - 300px); /* Aprox: header + footer */
}

section {
  margin: 60px 0;
}

/* ===== UTILIDADES DE ESPACIADO ===== */
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.py-40 { padding: 40px 0; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }




/* ===== ESTRUCTURA BASE PARA STICKY FOOTER ===== */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto; /* ✅ Ocupa el espacio restante */
}