/*
 * Cart CSS
 * High-end electronics store redesign.
 *
 * @package wc-store
 */

.wcstore-cart-main {
  max-width: var(--wcstore-max-width);
  margin: 0 auto;
  padding: var(--sp-xl) var(--wcstore-container-pad) calc(var(--sp-xl) * 2);
}

.wcstore-cart-main .wcstore-page-title {
  margin-bottom: var(--sp-xl);
  text-align: center;
}

/* Cart table (distraction free, clean) */
.woocommerce-cart table.cart {
  width: 100%;
}

.woocommerce-cart table.cart thead th {
  border-bottom: 2px solid var(--wcstore-text);
  color: var(--wcstore-text);
  padding: var(--sp-sm) 0;
}

.woocommerce-cart table.cart td.product-thumbnail {
  width: 120px;
}

.woocommerce-cart table.cart td.product-thumbnail img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: var(--wcstore-radius-md);
  background: var(--wcstore-surface);
  mix-blend-mode: multiply;
}

/* Dark mode: disable multiply blend so images don't go invisible */
@media (prefers-color-scheme: dark) {
  .woocommerce-cart table.cart td.product-thumbnail img {
    mix-blend-mode: normal;
  }
}

html[data-theme='dark'] .woocommerce-cart table.cart td.product-thumbnail img {
  mix-blend-mode: normal;
}

.woocommerce-cart table.cart td.product-name a {
  font-family: var(--wcstore-font-heading);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--wcstore-text);
}

.woocommerce-cart table.cart td.product-price,
.woocommerce-cart table.cart td.product-subtotal {
  font-family: var(--wcstore-font-heading);
  font-weight: 500;
}

.woocommerce-cart table.cart a.remove {
  color: var(--wcstore-text-muted) !important;
  font-size: 24px;
  text-decoration: none;
  font-weight: 300;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all var(--duration-fast) var(--ease-out-expo);
}

.woocommerce-cart table.cart a.remove:hover {
  background: var(--wcstore-error);
  color: #fff !important;
}

/* Coupon + actions */
.woocommerce-cart table.cart td.actions {
  padding: var(--sp-lg) 0 0;
  border-top: 2px solid var(--wcstore-text);
}

.woocommerce-cart table.cart td.actions .coupon {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

.woocommerce-cart table.cart td.actions .coupon .input-text {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
  border-radius: var(--wcstore-radius-full);
}

/* Cart collaterals (Totals) */
.woocommerce .cart-collaterals {
  display: flex;
  justify-content: flex-end;
  margin-top: calc(var(--sp-xl) * 1.5);
}

.woocommerce .cart_totals {
  width: 480px;
  max-width: 100%;
  background: var(--wcstore-surface);
  border-radius: var(--wcstore-radius-xl);
  padding: var(--sp-xl);
  box-shadow: var(--wcstore-shadow-lg);
  border: 1px solid var(--wcstore-border-light);
}

.woocommerce .cart_totals h2 {
  font-family: var(--wcstore-font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0 0 var(--sp-lg);
  padding-bottom: var(--sp-md);
  border-bottom: 2px solid var(--wcstore-border-light);
}

.woocommerce .cart_totals table.shop_table {
  margin-bottom: var(--sp-lg);
}

.woocommerce .cart_totals table.shop_table tbody th,
.woocommerce .cart_totals table.shop_table tbody td {
  padding: var(--sp-sm) 0;
  border-bottom: 1px dashed var(--wcstore-border-light);
}

.woocommerce .cart_totals .order-total th,
.woocommerce .cart_totals .order-total td {
  font-family: var(--wcstore-font-heading);
  font-weight: 700;
  font-size: var(--text-2xl);
  border-top: 2px solid var(--wcstore-text);
  border-bottom: none;
  padding-top: var(--sp-md);
}

.woocommerce .cart_totals .order-total td {
  text-align: right;
  color: var(--wcstore-text);
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
  display: flex;
  width: 100%;
  justify-content: center;
  font-size: var(--text-md);
  padding: 0 24px;
  height: 56px;
}

/* Mini cart (Slide-out menu styling integration if needed) */
.wcstore-mini-cart__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wcstore-mini-cart__item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--wcstore-border-light);
  position: relative;
}

.wcstore-mini-cart__thumb img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--wcstore-surface);
  border-radius: var(--wcstore-radius-md);
  mix-blend-mode: multiply;
}

.wcstore-mini-cart__details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wcstore-mini-cart__name a {
  font-family: var(--wcstore-font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--wcstore-text);
}

.wcstore-mini-cart__qty {
  font-size: var(--text-xs);
  color: var(--wcstore-text-muted);
  font-weight: 500;
}

.wcstore-mini-cart__remove {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  color: var(--wcstore-text-muted) !important;
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--duration-fast);
}
.wcstore-mini-cart__remove:hover {
  background: var(--wcstore-error);
  color: #fff !important;
}

@media (max-width: 768px) {
  .woocommerce .cart-collaterals {
    justify-content: stretch;
  }
  .woocommerce .cart_totals {
    width: 100%;
    padding: var(--sp-lg);
  }
  .woocommerce-cart table.cart td.actions .coupon {
    flex-direction: column;
    align-items: stretch;
  }
  .woocommerce-cart table.cart td.actions .coupon .input-text {
    max-width: 100%;
  }
}
