/* ======================================================
   pages/productos.css
   Catálogo público tipo Jumpseller
   ====================================================== */

/* ---------- LAYOUT GENERAL ---------- */

.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}


/* Contenedor específico del catálogo.
   Amplía solo la página de productos, sin afectar home ni páginas CMS. */
.container.catalog-layout {
  max-width: 1320px;
  width: 94%;
  margin: 0 auto;
}
/* Footer siempre al fondo (si hay poco contenido) */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ---------- SIDEBAR (IZQUIERDA) ---------- */

.catalog-sidebar {
  background: #f7f8fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  position: sticky;      /* COMPORTAMIENTO TIPO JUMPSELLER */
  top: 90px;              /* ajusta según altura del header */
}

.catalog-sidebar h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #555;
}

.catalog-sidebar .sidebar-section {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #ddd;
}

.catalog-sidebar .sidebar-section:last-child {
  border-bottom: none;
}

/* Categorías */
.catalog-sidebar a {
  display: block;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  padding: 6px 0;
}

.catalog-sidebar a.active {
  font-weight: 700;
  color: #000;
}

.catalog-sidebar a:hover {
  color: #000;
}

/* Select ordenar / mostrar */
.catalog-sidebar select,
.catalog-sidebar button {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
}

/* ---------- CONTENIDO DERECHA ---------- */

.catalog-content {
  min-width: 0;
}

/* ---------- PAGINACIÓN ---------- */

.pagination {
  margin-top: 32px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination a {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  color: #333;
}

.pagination a.active {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}


/* ---------- GRID DE PRODUCTOS ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 20px;
}



/* ---------- RESPONSIVE ---------- */



/* Laptop pequeña */
@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

/* Tablet */
@media (max-width: 900px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar {
    position: relative;
    top: auto;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}


/* ---------- CARD PRODUCTO ---------- */

.product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow .2s ease, transform .2s ease;
}

.product-card:hover {
  
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

/* Imagen */
.product-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 240px;
  margin-bottom: 8px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  transform: none;
}

.product-card-image img {
  transition: transform .25s ease;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Contenido */
.product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: 10px;
}

/* Título (máx 2 líneas) */
.product-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 8px 0 4px;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
  }

/* SKU */
.product-card-body .sku {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

/* Precio */
.product-card-price {
  font-size: 17px;
  font-weight: 900;
  color: #111;
  margin-top: auto;
}
/* Botón */
.product-card-actions {
    margin-top: auto;
}

.product-card-actions .btn {
  width: 100%;
  padding: 9px;
  font-size: 14px;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  text-align: center;
  transition: background .2s;
}

.product-card-actions .btn:hover {
  background: #111827;
}

.product-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}
.catalog-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}
.category-description {
  max-width: 720px;
  font-size: 15px;
  color: #555;
  margin-bottom: 24px;
}

.badge-off {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e60023;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 2;
}

.product-card-image {
    position: relative;
}

.price-compare {
    display: block;
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.price-final {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.price-final.offer {
    color: #e60023;
}

/* ======================================================
   SIDEBAR CATEGORÍAS COLAPSABLE — CATÁLOGO PÚBLICO
====================================================== */

.catalog-sidebar {
  border-radius: 14px;
  padding: 18px;
  background: #f8fafc;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.categoria-bloque {
  margin-bottom: 6px;
}

.categoria-padre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.categoria-padre > a {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.categoria-padre > a.active {
  background: #111827;
  color: #fff;
}

.toggle-subcategorias {
  width: 30px !important;
  height: 30px;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid #d1d5db !important;
  background: #fff !important;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}

.toggle-subcategorias:hover {
  background: #111827 !important;
  color: #fff;
}

.subcategorias {
  margin: 4px 0 10px 12px;
  padding-left: 12px;
  border-left: 2px solid #d1d5db;
}

.subcategoria-link {
  padding: 6px 10px !important;
  border-radius: 7px;
  font-size: 13px !important;
  color: #4b5563 !important;
}

.subcategoria-link:hover {
  background: #eef2ff;
  color: #111827 !important;
}

.subcategoria-link.active {
  background: #fbbf24;
  color: #111827 !important;
  font-weight: 800;
}


