/* catalogo.css */ 
/* Reset base */
* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:Arial,sans-serif; background:#f5f5f5; }

/* Header carrito */
header {
  background: #fff;
  padding: 60px 40px 40px;
  display: flex;
  justify-content: flex-end;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  position: relative;
  z-index: 10;
}

#cart-icon {
  position: relative;
  margin-right: 40px;
  font-size: 28px;
  cursor: pointer;
}
#cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #d93025;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Filtros */
#filtros-categorias {
  display: flex;
  gap: 12px;
  padding: 40px 40px 0 40px;
  background: #fff;
}
#filtros-categorias select {
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fafafa;
  margin: 0 12px 0 0;
  min-width: 220px;
  transition: border-color .2s;
}
#filtros-categorias select:focus {
  border-color: #0073aa;
  outline: none;
}

/* Controles */
#controls {
  display: flex;
  gap: 12px;
  padding: 40px 40px 20px;
  background: #fff;
  box-shadow: none;
}
#controls input,
#controls select {
  padding: 8px 12px;
  font-size: 16px;
  margin: 0 20px;
}

/* Títulos */
h2 { margin: 30px 40px 12px; font-size: 20px; }
.subcat-title { margin: 20px 40px 8px; font-weight: 600; }

/* Grilla */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 8px; }

/* Card */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
  padding: 6px;
}
.card:hover {
  transform: scale(1.025);
  box-shadow: 0 4px 20px rgba(0,0,0,0.16);
}
.card img {
  width: 100%;
  height: 90px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 8px 8px 0 0;
}
.info { padding: 7px; flex: 1; }
.info h3 { font-size: 13px; margin-bottom: 5px; }
.info p { font-size: 12px; margin-bottom: 3px; }
.info p.neto { font-size: 11px; color:#666; }

/* Acciones */
.actions { padding: 8px; border-top: 1px solid #eee; display: flex; align-items: center; gap: 6px; }
.actions input { width: 42px; padding: 2px; border: 1px solid #ccc; border-radius: 6px; }
.actions button {
  flex: 1;
  padding: 5px;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.actions button:hover { background: #005a8c; }

/* Overlay */
#overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.4); display: none; align-items: flex-start; justify-content: flex-end; z-index: 1000; }
#overlay.active { display: flex; }
#cart-dropdown { background: #fff; width: 320px; margin: 20px; padding: 16px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* Lista carrito */
#cart-items { list-style: none; max-height: 200px; overflow-y: auto; margin: 0 0 12px; padding: 0; }
#cart-items li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee; }
#cart-items li:last-child { border-bottom: none; }
.remove-btn { background: transparent; border: none; color: #d93025; font-size: 16px; cursor: pointer; }

/* Botones carrito */
.cart-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.cart-actions button { flex: 1; padding: 6px; font-size: 14px; border: none; border-radius: 4px; cursor: pointer; }
#checkout-btn { background: #28a745; color: #fff; }
#clear-cart-btn { background: #f0ad4e; color: #fff; }
#close-cart-btn { background: transparent; color: #333; font-size: 18px; }

/* Formulario */
#order-form { display: none; }
#order-form input { width: 100%; padding: 8px; margin-bottom: 8px; border: 1px solid #ccc; border-radius: 4px; }
#order-form button { width: 100%; padding: 10px; background: #0073aa; color: #fff; border: none; border-radius: 4px; }

/* Responsive */
@media (max-width: 768px) {
  header { padding: 36px 6px 24px; }
  #cart-icon { margin-right: 8px; font-size: 24px; }
  #controls, #filtros-categorias {
    padding: 12px 6px 0 6px;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  #controls input, #controls select,
  #filtros-categorias select {
    width: 100%;
    margin: 0 0 8px 0;
    font-size: 16px;
    min-width: 0;
    box-sizing: border-box;
  }
  #catalogo { padding: 8px 4px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .card { padding: 4px; }
  .card img { height: 65px; border-radius: 7px 7px 0 0; }
  .info h3 { font-size: 12px; }
  .info p { font-size: 11px; }
  h2 { margin: 14px 6px 6px; font-size: 15px; }
  .subcat-title { margin: 10px 6px 4px; font-size: 13px; }
}