/* ───────────── Layout principal ───────────── */
.lista-carrito {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin: 3rem;
  flex-wrap: wrap;
}

.items-carrito {
  flex: 2;
  display: flex;
  flex-direction: column;
}

.resumen-y-confirmacion {
  flex: 1;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--color-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 1.5rem;
  align-items: center;
  text-align: center;
}

/* ───────────── Ítems del carrito ───────────── */
.item-carrito {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  margin-bottom: 2rem;
  align-items: stretch;
  background: var(--color-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  max-width: 700px;
  width: 100%;
}

.item-carrito img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.detalle-producto {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nombre-producto {
  font-size: 1.1rem;
  font-weight: var(--font-weight-medium);
  margin-left: 20px;
  margin-bottom: 5px;
}

.header-detalle {
  display: flex;
  justify-content: space-between;
  padding-top: 0.5rem;
}

.boton-quitar {
  padding: 6px 20px;
  background: var(--color-white);
  color: var(--color-primary);
  border: 0;
  font-weight: bold;
  font-size: 1.7rem;
  cursor: pointer;
}

.boton-quitar:hover {
  color: #313131;
}

.precio {
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-left: 20px;
  margin-bottom: 5px; /* Tu cambio */
}

/* ───────────── Cotización y envío ───────────── */
legend {
  font-size: 1.25rem;
  margin-bottom: 0;
  font-family: var(--font-secondary);
}

.acotacion {
  color: var(--color-secondary);
  font-size: 1rem;
  text-decoration: none;
  margin-left: 0.5rem;
}

.cotizacion-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
}

.cotizacion-horizontal {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
}

.cotizacion-horizontal input,
.cotizacion-horizontal button {
  border: 1px solid var(--color-primary);
  border-radius: 0;
  height: 40px;
  font-size: 1rem;
}

.cotizacion-horizontal input {
  padding: 0 1rem;
  width: 220px;
  outline: none;
  border-right: none;
}

.cotizacion-horizontal button {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 0 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.cotizacion-horizontal button:hover {
  background-color: var(--color-secondary);
}

.tarjetas-envio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tarjeta-envio {
  border: 1px solid var(--color-white);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
  text-align: left;
  font-size: 1rem;
}

.tarjeta-envio.selected {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary);
  background-color: var(--color-white);
}

.tarjeta-envio input[type="radio"] {
  margin-right: 0.5rem;
  cursor: pointer;
}

/* ───────────── Resumen de costos ───────────── */
.resumen-carrito {
  width: 100%;
  font-weight: var(--font-weight-medium);
  font-size: 1.2rem;
  color: var(--color-primary);
  padding: 0 1rem;
}

.costos {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  margin-top: 1rem;
}

.resumen-costos {
  width: 100%;
  margin-top: 1rem;
}

.resumen-costos .fila {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--color-white);
}

.resumen-costos .fila:last-child {
  border-bottom: none;
}

.resumen-costos .total {
  font-weight: var(--font-weight-bold);
  font-size: 1.2rem;
  margin-top: 8px;
}

.finalizar-compra-container {
  display: flex;
  justify-content: center;
  margin-top: 0;
}

/* ───────────── Media Queries para responsividad ───────────── */
@media (max-width: 768px) {
  .lista-carrito {
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 1rem;
  }

  .items-carrito,
  .resumen-y-confirmacion {
    width: 100%;
  }

  .resumen-y-confirmacion {
    max-width: none;
    padding: 1rem;
    gap: 1rem;
  }

  .item-carrito {
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
  }

  .item-carrito img {
    width: 100px;
    height: 100px;
  }

  .nombre-producto {
    font-size: 1rem;
    margin-left: 10px;
  }

  .precio {
    font-size: 0.9rem;
    margin-left: 10px;
  }

  .boton-quitar {
    padding: 4px 12px;
    font-size: 1.2rem;
  }

  .cotizacion-horizontal input {
    width: 150px;
  }

  .tarjeta-envio {
    padding: 0.75rem;
  }

  .resumen-carrito {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .resumen-costos .total {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .lista-carrito {
    margin: 1rem 0.5rem;
    gap: 0.5rem;
  }

  .resumen-y-confirmacion {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .item-carrito {
    padding: 0.5rem;
    margin-bottom: 1rem;
    gap: 0.75rem;
  }

  .item-carrito img {
    width: 70px;
    height: 70px;
  }

  .nombre-producto {
    font-size: 0.9rem;
    margin-left: 5px;
  }

  .precio {
    font-size: 0.8rem;
    margin-left: 5px;
  }

  legend {
    font-size: 16px;
  }

  .boton {
    padding: var(--spacing-small) 70px;
  }

  .boton-quitar {
    padding: 3px 8px;
    font-size: 1rem;
  }

  .cotizacion-horizontal input {
    width: 140px;
    height: 30px;
  }

  .cotizacion-horizontal button {
    height: 30px;
    padding: 0 0.75rem;
  }

  .tarjeta-envio {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .resumen-carrito {
    font-size: 0.9rem;
    padding: 0 0.25rem;
  }

  .resumen-costos .total {
    font-size: 1rem;
  }
}