/**
 * Shared cart line-item markup (cart / checkout summary / thank-you).
 */

.vmt-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.vmt-cart-item-media {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-secondary);
}

.vmt-cart-item-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vmt-cart-item-placeholder {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--color-background-primary);
}

.vmt-cart-item-body {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.vmt-cart-item-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.vmt-cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vmt-cart-item-detail {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--color-text-secondary);
}

.vmt-cart-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  flex: 0 0 auto;
}

.vmt-cart-item-price {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  text-align: right;
}

.vmt-cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.vmt-cart-item-quantity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vmt-cart-item-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-white);
  color: var(--color-text-primary);
  cursor: pointer;
}

.vmt-cart-item-qty {
  min-width: 1.25em;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
}

.vmt-cart-item-edit {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Cart list spacing */
#vmt-sell-cart .vmt-cart-item {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

#vmt-sell-cart .vmt-cart-item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

#vmt-sell-cart .vmt-cart-item-quantity {
  padding: 8px 0;
  border: 0.5px solid var(--color-border);
  border-radius: 6px;
}

#vmt-sell-cart .vmt-cart-item-qty-btn {
  width: auto;
  height: auto;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#vmt-sell-cart .vmt-cart-item-edit {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 700;
}

/* Summary lists (checkout / thank-you) */
.vmt-order-summary-items .vmt-cart-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.vmt-order-summary-items .vmt-cart-item:first-child {
  padding-top: 0;
}

.vmt-order-summary-items .vmt-cart-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

@media (max-width: 820px) {
  .vmt-cart-item-body {
    flex-direction: column;
  }

  .vmt-cart-item-meta {
    align-items: flex-start;
  }

  .vmt-cart-item-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
}