/* GFF cart. Pure CSS over stock WooCommerce markup: no template override, so
   Woo updates cannot silently break this. Verified against Woo 10.9.1 markup:
   .woocommerce-cart-form and .cart-collaterals are siblings inside .woocommerce. */

/* Two columns: items left, sticky summary right. */
.woocommerce-cart .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper { grid-column: 1 / -1; }
.woocommerce-cart .cart-collaterals { position: sticky; top: 24px; width: 100%; }

/* Strip the table down to rules. A cart is a list, not a spreadsheet. */
.woocommerce-cart table.shop_table.cart {
  border: 0;
  border-collapse: collapse;
  background: transparent;
  margin: 0;
}
.woocommerce-cart table.shop_table.cart thead th {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 12px 12px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.woocommerce-cart table.shop_table.cart td {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 18px 12px;
  vertical-align: middle;
  background: transparent;
}
.woocommerce-cart td.product-thumbnail img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.woocommerce-cart td.product-name a { color: var(--text); font-weight: 600; }
.woocommerce-cart td.product-name a:hover { color: var(--brand); }
.woocommerce-cart td.product-name .variation {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.woocommerce-cart td.product-name .variation dt { font-weight: 600; }
.woocommerce-cart td.product-name .variation dd { margin: 0; }
.woocommerce-cart td.product-price,
.woocommerce-cart td.product-subtotal { white-space: nowrap; font-variant-numeric: tabular-nums; }
.woocommerce-cart td.product-subtotal { font-weight: 700; }

/* Remove control: a quiet x that only commits to red on hover. */
.woocommerce-cart td.product-remove a.remove {
  width: 26px; height: 26px; line-height: 24px;
  color: var(--muted) !important;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 16px;
}
.woocommerce-cart td.product-remove a.remove:hover {
  background: var(--danger) !important;
  border-color: var(--danger);
  color: #fff !important;
}

.woocommerce-cart .quantity input.qty {
  width: 68px;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

/* Coupon + update row */
.woocommerce-cart table.shop_table.cart td.actions {
  padding: 20px 0 0;
  border-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.woocommerce-cart td.actions .coupon { display: flex; gap: 8px; flex: 1 1 260px; }
.woocommerce-cart td.actions .coupon label { display: none; }
.woocommerce-cart td.actions .coupon input#coupon_code {
  flex: 1; min-width: 0; padding: 11px 12px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff;
}

/* Summary panel */
.woocommerce-cart .cart_totals {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.woocommerce-cart .cart_totals > h2 {
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px; font-weight: 700;
}
.woocommerce-cart .cart_totals table { width: 100%; border: 0; margin: 0; background: transparent; }
.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
  border: 0; border-bottom: 1px solid var(--line);
  padding: 12px 0; background: transparent; font-size: 15px;
}
.woocommerce-cart .cart_totals table th { font-weight: 500; color: var(--dim); text-align: left; }
.woocommerce-cart .cart_totals table td { text-align: right; font-variant-numeric: tabular-nums; }
.woocommerce-cart .cart_totals tr.order-total th,
.woocommerce-cart .cart_totals tr.order-total td {
  border-bottom: 0; padding-top: 16px; font-size: 20px; font-weight: 800; color: var(--text);
}
.woocommerce-cart .cart_totals .woocommerce-shipping-destination { color: var(--muted); font-size: 13px; }

/* Freight is a large number on 40 lb bags. Show it while there is still a cart
   to change, not as a surprise three steps into checkout. */
.woocommerce-cart .cart_totals .shipping-calculator-button {
  color: var(--brand); text-decoration: underline; font-size: 14px;
}
.woocommerce-cart .cart_totals ul#shipping_method { margin: 0; padding: 0; list-style: none; }
.woocommerce-cart .cart_totals ul#shipping_method li { margin: 0 0 8px; font-size: 14px; text-align: left; }

.woocommerce-cart .wc-proceed-to-checkout { padding: 18px 0 0; }
body.gff-body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  display: block; width: 100%; text-align: center;
  background: var(--brand); color: #fff;
  padding: 16px 20px; border-radius: 8px;
  font-size: 17px; font-weight: 700; letter-spacing: .01em;
  transition: background .2s ease, transform .2s ease;
}
body.gff-body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover { background: #1d4488; transform: translateY(-1px); }

/* Buttons in the cart body */
body.gff-body.woocommerce-cart .button:not(.checkout-button),
body.gff-body.woocommerce-cart button.button {
  background: var(--text); color: #fff; border: 1px solid var(--text);
  border-radius: 6px; padding: 11px 18px; font-weight: 600;
}
body.gff-body.woocommerce-cart .button:not(.checkout-button):hover,
body.gff-body.woocommerce-cart button.button:hover { background: transparent; color: var(--text); }
.woocommerce-cart button.button[disabled] { opacity: .45; }

/* Phone: one column, each row becomes a card. Woo already emits
   shop_table_responsive, so the data-title labels are used rather than fought. */
@media (max-width: 900px) {
  .woocommerce-cart .woocommerce { grid-template-columns: 1fr; }
  .woocommerce-cart .cart-collaterals { position: static; }
}
@media (max-width: 768px) {
  .woocommerce-cart table.shop_table.cart thead { display: none; }
  .woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item {
    display: grid;
    grid-template-columns: 76px 1fr auto;
    grid-template-areas:
      "thumb name remove"
      "thumb price price"
      "thumb qty subtotal";
    gap: 6px 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
  }
  .woocommerce-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item td {
    border: 0; padding: 0; text-align: left !important;
  }
  .woocommerce-cart td.product-thumbnail { grid-area: thumb; }
  .woocommerce-cart td.product-name    { grid-area: name; }
  .woocommerce-cart td.product-remove  { grid-area: remove; }
  .woocommerce-cart td.product-price   { grid-area: price; color: var(--muted); font-size: 14px; }
  .woocommerce-cart td.product-quantity{ grid-area: qty; }
  .woocommerce-cart td.product-subtotal{ grid-area: subtotal; text-align: right !important; }
  .woocommerce-cart table.shop_table_responsive tr td::before { content: none !important; }
  .woocommerce-cart td.actions { flex-direction: column; align-items: stretch; }
  .woocommerce-cart td.actions .coupon { flex-direction: column; }
}
