/* ============================= */
/* LAYOUT PRODUCTOS */
/* ============================= */

.productos-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px 15px;
  align-items: flex-start;
}

/* ============================= */
/* FILTROS PC */
/* ============================= */

.filtros {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  grid-column: 1;
  z-index: 1;
}

/* ============================= */
/* CONTENIDO */
/* ============================= */

.productos-contenido {
  grid-column: 2;
  width: 100%;
  min-width: 0;
}

/* ============================= */
/* GRID PRODUCTOS */
/* ============================= */

.productos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
}

/* ============================= */
/* CARD PRODUCTO */
/* ============================= */

.producto-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 🔥 CLAVE */
  height: 100%;
  box-sizing: border-box;
  cursor: pointer;
}


.producto-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}

/* ============================= */
/* TABLET */
/* ============================= */

@media (max-width: 1024px) {
  .productos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================= */
/* MOBILE */
/* ============================= */

@media (max-width: 768px) {

  /* layout una columna */
  .productos-layout {
    grid-template-columns: 1fr;
  }

  .productos-contenido,
  .filtros {
    grid-column: auto;
  }

  /* productos en 2 columnas */
  .productos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* ============================= */
  /* FILTROS TIPO DRAWER */
  /* ============================= */

  .filtros {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 1001; /* 🔥 MÁS QUE EL OVERLAY */
    padding: 20px;
    overflow-y: auto;
    transition: left 0.3s ease;
  }

  .filtros.activo {
    left: 0;
  }

  /* ============================= */
  /* OVERLAY */
  /* ============================= */

  #overlayFiltros {
    opacity: 0;
    pointer-events: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    transition: opacity 0.3s ease;
  }

  #overlayFiltros.activo {
    opacity: 1;
    pointer-events: auto;
  }

  .producto-card img {
    height: 150px;
  }
}

/* ============================= */
/* CELULAR PEQUEÑO */
/* ============================= */

@media (max-width: 420px) {
  .productos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================= */
/* FIX FINAL FILTROS MOBILE */
/* ============================= */

@media (max-width: 768px) {

  .filtros {
    display: block !important;        /* 🔥 CLAVE */
    visibility: visible !important;   /* 🔥 CLAVE */
    opacity: 1 !important;            /* 🔥 CLAVE */

    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;

    background: #fff;
    z-index: 2000;                    /* 🔥 MÁS QUE TODO */
    padding: 20px;
    overflow-y: auto;

    transition: left 0.3s ease;
  }

  .filtros.activo {
    left: 0;
  }

  #overlayFiltros {
    display: block;
    opacity: 0;
    pointer-events: none;

    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1500;

    transition: opacity 0.3s ease;
  }

  #overlayFiltros.activo {
    opacity: 1;
    pointer-events: auto;
  }
}

.producto-card button {
  margin-top: auto;          /* 🔥 empuja el botón abajo */
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  font-weight: 500;
  cursor: pointer;
}

.producto-card button:hover {
  background: #00bfa6;
  color: #fff;
  border-color: #00bfa6;
}

.producto-card {
  transition: 
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* 🐾 HOVER */
.producto-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.producto-card img {
  transition: transform 0.3s ease;
}

.producto-card:hover img {
  transform: scale(1.05);
}

.btn-ver-mas {
  padding: 12px 25px;
  border-radius: 25px;
  border: none;
  background: #ff7a00;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.btn-ver-mas:hover {
  background: #e86e00;
}
