/* ==========================================================================
   HOCO REDESIGN — 50 CART
   Restyles the WooCommerce/Woodmart cart page to match /test:
   clean rounded table, tidy rows, brand buttons, soft-shadow totals card.
   Scope: .woocommerce-cart-form / table.cart / .cart_totals / cart-collaterals.
   RTL-safe (logical props) + responsive (rows become stacked cards on mobile).
   Does NOT touch checkout (55) or account (60).
   ========================================================================== */

/* ---- page layout: form + totals side by side, breathing room ---- */
.cart-content-wrapper{
  align-items:flex-start;
  gap:26px;
  margin-block:8px 40px;
}
.cart-content-wrapper .woocommerce-cart-form{margin-bottom:0}

/* ---- the cart table -> one clean rounded card ---- */
.woocommerce-cart-form .cart-table-section,
.woocommerce-cart-form table.cart{margin:0}
.woocommerce-cart-form table.cart.woocommerce-cart-form__contents{
  width:100%;
  border:1px solid var(--hoco-line);
  border-radius:var(--hoco-radius);
  background:var(--hoco-surface);
  box-shadow:var(--hoco-shadow);
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
}

/* header row */
.woocommerce-cart-form table.cart thead th{
  background:#faf8fc;
  color:var(--hoco-muted);
  font-weight:700;
  font-size:12.5px;
  letter-spacing:.2px;
  text-transform:uppercase;
  padding:14px 16px;
  border:0;
  border-bottom:1px solid var(--hoco-line);
  text-align:start;
}

/* body cells */
.woocommerce-cart-form table.cart td{
  padding:16px;
  border:0;
  border-bottom:1px solid var(--hoco-line);
  vertical-align:middle;
  background:transparent;
}
.woocommerce-cart-form table.cart tbody tr.cart_item:hover td{background:#faf8fc}
.woocommerce-cart-form table.cart tbody tr.cart_item:last-of-type td{border-bottom:0}

/* product thumbnail */
.woocommerce-cart-form td.product-thumbnail{width:88px}
.woocommerce-cart-form td.product-thumbnail img{
  width:72px;height:72px;
  object-fit:contain;
  border:1px solid var(--hoco-line);
  border-radius:var(--hoco-radius-sm);
  background:#f7f5f8;
  padding:6px;
}

/* product name */
.woocommerce-cart-form td.product-name{font-weight:500}
.woocommerce-cart-form td.product-name a{color:var(--hoco-ink);line-height:1.5}
.woocommerce-cart-form td.product-name a:hover{color:var(--hoco-brand)}
.woocommerce-cart-form td.product-name .variation,
.woocommerce-cart-form td.product-name dl.variation{
  font-size:12.5px;color:var(--hoco-muted);margin:6px 0 0;
}

/* price + subtotal -> brand purple, bold */
.woocommerce-cart-form td.product-price,
.woocommerce-cart-form td.product-subtotal{
  font-weight:800;color:var(--hoco-price);white-space:nowrap;
}
.woocommerce-cart-form td.product-price{color:var(--hoco-ink);font-weight:700}

/* remove (×) button */
.woocommerce-cart-form td.product-remove{width:46px;text-align:center}
.woocommerce-cart-form td.product-remove a.remove{
  display:inline-flex;align-items:center;justify-content:center;
  width:28px;height:28px;
  border-radius:50%;
  background:#f4eef5;
  color:var(--hoco-brand) !important;
  font-size:18px;line-height:1;font-weight:400;
  text-decoration:none;
  transition:.18s;
}
.woocommerce-cart-form td.product-remove a.remove:hover{
  background:var(--hoco-danger);color:#fff !important;transform:rotate(90deg);
}

/* ---- quantity stepper -> rounded pill with brand +/- ---- */
.woocommerce-cart-form td.product-quantity .quantity{
  display:inline-flex;align-items:center;
  border:1.5px solid var(--hoco-line);
  border-radius:999px;
  background:var(--hoco-surface);
  overflow:hidden;
  height:40px;
}
.woocommerce-cart-form td.product-quantity .quantity input.qty{
  width:46px;height:38px;
  border:0 !important;border-radius:0 !important;
  background:transparent !important;
  text-align:center;
  font-weight:700;font-size:15px;color:var(--hoco-ink);
  padding:0;
  -moz-appearance:textfield;
  box-shadow:none !important;
}
.woocommerce-cart-form td.product-quantity .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart-form td.product-quantity .quantity input.qty::-webkit-inner-spin-button{
  -webkit-appearance:none;margin:0;
}
.woocommerce-cart-form td.product-quantity .quantity input.minus,
.woocommerce-cart-form td.product-quantity .quantity input.plus{
  width:38px;height:38px;
  border:0 !important;
  background:transparent !important;
  color:var(--hoco-brand) !important;
  font-size:19px;font-weight:700;line-height:1;
  cursor:pointer;
  padding:0;
  transition:.15s;
  box-shadow:none !important;
}
.woocommerce-cart-form td.product-quantity .quantity input.minus:hover,
.woocommerce-cart-form td.product-quantity .quantity input.plus:hover{
  background:var(--hoco-brand) !important;color:#fff !important;
}

/* ---- actions row: coupon + update cart ---- */
.woocommerce-cart-form .cart-actions{
  margin-top:18px;
  gap:12px;
  align-items:center;
}
.woocommerce-cart-form .coupon{
  display:flex;align-items:stretch;gap:10px;flex-wrap:wrap;
}
.woocommerce-cart-form .coupon input#coupon_code{
  min-width:180px;flex:1 1 auto;
  height:46px;
  border:1.5px solid var(--hoco-line) !important;
  border-radius:var(--hoco-radius-sm) !important;
  background:var(--hoco-surface);
  padding-inline:16px;
  font-family:inherit;font-size:14.5px;
  transition:.18s;
}
.woocommerce-cart-form .coupon input#coupon_code:focus{
  border-color:var(--hoco-brand) !important;outline:0;
  box-shadow:0 0 0 3px rgba(84,4,87,.10);
}
.woocommerce-cart-form .coupon button[name="apply_coupon"]{
  height:46px;
  border-radius:var(--hoco-radius-sm) !important;
  background:#fff !important;
  color:var(--hoco-brand) !important;
  border:1.5px solid var(--hoco-brand) !important;
  font-weight:700 !important;
  padding-inline:20px !important;
  white-space:nowrap;
  transition:.18s;
}
.woocommerce-cart-form .coupon button[name="apply_coupon"]:hover{
  background:var(--hoco-brand) !important;color:#fff !important;
}
.woocommerce-cart-form button[name="update_cart"]{
  height:46px;
  border-radius:var(--hoco-radius-sm) !important;
  background:#f4eef5 !important;
  color:var(--hoco-brand) !important;
  border:0 !important;
  font-weight:700 !important;
  padding-inline:24px !important;
  transition:.18s;
}
.woocommerce-cart-form button[name="update_cart"]:hover:not([disabled]){
  background:var(--hoco-brand) !important;color:#fff !important;
}
.woocommerce-cart-form button[name="update_cart"][disabled]{opacity:.5}

