/* ==== LAYOUT GENERAL DEL CARRITO ==== */

/* Layout carrito + resumen: replica 1fr / 320px del inline original */
.cart-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: flex-start;
}

/* Versión mobile: se apilan carrito y resumen en una columna */
@media (max-width: 900px) {
  .cart-page {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==== LISTA DE PRODUCTOS (panel izquierdo) ==== */

#cart {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

#cart .cart-empty {
  padding: 18px 20px;
  font-size: 14px;
  color: var(--muted, #6b7280);
}

/* cada ítem */

#cart .item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 90px 120px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
}

#cart .item:last-child {
  border-bottom: none;
}

#cart .thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f6;
}

/* info del producto */

#cart .info .name {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  margin: 0 0 2px;
}

#cart .info .meta {
  font-size: 12px;
  color: var(--muted, #6b7280);
}

/* cantidad */

/* cantidad */

#cart .qty {
  text-align: center;
}

/* cápsula − 1 + */

#cart .qty-control {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 2px 6px;
}

#cart .qty-input {
  width: 52px;
  border: none;
  text-align: center;
  font-size: 14px;
  outline: none;
  background: transparent;
  -moz-appearance: textfield;
}

/* sacar flechas del number input */

#cart .qty-input::-webkit-outer-spin-button,
#cart .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* botones ± */

#cart .qty-btn {
  border: none;
  background: transparent;
  padding: 4px 8px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  color: #4b5563;
  border-radius: 999px;
  transition: background 0.1s ease-out;
}

#cart .qty-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

#cart .qty-input {
  width: 80px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  text-align: center;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
}

/* sacar flechas del number input */

#cart .qty-input::-webkit-outer-spin-button,
#cart .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#cart .qty-input {
  -moz-appearance: textfield;
}

/* precio + botón eliminar */

#cart .line-price {
  text-align: right;
}

#cart .price {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: #111827;
  margin-bottom: 4px;
}

#cart .remove {
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

#cart .remove:hover {
  color: #b91c1c;
}

/* ==== TARJETA DE RESUMEN (panel derecho) ==== */

#cart-summary {
  background: #fff;
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#cart-summary h2 {
  font-size: 18px;
  margin: 0 0 4px;
  color: #111827;
}

#cart-summary .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

#cart-summary span.label {
  color: #4b5563;
}

#cart-summary strong {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

/* botón Cotizar */

#cart-summary #btn-quote,
#btn-quote {
  margin-top: 6px;
  width: 100%;
  border-radius: 999px;
  padding: 9px 14px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  background: var(--primary, #16a34a);
  color: #fff;
  cursor: pointer;
  transition:
    background 0.15s ease-out,
    box-shadow 0.15s ease-out,
    transform 0.05s ease-in;
}

#cart-summary #btn-quote:hover,
#btn-quote:hover {
  background: #15803d;
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.35);
}

#cart-summary #btn-quote:active,
#btn-quote:active {
  transform: translateY(1px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.3);
}

/* nota de receta */

#cart-summary .note,
#cart-summary p.meta {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin: 8px 0 0;
}

/* aseguramos un contexto de apilamiento en cada fila */
#cart .item {
  position: relative;
}

/* la cápsula de cantidad va por encima del precio */
#cart .qty-control {
  position: relative;
  z-index: 2;
}

/* el contenedor del precio queda debajo */
#cart .line-price {
  position: relative;
  z-index: 1;
}
