/*
 * Cart — dark/gold, and above all finishable.
 *
 * The cart was the one step of the purchase flow with NO stylesheet:
 * coco-checkout.css covers checkout, order-received and view-order, and
 * coco-order-pay.css covers order-pay, but /cart/ fell through to raw
 * WooCommerce. That is where the WooCommerce-purple "Proceed to checkout"
 * button came from (#7f54b3 is Woo's own default, not a brand colour), and
 * why the coupon row overflowed its container and the table ran edge to edge.
 *
 * Palette matches the customer-facing shell used by the order-pay page and
 * the transactional emails: near-black ground, #111 surfaces, gold accent.
 */

:root {
  --coco-cart-ground: #0a0a0a;
  --coco-cart-surface: #111111;
  --coco-cart-hairline: #1f1f1f;
  --coco-cart-gold: #c9a96e;
  --coco-cart-gold-deep: #a8873f;
  --coco-cart-ivory: #faf7f0;
  --coco-cart-muted: #a49c8e;
}

/* ── Shell ─────────────────────────────────────────────────────────── */
/* One element centres the page. The table used to run the full viewport
   width, which is what made a 5-word product name sit 240px from a delete
   icon at the far left. */
.woocommerce-cart .woocommerce {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  box-sizing: border-box;
}

.woocommerce-cart .woocommerce-notices-wrapper:empty { display: none; }

/* ── Items table ───────────────────────────────────────────────────── */
/* No overflow:hidden and no border-collapse:separate here — both trigger a
   relayout on wide tables and clip columns. Native collapse model only. */
.woocommerce-cart table.shop_table {
  width: 100%;
  background: var(--coco-cart-surface);
  border: 1px solid var(--coco-cart-hairline);
  border-radius: 14px;
  border-collapse: collapse;
  color: var(--coco-cart-ivory);
}

.woocommerce-cart table.shop_table th {
  padding: 16px 18px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--coco-cart-gold);
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--coco-cart-hairline);
}

.woocommerce-cart table.shop_table td {
  padding: 18px;
  border-top: 1px solid var(--coco-cart-hairline);
  vertical-align: middle;
}

.woocommerce-cart td.product-name a {
  color: var(--coco-cart-ivory);
  font-weight: 600;
  text-decoration: none;
}
/* The event + date lines the ticket plugin appends. Secondary, not shouty. */
.woocommerce-cart td.product-name .tribe-event-title,
.woocommerce-cart td.product-name dl.variation,
.woocommerce-cart td.product-name p {
  color: var(--coco-cart-muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 4px 0 0;
}
.woocommerce-cart td.product-name strong { color: var(--coco-cart-ivory); font-weight: 600; }

.woocommerce-cart td.product-price,
.woocommerce-cart td.product-subtotal { color: var(--coco-cart-ivory); font-weight: 600; white-space: nowrap; }

/* The placeholder image was rendering as a broken-image glyph. There is no
   useful thumbnail for a ticket, so reclaim the column entirely. */
.woocommerce-cart td.product-thumbnail,
.woocommerce-cart th.product-thumbnail { display: none; }

/* Column widths. Left to itself the browser gave the near-empty remove
   column ~540px of the table and squeezed the product name into a column so
   narrow that "Standard Table" wrapped onto two lines. */
.woocommerce-cart table.shop_table { table-layout: fixed; }
.woocommerce-cart th.product-remove,
.woocommerce-cart td.product-remove   { width: 52px; text-align: center; }
.woocommerce-cart th.product-name,
.woocommerce-cart td.product-name     { width: auto; }
.woocommerce-cart th.product-price,
.woocommerce-cart td.product-price    { width: 130px; }
.woocommerce-cart th.product-quantity,
.woocommerce-cart td.product-quantity { width: 130px; }
.woocommerce-cart th.product-subtotal,
.woocommerce-cart td.product-subtotal { width: 140px; text-align: right; }

.woocommerce-cart td.product-remove a.remove {
  color: var(--coco-cart-muted) !important;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
}
.woocommerce-cart td.product-remove a.remove:hover {
  color: #ff9b7a !important;
  background: transparent !important;
}

.woocommerce-cart td.product-quantity input.qty {
  background: #0d0d0d;
  border: 1px solid var(--coco-cart-hairline);
  color: var(--coco-cart-ivory);
  border-radius: 8px;
  padding: 8px 10px;
  width: 72px;
}

/* ── Coupon row ────────────────────────────────────────────────────── */
/* This was the broken bit: the input was clipped off the left edge of the
   viewport and "Update basket" was cut off at the right. The actions cell
   is now a wrapping flex row that cannot overflow. */
.woocommerce-cart table.shop_table td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px;
}