/* ---- cart totals -> readable card with soft shadow ---- */
.cart-totals-section,.cart_totals{margin:0}
.cart_totals{
  background:var(--hoco-surface);
  border:1px solid var(--hoco-line);
  border-radius:var(--hoco-radius);
  box-shadow:var(--hoco-shadow);
  padding:22px;
  position:sticky;
  top:20px;
}
.cart_totals h2{
  margin:0 0 16px;
  font-size:19px;font-weight:800;color:var(--hoco-ink);
  padding-bottom:14px;
  border-bottom:1px solid var(--hoco-line);
}
.cart_totals table.shop_table{
  width:100%;margin:0;border:0;border-collapse:collapse;background:transparent;
}
.cart_totals table.shop_table th,
.cart_totals table.shop_table td{
  padding:12px 0;
  border:0;
  border-bottom:1px solid var(--hoco-line);
  background:transparent;
  vertical-align:top;
  font-size:14.5px;
}
.cart_totals table.shop_table th{
  font-weight:600;color:var(--hoco-muted);text-align:start;
}
.cart_totals table.shop_table td{
  text-align:end;font-weight:700;color:var(--hoco-ink);
}
.cart_totals table.shop_table .cart-discount td{color:var(--hoco-wa-dark)}

/* grand total row emphasized */
.cart_totals table.shop_table tr.order-total th,
.cart_totals table.shop_table tr.order-total td{
  border-bottom:0;
  padding-top:16px;
  font-size:17px;
}
.cart_totals table.shop_table tr.order-total th{color:var(--hoco-ink);font-weight:800}
.cart_totals table.shop_table tr.order-total td,
.cart_totals table.shop_table tr.order-total td .amount,
.cart_totals table.shop_table tr.order-total .woocommerce-Price-amount{
  color:var(--hoco-price);font-weight:800;font-size:20px;
}
.cart_totals .shipping-calculator-button{color:var(--hoco-brand);font-weight:700}
.cart_totals .woocommerce-shipping-destination{color:var(--hoco-muted);font-size:13px}

