/* ========================================
   CART LAYOUT
   ======================================== */

.woocommerce-cart .woocommerce {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.woocommerce-cart-form {
  flex: 1 1 620px;
  background: #fff;
  border-radius: var(--card-radius);
  padding: 8px 24px 24px;
  box-shadow: var(--shadow);
}


/* ========================================
   PRODUCT TABLE
   ======================================== */

table.shop_table.cart {
  width: 100%;
  border-collapse: collapse;
}

table.shop_table.cart thead th {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: 18px 12px;
}

table.shop_table.cart thead th.product-price,
table.shop_table.cart thead th.product-quantity,
table.shop_table.cart thead th.product-subtotal {
  text-align: center;
}

table.shop_table.cart td {
  border-bottom: 1px solid var(--border);
  padding: 18px 12px;
  vertical-align: middle;
}

table.shop_table.cart tr:last-child td {
  border-bottom: none;
}

table.shop_table.cart td.product-thumbnail {
  width: 64px;
}

table.shop_table.cart td.product-thumbnail img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f4f8;
}

table.shop_table.cart td.product-name {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

table.shop_table.cart td.product-name a {
  color: var(--text);
  text-decoration: none;
}

table.shop_table.cart td.product-price,
table.shop_table.cart td.product-subtotal {
  text-align: center;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

table.shop_table.cart td.product-remove {
  width: 32px;
  text-align: center;
}

table.shop_table.cart td.product-remove a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626 !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  transition: var(--transition);
}

table.shop_table.cart td.product-remove a.remove:hover {
  background: #ff0000;
  color: #fff !important;
}


/* ========================================
   QUANTITY STEPPER
   ======================================== */

table.shop_table.cart td.product-quantity {
  text-align: center;
}

.quantity {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

.quantity .qty {
  width: 24px;
  border: none;
  text-align: center;
  font-weight: 600;
  color: var(--text);
  -moz-appearance: textfield;
  background: transparent;
  outline: none;
}

.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity .sw-qty-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.quantity .sw-qty-btn:hover {
  color: #fff;
  background: var(--main-bg);
}


/* ========================================
   FLOATING NOTICES (coupon errors/messages)
   ======================================== */

.woocommerce-notices-wrapper { display: none !important; }

#sw-toast-container {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  width: 100%;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.sw-toast {
    border-left: 4px solid var(--toast-color);
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .15);
    font-size: 14px;
    line-height: 1.5;
    max-width: fit-content;
}

.sw-toast.sw-toast--show { opacity: 1; transform: translateY(0); }
.sw-toast--error   { --toast-color: #e02b2b; color: var(--toast-color); }
.sw-toast--success { --toast-color: #1fa855; color: var(--toast-color); }
.sw-toast--info    { --toast-color: var(--primary); color: var(--toast-color); }

.sw-toast .sw-toast-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: var(--toast-color);
}

.sw-toast .sw-toast-body { flex: 1; }
.sw-toast .sw-toast-body ul { margin: 0; padding: 0; list-style: none; }

.sw-toast .sw-toast-close {
  flex-shrink: 0;
  border: none; background: transparent; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--muted); padding: 0;
}
.sw-toast .sw-toast-close:hover { color: var(--text); }

@media (max-width: 480px) {
  #sw-toast-container { top: 12px; max-width: calc(100% - 24px); }
}

/* ========================================
   COUPON & UPDATE CART
   ======================================== */

.woocommerce-cart-form .coupon {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.woocommerce-cart-form .coupon label {
  display: none;
}

.woocommerce-cart-form .coupon #coupon_code {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  min-width: 220px;
  outline: none;
  transition: var(--transition);
}

.woocommerce-cart-form .coupon #coupon_code:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-shadow);
}