.woocommerce-cart td.actions .coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  float: none;              /* Woo floats this; the float is what broke the row */
  width: auto !important;   /* Woo sets a width here, which wrapped the button */
  max-width: none;
  margin: 0 auto 0 0;       /* takes the slack, so Update basket sits far right */
}

.woocommerce-cart td.actions .coupon label { display: none; }

.woocommerce-cart td.actions .coupon input#coupon_code {
  background: #0d0d0d;
  border: 1px solid var(--coco-cart-hairline);
  color: var(--coco-cart-ivory);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 180px;
  width: auto;
  box-sizing: border-box;
}
.woocommerce-cart td.actions .coupon input#coupon_code::placeholder { color: #6a6a6a; }

/* ── Buttons ───────────────────────────────────────────────────────── */
/* Secondary actions read as outlines so the one button that matters — the
   gold one — is unambiguous. */
.woocommerce-cart td.actions .button,
.woocommerce-cart td.actions button.button {
  background: transparent;
  border: 1px solid var(--coco-cart-hairline);
  color: var(--coco-cart-ivory);
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.woocommerce-cart td.actions .button:hover:not(:disabled) { border-color: var(--coco-cart-gold); color: var(--coco-cart-gold); }
.woocommerce-cart td.actions .button:disabled { opacity: .45; cursor: not-allowed; }

/* ── Totals ────────────────────────────────────────────────────────── */
.woocommerce-cart .cart-collaterals { width: 100%; margin-top: 26px; }
.woocommerce-cart .cart-collaterals .cart_totals {
  width: 100%;
  max-width: 420px;
  margin-left: auto;      /* sits right, but no longer leaves a dead half-page */
  float: none;
  background: var(--coco-cart-surface);
  border: 1px solid var(--coco-cart-hairline);
  border-radius: 14px;
  padding: 20px 22px;
  box-sizing: border-box;
}

.woocommerce-cart .cart_totals h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--coco-cart-ivory);
  margin: 0 0 14px;
}

.woocommerce-cart .cart_totals table { width: 100%; border-collapse: collapse; }
.woocommerce-cart .cart_totals th,
.woocommerce-cart .cart_totals td {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--coco-cart-hairline);
  font-size: 14px;
  color: var(--coco-cart-muted);
  text-align: left;
  font-weight: 500;
}
.woocommerce-cart .cart_totals td { text-align: right; color: var(--coco-cart-ivory); }
.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;
  color: var(--coco-cart-ivory);
  font-weight: 700;
}
.woocommerce-cart .cart_totals tr.order-total td { color: var(--coco-cart-gold); font-size: 26px; }

/* ── The button that matters ───────────────────────────────────────── */
.woocommerce-cart .wc-proceed-to-checkout { padding: 18px 0 0; }
.woocommerce-cart a.checkout-button,
.woocommerce-cart .wc-proceed-to-checkout a.button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, var(--coco-cart-gold) 0%, var(--coco-cart-gold-deep) 100%);
  color: #1a1206;
  border: 0;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .4px;
  text-align: center;
  text-decoration: none;
  text-transform: none;
}
.woocommerce-cart a.checkout-button:hover { filter: brightness(1.07); color: #1a1206; }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .woocommerce-cart .woocommerce { padding: 18px 14px 56px; }

  /* Stack the row: a 5-column table does not fit a phone. */
  .woocommerce-cart table.shop_table thead { display: none; }
  .woocommerce-cart table.shop_table,
  .woocommerce-cart table.shop_table tbody,
  .woocommerce-cart table.shop_table tr,
  .woocommerce-cart table.shop_table td { display: block; width: 100%; box-sizing: border-box; }
  .woocommerce-cart table.shop_table tr { border-top: 1px solid var(--coco-cart-hairline); }
  .woocommerce-cart table.shop_table td { border-top: 0; padding: 6px 16px; }
  .woocommerce-cart table.shop_table td:first-child { padding-top: 16px; }
  .woocommerce-cart table.shop_table td.actions { padding: 16px; }

  .woocommerce-cart td.product-price::before,
  .woocommerce-cart td.product-subtotal::before {
    content: attr(data-title) ': ';
    color: var(--coco-cart-muted);
    font-weight: 500;
  }

  .woocommerce-cart td.actions .coupon input#coupon_code { flex: 1 1 140px; min-width: 0; }
  .woocommerce-cart .cart-collaterals .cart_totals { max-width: none; margin-left: 0; }
}