/* proceed to checkout -> big brand purple block button */
.cart_totals .wc-proceed-to-checkout{padding:20px 0 0;margin:0}
.cart_totals .wc-proceed-to-checkout a.checkout-button{
  display:flex;align-items:center;justify-content:center;
  width:100%;
  padding:15px 20px !important;
  border-radius:var(--hoco-radius-sm) !important;
  background:var(--hoco-brand) !important;
  color:#fff !important;
  border:0 !important;
  font-weight:800 !important;font-size:16px !important;
  box-shadow:0 8px 20px rgba(84,4,87,.24);
  transition:.2s;
}
.cart_totals .wc-proceed-to-checkout a.checkout-button:hover{
  background:var(--hoco-brand-dark) !important;
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(84,4,87,.30);
}

/* ---- empty cart fallback (in case it renders) ---- */
.woocommerce .cart-empty,.woocommerce .wc-empty-cart-message{
  font-size:17px;color:var(--hoco-ink);font-weight:700;
}
.woocommerce .return-to-shop .button{
  border-radius:var(--hoco-radius-sm) !important;
  background:var(--hoco-brand) !important;color:#fff !important;font-weight:700 !important;
}

/* ==========================================================================
   RESPONSIVE — table collapses to stacked cards on mobile
   ========================================================================== */
@media (max-width:768px){
  .cart-content-wrapper{gap:20px;margin-block:4px 30px}

  /* hide the table header, turn each item row into a card */
  .woocommerce-cart-form table.cart.woocommerce-cart-form__contents{
    border:0;box-shadow:none;background:transparent;overflow:visible;
  }
  .woocommerce-cart-form table.cart thead{display:none}
  .woocommerce-cart-form table.cart tbody,
  .woocommerce-cart-form table.cart tbody tr.cart_item{display:block;width:100%}

  .woocommerce-cart-form table.cart tbody tr.cart_item{
    position:relative;
    border:1px solid var(--hoco-line);
    border-radius:var(--hoco-radius);
    background:var(--hoco-surface);
    box-shadow:var(--hoco-shadow);
    padding:16px 16px 12px;
    margin-bottom:14px;
    display:grid;
    grid-template-columns:64px 1fr;
    grid-template-areas:
      "thumb name"
      "thumb price"
      "qty   subtotal";
    column-gap:14px;row-gap:10px;
    align-items:center;
  }
  .woocommerce-cart-form table.cart tbody tr.cart_item td{
    display:block;padding:0;border:0;text-align:start;background:transparent;
  }
  .woocommerce-cart-form table.cart tbody tr.cart_item:hover td{background:transparent}

  /* data-title labels for price/subtotal rows */
  .woocommerce-cart-form table.cart td.product-price::before,
  .woocommerce-cart-form table.cart td.product-subtotal::before{
    content:attr(data-title);
    display:inline-block;
    color:var(--hoco-muted);font-weight:600;font-size:12.5px;
    margin-inline-end:8px;text-transform:uppercase;letter-spacing:.2px;
  }

  .woocommerce-cart-form td.product-thumbnail{grid-area:thumb;width:auto}
  .woocommerce-cart-form td.product-thumbnail img{width:64px;height:64px}
  .woocommerce-cart-form td.product-name{grid-area:name;font-size:14px}
  .woocommerce-cart-form td.product-price{grid-area:price}
  .woocommerce-cart-form td.product-quantity{grid-area:qty}
  .woocommerce-cart-form td.product-subtotal{grid-area:subtotal;text-align:end;font-size:16px}

  /* remove button floats to the card corner */
  .woocommerce-cart-form td.product-remove{
    position:absolute;inset-block-start:10px;inset-inline-end:10px;
    width:auto;padding:0;
  }

  /* actions stack full-width */
  .woocommerce-cart-form .cart-actions{flex-direction:column;align-items:stretch}
  .woocommerce-cart-form .coupon{flex-direction:column}
  .woocommerce-cart-form .coupon input#coupon_code,
  .woocommerce-cart-form .coupon button[name="apply_coupon"],
  .woocommerce-cart-form button[name="update_cart"]{width:100%}

  .cart_totals{position:static;padding:18px}
}
