/* ==========================================================================
   Cart line item — product row in cart
   ========================================================================== */

.cart-item {
  display: grid;
  grid-template-columns: 168px 1fr 120px 100px 120px 32px;
  gap: var(--space-4);
  align-items: center;
  padding-block: 20px;
  border-bottom: 1px solid #e6e6e6;
  position: relative;
}
.cart-item:last-child{
  border:unset;
}

/* --------------------------------------------------------------------------
   Thumbnail
   -------------------------------------------------------------------------- */

.cart-item__thumb {
  position: relative;
  width: 168px;
  height: 168px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  border-radius: var(--radius-lg);
}

.cart-item__thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.cart-item__sale-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 3px 5px;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Product name
   -------------------------------------------------------------------------- */

.cart-item__name {
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
}

.cart-item__name-link {
  color: #000;
  text-decoration: none;
}

.cart-item__name-link:hover {
  text-decoration: underline;
}

/* WC renders variation data here */
.cart-item__name dl {
  margin-block-start: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.cart-item__name dl dt,
.cart-item__name dl dd {
  display: inline;
  margin: 0;
}

.cart-item__name dl dd::after {
  content: ' ';
}

/* --------------------------------------------------------------------------
   Unit price
   -------------------------------------------------------------------------- */

.cart-item__price {
  font-size: var(--text-sm);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Qty stepper (reuses .qty-stepper from step 06)
   -------------------------------------------------------------------------- */

.cart-item__qty .qty-stepper {
  display: flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Subtotal
   -------------------------------------------------------------------------- */

.cart-item__subtotal {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  text-align: right;
}

/* --------------------------------------------------------------------------
   Remove button
   -------------------------------------------------------------------------- */

.cart-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__remove-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  transition: color 0.15s, background 0.15s;
}

.cart-item__remove-btn:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.cart-item__remove-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Responsive — mobile stacked layout
   -------------------------------------------------------------------------- */

@media (width <= 767px) {
  .cart-item {
    grid-template-columns: 100px 1fr 44px;
    grid-template-rows: auto auto auto;
    gap: var(--space-3);
    padding-block: var(--space-4);
  }

  .cart-item__thumb {
    width: 100px;
    height: 100px;
    grid-row: 1 / 3;
  }

  .cart-item__name {
    grid-column: 2;
    grid-row: 1;
  }

  .cart-item__remove {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  .cart-item__price {
    grid-column: 2;
    grid-row: 2;
  }

  .cart-item__qty {
    grid-column: 1 / 3;
    grid-row: 3;
  }

  .cart-item__subtotal {
    grid-column: 3;
    grid-row: 3;
    text-align: right;
  }

  /* Expand remove button to 44×44 tap target */
  .cart-item__remove-btn {
    width: 44px;
    height: 44px;
  }

  /* Show data titles on mobile */
  .cart-item__price::before {
    content: attr(data-title) ': ';
    color: var(--color-text-muted);
    font-weight: 400;
  }
}