.woocommerce-cart-form .coupon button[name="apply_coupon"] {
  background: var(--main-bg);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.woocommerce-cart-form .coupon button[name="apply_coupon"]:hover {
  /* background: var(--secondary, #5529e0);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--secondary, #5529e0) 35%, transparent);  */
  transform: translateY(-2px);
  box-shadow: 0 18px 40px var(--btn-shadow);
}

.woocommerce-cart-form button[name="update_cart"] {
  float: right;
  margin-top: -44px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.woocommerce-cart-form button[name="update_cart"]:hover {
  background: var(--secondary, #5529e0);
  border-color: var(--secondary, #5529e0);
  color: #fff;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--secondary, #5529e0) 35%, transparent);
  transform: translateY(-2px);
}

/* ========================================
   CART TOTALS
   ======================================== */

.cart-collaterals {
  flex: 0 0 320px;
  max-width: 320px;
}

.cart-collaterals .cart_totals {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.cart-collaterals .cart_totals h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}

.cart-collaterals .cart_totals table.shop_table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cart-collaterals .cart_totals table.shop_table tr th,
.cart-collaterals .cart_totals table.shop_table tr td {
  border: none;
  padding: 10px 0;
  font-size: 14px;
}

.cart-collaterals .cart_totals tr.cart-subtotal th {
  color: var(--muted);
  font-weight: 500;
}

.cart-collaterals .cart_totals tr.cart-subtotal td {
  text-align: right;
  color: var(--text);
  font-weight: 600;
}

.cart-collaterals .cart_totals tr.woocommerce-shipping-totals th {
  color: var(--muted);
  font-weight: 500;
}

.cart-collaterals .cart_totals tr.woocommerce-shipping-totals td {
  text-align: right;
  color: #16a34a;
  font-weight: 600;
}

.cart-collaterals .cart_totals tr.cart-discount td {
  text-align: right;
}

.cart-collaterals .cart_totals tr.cart-discount td .woocommerce-Price-amount,
.cart-collaterals .cart_totals tr.cart-discount td a {
  color: #16a34a;
  font-weight: 600;
}

.cart-collaterals .cart_totals tr.cart-discount td a.woocommerce-remove-coupon {
  color: #16a34a;
  font-weight: 500;
  text-decoration: none;
  margin-left: 4px;
}

.cart-collaterals .cart_totals tr.order-total {
  border-top: 1px solid var(--border);
}

.cart-collaterals .cart_totals tr.order-total th {
  padding-top: 16px;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}

.cart-collaterals .cart_totals tr.order-total td {
  padding-top: 16px;
  text-align: right;
}

.cart-collaterals .cart_totals tr.order-total td .woocommerce-Price-amount {
  color: var(--primary);
  font-weight: 700;
  font-size: 20px;
}


/* ========================================
   CHECKOUT BUTTON
   ======================================== */

.cart-collaterals .wc-proceed-to-checkout {
  margin-top: 20px;
}

.cart-collaterals .wc-proceed-to-checkout a.checkout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--main-bg);
  color: #fff;
  text-align: center;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.cart-collaterals .wc-proceed-to-checkout a.checkout-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px var(--btn-shadow);
}

.cart-collaterals .wc-proceed-to-checkout a.checkout-button::before {
  content: "";
  width: 20px;
  height: 20px;
  display: inline-block;
  background: #fff;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm-3 8V6a3 3 0 0 1 6 0v3z"/></svg>') no-repeat center / contain;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm-3 8V6a3 3 0 0 1 6 0v3z"/></svg>') no-repeat center / contain;
}


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 782px) {
  .cart-collaterals {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .woocommerce-cart-form {
    padding: 8px 14px 18px;
  }

  .woocommerce-cart-form .coupon {
    flex-wrap: wrap;
  }

  .woocommerce-cart-form .coupon #coupon_code {
    min-width: 0;
    flex: 1 1 160px;
  }

  .woocommerce-cart-form button[name="update_cart"] {
    float: none;
    margin-top: 12px;
    width: 100%;
  }
}

/* Card-style cart table for small screens */
@media (max-width: 600px) {

  table.shop_table.cart thead {
    display: none;
  }

  table.shop_table.cart,
  table.shop_table.cart tbody,
  table.shop_table.cart tr,
  table.shop_table.cart td {
    display: block;
    width: 100%;
  }

  table.shop_table.cart tr {
    position: relative;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  table.shop_table.cart tr:first-child {
    padding-top: 4px;
  }

  table.shop_table.cart td {
    border: none;
    padding: 4px 0 4px 84px;
    min-height: 24px;
  }

  table.shop_table.cart td.product-thumbnail {
    position: absolute;
    top: 4px;
    left: 0;
    width: 68px;
    padding: 0;
  }

  table.shop_table.cart td.product-thumbnail img {
    width: 64px;
    height: 64px;
  }

  table.shop_table.cart td.product-remove {
    position: absolute;
    top: 4px;
    right: 0;
    width: auto;
    padding: 0;
  }

  table.shop_table.cart td.product-name {
    padding-top: 0;
    padding-right: 32px;
    font-size: 14px;
    line-height: 1.4;
  }

  table.shop_table.cart td.product-price,
  table.shop_table.cart td.product-quantity,
  table.shop_table.cart td.product-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    white-space: normal;
  }

  table.shop_table.cart td.product-price::before,
  table.shop_table.cart td.product-quantity::before,
  table.shop_table.cart td.product-subtotal::before {
    content: attr(data-title);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }

  table.shop_table.cart td.product-quantity .quantity {
    padding: 4px 10px;
    gap: 10px;
  }

  /* This cell holds the coupon field + Update cart button, not a
     product row — it shouldn't inherit the thumbnail offset padding. */
  table.shop_table.cart td.actions {
    padding-left: 0;
  }

  .cart-collaterals .cart_totals {
    padding: 18px;
  }
}

@media (max-width: 400px) {
  table.shop_table.cart td {
    padding-left: 72px;
  }

  table.shop_table.cart td.actions {
    padding-left: 0;
  }

  table.shop_table.cart td.product-thumbnail {
    width: 58px;
  }

  table.shop_table.cart td.product-thumbnail img {
    width: 54px;
    height: 54px;
  }
}
/* =============================================================================
   Empty Cart State
   ============================================================================= */
.sw-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 420px;
  margin: 40px auto 60px;
  padding: 60px 30px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
}

.sw-cart-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--primary-light-bg);
  margin-bottom: 22px;
}

.sw-cart-empty__icon i {
  font-size: 34px;
  color: var(--primary);
}

.sw-cart-empty__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
}

.sw-cart-empty__desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 28px;
}

.sw-cart-empty__btn {
  gap: 8px;
}

.sw-cart-empty__btn i {
  font-size: 13px;
}

@media (max-width: 480px) {
  .sw-cart-empty {
    margin: 24px auto 40px;
    padding: 44px 20px;
  }
}
