/* ================= CARrito: Badge en el ícono del header ================ */
.header-actions .cart-badge{
  position: absolute;
  top: -6px;
  right: -10px;
  background: #ff3b3b;
  color: #fff;
  font-size: .7rem;
  line-height: 1;
  padding: .2rem .35rem;
  border-radius: 999px;
}

/* ================== Botón "Agregar al carrito" en tarjetas ============== */
.product-card .btn.add-to-cart{
  min-width: 0; /* permite que se adapte al espacio disponible */
}
.add-to-cart { padding: .4rem .75rem; }
.add-to-cart .cart-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Prioriza clics en controles sobre la stretched-link del título */
.product-card { position: relative; }
.product-card .stretched-link::after { z-index: 0; }
.product-card .product-actions,
.product-card .qty-control,
.product-card .qty-control .btn,
.product-card .add-to-cart {
  position: relative;
  z-index: 2;
}

/* ================== Controles de cantidad (qty +/-) ===================== */
.qty-control{
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: .125rem;
}
.qty-control .btn{
  width: 28px;
  height: 28px;
  line-height: 1;
  border: none;
  box-shadow: none !important;
}
.qty-control .qty-input{
  width: 46px;
  text-align: center;
  border: none;
  outline: none;
  font-weight: 600;
  background: transparent;
  -moz-appearance: textfield;
}
.qty-control .qty-input::-webkit-outer-spin-button,
.qty-control .qty-input::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

/* Pega la fila de cantidad + carrito al fondo de la tarjeta */
.product-card .card-body{
  display: flex;
  flex-direction: column;
}
.product-card .product-actions{ margin-top: auto; }

/* Asegura igual altura para títulos de 1 o 2 líneas (coincide con global) */
.product-card .product-title{
  min-height: calc(1.35em * 2);
}

/* ================== Offcanvas del carrito =============================== */
.cart-offcanvas{ width: min(420px, 92vw); }
.cart-list{ display: grid; gap: .75rem; }
.cart-row{
  border: 1px solid rgba(0,0,0,.06);
  border-radius: .5rem;
  padding: .5rem;
}
.cart-thumb{
  width: 64px; height: 64px; object-fit: cover; border-radius: .35rem;
  background: #f5f5f7;
}
.cart-title{
  font-size: .95rem; line-height: 1.25; margin-bottom: .15rem;
}
.cart-qty .form-control{
  width: 52px; text-align: center; font-weight: 600;
}
.cart-qty .btn{ width: 32px; }
