/* ============================================================
   BB CART — cart page (handoff Cart.html)
   Loaded on is_cart(). Re-arranges WooCommerce's native cart form into the
   BB 2-column layout (items | sticky summary) and restyles it. The form,
   qty inputs, remove links, coupon and proceed-to-checkout are all native.
   Scoped under body.bb-cart-page.
   ============================================================ */

/* free width from Shoptimizer wrappers */
body.bb-cart-page #content .col-full,
body.bb-cart-page .shoptimizer-archive,
body.bb-cart-page #primary,
body.bb-cart-page #main,
body.bb-cart-page .checkout-wrap,
body.bb-cart-page .shoptimizer-cart-wrapper,
body.bb-cart-page .entry-content,
body.bb-cart-page .post-7 { max-width: none !important; width: auto !important; padding: 0 !important; margin: 0 !important; float: none !important; }
body.bb-cart-page .archive-header { display: none !important; }
body.bb-cart-page #content { background: var(--bb-bg-2); }
body.bb-cart-page .woocommerce-notices-wrapper { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.bb-cart { background: var(--bb-bg-2); font-size: 14px; padding-bottom: 48px; }
.bb-cart .bb-wrap { max-width: 1280px; }
body.bb-cart-page .bb-btn-primary { background: var(--bb-red); color: #fff; border: 0; padding: 12px 22px; border-radius: var(--bb-r-input); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: background var(--bb-t); }
body.bb-cart-page .bb-btn-primary:hover { background: var(--bb-red-deep); color: #fff; }

/* breadcrumb + header */
.bb-cart-crumb { background: #fff; border-bottom: 1px solid var(--bb-line); }
.bb-cart-crumb .bb-wrap { display: flex; gap: 8px; align-items: center; padding: 12px 24px; font-size: 12px; color: var(--bb-mute); }
.bb-cart-crumb a:hover { color: var(--bb-red); }
.bb-cart-crumb .cur { color: var(--bb-ink); font-weight: 500; }
.bb-cart-head { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 30px; padding-bottom: 4px; }
.bb-cart-title { font-size: 30px; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.bb-cart-sub { font-size: 14px; color: var(--bb-mute); margin-top: 4px; }
.bb-cart-continue { font-size: 13px; font-weight: 600; color: var(--bb-red); }

/* 2-col grid */
.bb-cart-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; padding-top: 18px; }
.bb-cart-main { min-width: 0; }

/* trust strip */
.bb-cart-trust { background: #fff; border: 1px solid var(--bb-line); border-radius: 12px; padding: 11px 18px; margin-bottom: 14px; display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--bb-ink-2); flex-wrap: wrap; }
.bb-cart-trust span { display: inline-flex; gap: 6px; align-items: center; }
.bb-cart-trust .sep { color: #c7c7cc; }
.bb-cart-trust svg { width: 14px; height: 14px; color: var(--bb-red); }

/* items table → card rows */
.bb-cart-table { width: 100%; display: block; background: #fff; border: 1px solid var(--bb-line); border-radius: 14px; overflow: hidden; border-collapse: collapse; }
.bb-cart-table tbody { display: block; }
.bb-cart-table tr.cart_item { display: grid; grid-template-columns: 96px 1fr 132px 120px; gap: 16px; align-items: center; padding: 18px 22px; border-top: 1px solid var(--bb-line); }
.bb-cart-table tbody tr.cart_item:first-child { border-top: 0; }
.bb-cart-table td { display: block; padding: 0; border: 0; }
.bb-cart-table .product-thumbnail { width: 96px; }
.bb-cart-table .product-thumbnail img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; display: block; }
.bb-cart-table .product-name { min-width: 0; }
.bb-cart-table .product-name > a { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--bb-ink); }
.bb-cart-table .product-name > a:hover { color: var(--bb-red); }
.bb-cart-item-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; font-weight: 600; }
.bb-cart-item-meta .ok { color: var(--bb-green); }
.bb-cart-item-actions { margin-top: 8px; font-size: 11px; }
.bb-cart-remove { color: var(--bb-mute) !important; font-weight: 500; text-decoration: none; }
.bb-cart-remove:hover { color: var(--bb-red) !important; }

/* qty stepper */
.bb-cart-table .product-quantity .quantity { display: inline-flex; border: 1.5px solid var(--bb-line); border-radius: 8px; overflow: hidden; background: #fff; align-items: stretch; }
.bb-cart-table .product-quantity .quantity .bb-qty-btn { width: 32px; background: #fff; border: 0; font-size: 17px; color: var(--bb-ink); cursor: pointer; line-height: 1; display: grid; place-items: center; }
.bb-cart-table .product-quantity .quantity .bb-qty-btn:hover { color: var(--bb-red); }
.bb-cart-table .product-quantity input.qty { width: 42px; text-align: center; border: 0; border-left: 1px solid var(--bb-line); border-right: 1px solid var(--bb-line); font-size: 13px; font-weight: 600; outline: none; -moz-appearance: textfield; background: #fff; padding: 7px 0; }
.bb-cart-table .product-quantity input.qty::-webkit-outer-spin-button,
.bb-cart-table .product-quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bb-cart-table .product-subtotal { text-align: right; font-size: 17px; font-weight: 800; color: var(--bb-red); }
.bb-cart-table .product-subtotal del { display: block; font-size: 11px; color: var(--bb-mute); font-weight: 400; }

/* actions (update cart) */
.bb-cart-actions { margin-top: 14px; }
.bb-cart-update { background: #fff; border: 1px solid var(--bb-line); border-radius: var(--bb-r-input); padding: 9px 18px; font-size: 12px; font-weight: 700; color: var(--bb-ink); cursor: pointer; }
.bb-cart-update:hover { border-color: var(--bb-red); color: var(--bb-red); }

/* cross-sells */
.bb-cart-xsell { margin-top: 36px; }
.bb-cart-xsell .cross-sells > h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; }
.bb-cart-xsell ul.products { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.bb-cart-xsell ul.products li.product { width: auto !important; margin: 0 !important; background: #fff; border: 1px solid var(--bb-line); border-radius: 10px; padding: 10px; float: none !important; }
.bb-cart-xsell ul.products li.product img { border-radius: 6px; margin-bottom: 8px; }
.bb-cart-xsell ul.products li.product .woocommerce-loop-product__title { font-size: 12px; font-weight: 600; padding: 0; }
.bb-cart-xsell ul.products li.product .price { font-size: 13px; font-weight: 800; color: var(--bb-red); }
.bb-cart-xsell ul.products li.product .button { font-size: 11px; padding: 6px 10px; }

/* ---- summary ---- */
.bb-cart-summary { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 12px; }
.bb-cart-summary__card { background: #fff; border: 1px solid var(--bb-line); border-radius: 14px; padding: 22px; }
.bb-cart-summary__h { font-size: 17px; margin: 0 0 18px; font-weight: 800; }

.bb-cart-coupon { margin-bottom: 18px; }
.bb-cart-coupon .lbl { font-size: 11px; font-weight: 700; color: var(--bb-mute); letter-spacing: .06em; margin-bottom: 6px; }
.bb-cart-coupon .row { display: flex; gap: 6px; }
.bb-cart-coupon input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--bb-line); border-radius: 6px; font-size: 13px; outline: none; }
.bb-cart-coupon input:focus { border-color: var(--bb-red); }
.bb-cart-coupon__btn { padding: 9px 14px; background: var(--bb-ink); color: #fff; border: 0; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.bb-cart-coupon__btn:hover { background: #000; }

/* totals table */
.bb-cart-totals { border-top: 1px solid var(--bb-line); padding-top: 18px; }
.bb-cart-totals__table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bb-cart-totals__table tr { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; }
.bb-cart-totals__table th { font-weight: 500; color: var(--bb-mute); text-align: left; padding: 0; }
.bb-cart-totals__table td { font-weight: 600; color: var(--bb-ink); text-align: right; padding: 0; }
.bb-cart-totals__table .cart-discount th,
.bb-cart-totals__table .cart-discount td,
.bb-cart-totals__table .fee th,
.bb-cart-totals__table .fee td { color: var(--bb-green); }
.bb-cart-totals__table .order-total { border-top: 1px solid var(--bb-line); margin-top: 8px; padding-top: 14px; align-items: center; }
.bb-cart-totals__table .order-total th { font-size: 14px; font-weight: 700; color: var(--bb-ink); }
.bb-cart-totals__table .order-total td { font-size: 22px; font-weight: 800; color: var(--bb-red); }
.bb-cart-totals .woocommerce-shipping-destination,
.bb-cart-totals .shipping-calculator-button { font-size: 11px; color: var(--bb-mute); }

.bb-cart-koko { margin-top: 14px; padding: 10px 12px; background: var(--bb-ink); color: #fff; border-radius: 8px; }
.bb-cart-koko .eyebrow { font-size: 10px; color: var(--bb-yellow); font-weight: 700; letter-spacing: .08em; }
.bb-cart-koko .ttl { font-size: 12px; font-weight: 600; margin-top: 2px; }

.bb-cart-totals .wc-proceed-to-checkout { margin-top: 16px; padding: 0; }
.bb-cart-totals .wc-proceed-to-checkout a.checkout-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--bb-red); color: #fff; border: 0; padding: 14px; border-radius: 8px; font-size: 14px; font-weight: 700; text-align: center; }
.bb-cart-totals .wc-proceed-to-checkout a.checkout-button:hover { background: var(--bb-red-deep); }
.bb-cart-reassure { margin-top: 10px; font-size: 11px; color: var(--bb-mute); text-align: center; line-height: 1.5; }
.bb-cart-pays { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bb-line); }
.bb-cart-pays .lbl { font-size: 10px; color: var(--bb-mute); font-weight: 600; letter-spacing: .06em; margin-bottom: 8px; }
.bb-cart-pays .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bb-cart-pays .chips span { padding: 5px 9px; border-radius: 4px; background: var(--bb-bg); border: 1px solid var(--bb-line); font-size: 10px; font-weight: 700; color: var(--bb-ink-2); }

.bb-cart-help { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--bb-line); border-radius: 12px; padding: 14px; }
.bb-cart-help .ic { width: 36px; height: 36px; border-radius: var(--bb-r-pill); background: var(--bb-green-2); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.bb-cart-help .ic svg { width: 16px; height: 16px; }
.bb-cart-help .tx b { font-size: 12px; font-weight: 700; display: block; }
.bb-cart-help .tx span { font-size: 11px; color: var(--bb-mute); }

/* empty cart */
.bb-cart--empty { padding-top: 40px; }
.bb-cart-empty { background: #fff; border: 1px solid var(--bb-line); border-radius: 14px; padding: 60px 40px; text-align: center; max-width: 560px; margin: 0 auto; }
.bb-cart-empty__icon { font-size: 48px; margin-bottom: 16px; }
.bb-cart-empty__title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.bb-cart-empty__sub { font-size: 13px; color: var(--bb-mute); margin-bottom: 22px; }
.bb-cart-empty__notice { font-size: 12px; color: var(--bb-mute); margin-bottom: 18px; }
.bb-cart-empty__cta { display: inline-flex; }

/* responsive */
@media (max-width: 1023px) {
	.bb-cart-grid { grid-template-columns: 1fr; }
	.bb-cart-summary { position: static; }
	.bb-cart-xsell ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.bb-cart-head { flex-direction: column; align-items: flex-start; gap: 8px; }
	.bb-cart-title { font-size: 24px; }
	.bb-cart-table tr.cart_item { grid-template-columns: 72px 1fr; grid-auto-rows: auto; row-gap: 10px; }
	.bb-cart-table .product-thumbnail { width: 72px; }
	.bb-cart-table .product-thumbnail img { width: 72px; height: 72px; }
	.bb-cart-table .product-quantity { grid-column: 2; }
	.bb-cart-table .product-subtotal { grid-column: 2; text-align: left; }
}
