/**
 * Cart page — full restyle of WooCommerce's default cart templates.
 *
 * Unlike wishlist.css (a YITH-recognised override point), there's no
 * plugin hook that swaps WooCommerce's cart stylesheet for a theme file,
 * so this is enqueued directly (functions.php, is_cart()) alongside the
 * theme's main stylesheet — but the approach is identical: the PHP
 * templates (woocommerce/cart/cart.php, cart-totals.php, cross-sells.php)
 * are left at their WooCommerce defaults so the plugin's own cart.js
 * (AJAX quantity update, apply/remove coupon) keeps working untouched;
 * this file just restyles that same markup into the site's card-list +
 * sticky order-summary look. Only cart-empty.php is overridden (a small,
 * self-contained "empty state", the same pattern as the Wishlist page).
 *
 * Scoped to body.woocommerce-cart, the class WooCommerce adds on the Cart
 * page automatically.
 *
 * @package Furniture
 */

body.woocommerce-cart .cart-hero{background:var(--paper-2);border-bottom:1px solid var(--line);padding:56px 0 44px;text-align:center;}
body.woocommerce-cart .cart-eyebrow{font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--accent);margin:0 0 12px;}
body.woocommerce-cart .cart-heading{font-family:var(--font-display);font-weight:450;font-size:clamp(30px,4vw,44px);margin:0 0 14px;}
body.woocommerce-cart .cart-sub{font-size:15px;color:var(--ink-soft);max-width:46ch;margin:0 auto;}

body.woocommerce-cart .cart-body{padding:56px 0 80px;}

/* ---- Two-column layout: items + cross-sells / sticky order summary ---- */
body.woocommerce-cart .cart-body .wrap{display:grid;grid-template-columns:1fr 380px;grid-template-areas:"notices notices" "items summary" "cross summary";gap:16px 40px;align-items:start;}
body.woocommerce-cart .cart-body .wrap:has(.cart-empty-state){display:block;}
/* The [woocommerce_cart] shortcode wraps its output in a plain
   <div class="woocommerce">, and cart-totals/cross-sells sit one level
   deeper again inside <div class="cart-collaterals"> — both are unwrapped
   with display:contents so woocommerce-cart-form/cross-sells/cart_totals
   become direct children of the grid above and can be placed individually. */
body.woocommerce-cart .cart-body .wrap > .woocommerce{display:contents;}
body.woocommerce-cart .cart-collaterals{display:contents;}
body.woocommerce-cart .woocommerce-notices-wrapper{grid-area:notices;}
/* An empty notices wrapper (the common case — no "added to cart" / "coupon
   applied" message showing) still occupies its grid row, so the row-gap
   above the cart items is reserved even with nothing to show. Cancel just
   that gap when there's nothing in it. */
body.woocommerce-cart .cart-body .wrap:has(.woocommerce-notices-wrapper:empty) .woocommerce-cart-form{margin-top:-16px;}
body.woocommerce-cart .woocommerce-cart-form{grid-area:items;min-width:0;}
body.woocommerce-cart .cross-sells{grid-area:cross;min-width:0;margin-top:8px;}
body.woocommerce-cart .cart_totals{grid-area:summary;min-width:0;position:sticky;top:calc(var(--header-h, 121px) + 24px);}

@media (max-width:900px){
	body.woocommerce-cart .cart-body .wrap{grid-template-columns:1fr;grid-template-areas:"notices" "items" "summary" "cross";}
	body.woocommerce-cart .cart_totals{position:static;}
}

/* ---- Table -> card list ------------------------------------------------ */
body.woocommerce-cart table.cart{width:100%;border-collapse:separate;border-spacing:0;margin:0;}
body.woocommerce-cart table.cart thead{display:none;}
body.woocommerce-cart table.cart,
body.woocommerce-cart table.cart tbody{display:block;}
body.woocommerce-cart table.cart tbody{display:flex;flex-direction:column;gap:16px;}
body.woocommerce-cart table.cart tr.cart_item{display:flex;align-items:center;flex-wrap:wrap;gap:14px 20px;background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:18px 22px;position:relative;transition:border-color .15s;}
body.woocommerce-cart table.cart tr.cart_item:hover{border-color:var(--line-strong);}
body.woocommerce-cart table.cart td{display:block;padding:0;border:none;vertical-align:middle;}

body.woocommerce-cart table.cart td.product-remove{order:10;position:absolute;top:14px;right:14px;}
body.woocommerce-cart td.product-remove a.remove{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--paper-2);color:var(--ink-soft);font-size:20px;line-height:1;text-decoration:none;transition:background .15s,color .15s;}
body.woocommerce-cart td.product-remove a.remove:hover{background:var(--ink);color:var(--paper);}

body.woocommerce-cart table.cart td.product-thumbnail{flex:0 0 auto;order:0;}
body.woocommerce-cart td.product-thumbnail img{width:88px;height:88px;object-fit:cover;border-radius:10px;display:block;background:var(--paper-2);}

body.woocommerce-cart table.cart td.product-name{flex:1 1 220px;min-width:160px;order:1;padding-right:36px;}
body.woocommerce-cart td.product-name a{font-family:var(--font-display);font-weight:600;font-size:17px;color:var(--ink);text-decoration:none;line-height:1.3;}
body.woocommerce-cart td.product-name a:hover{color:var(--accent);}
body.woocommerce-cart td.product-name dl.variation{margin:8px 0 0;font-size:13px;color:var(--ink-soft);display:flex;flex-wrap:wrap;gap:4px 14px;}
body.woocommerce-cart td.product-name dl.variation dt,
body.woocommerce-cart td.product-name dl.variation dd{display:inline;margin:0;font-weight:500;}
body.woocommerce-cart td.product-name dl.variation dd{margin-right:2px;}
body.woocommerce-cart td.product-name dl.variation p{margin:0;display:inline;}
body.woocommerce-cart td.product-name .backorder_notification{font-size:12px;color:var(--accent-dark);margin:6px 0 0;}

body.woocommerce-cart table.cart td.product-price{flex:0 0 auto;order:2;font-family:var(--font-body);font-size:14.5px;color:var(--ink-soft);}

body.woocommerce-cart table.cart td.product-quantity{flex:0 0 auto;order:3;}
body.woocommerce-cart td.product-quantity .quantity{display:inline-flex;align-items:center;border:1px solid var(--line-strong);border-radius:2px;}
body.woocommerce-cart td.product-quantity .quantity .qty-btn{width:34px;height:40px;border:none;background:none;font-size:15px;cursor:pointer;color:var(--ink);}
body.woocommerce-cart td.product-quantity .quantity .qty-btn:hover{background:var(--paper-2);}
body.woocommerce-cart td.product-quantity .quantity input.qty{width:40px;height:40px;border:none;border-left:1px solid var(--line);border-right:1px solid var(--line);text-align:center;font-size:14.5px;-moz-appearance:textfield;}
body.woocommerce-cart td.product-quantity .quantity input.qty::-webkit-inner-spin-button,
body.woocommerce-cart td.product-quantity .quantity input.qty::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}

body.woocommerce-cart table.cart td.product-subtotal{flex:0 0 auto;order:4;margin-left:auto;font-family:var(--font-body);font-weight:650;font-size:16px;color:var(--ink);}

/* ---- Actions row: coupon box + update cart ----------------------------- */
body.woocommerce-cart table.cart tr:has(td.actions){background:none;border:none;padding:0;}
body.woocommerce-cart table.cart td.actions{width:100%;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:16px;background:var(--paper-2);border:1px solid var(--line);border-radius:14px;padding:20px 22px;}

body.woocommerce-cart .coupon{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;flex:1 1 280px;}
/* The plugin's own <label> stays screen-reader-only — the heading below
   (hooked in via woocommerce_cart_coupon, see furniture_cart_coupon_extras()
   in inc/woocommerce.php) is the visible one, so there's only one. */
body.woocommerce-cart .coupon-heading{order:-3;flex-basis:100%;margin:0 0 2px;font-family:var(--font-body);font-size:15px;font-weight:700;color:var(--ink);}
body.woocommerce-cart .coupon #coupon_code{background:var(--paper);border:1px solid var(--line-strong);border-radius:100px;padding:11px 18px;font-family:var(--font-body);font-size:14px;color:var(--ink);outline:none;min-width:180px;flex:1 1 180px;}
body.woocommerce-cart .coupon #coupon_code:focus{border-color:var(--ink);}
body.woocommerce-cart .coupon #coupon_code.has-error{border-color:var(--accent-dark);}
body.woocommerce-cart .coupon button[name="apply_coupon"]{background:var(--ink);color:var(--paper);font-family:var(--font-body);font-weight:600;font-size:13.5px;padding:11px 22px;border-radius:100px;border:none;cursor:pointer;white-space:nowrap;transition:background-color .2s ease;}
body.woocommerce-cart .coupon button[name="apply_coupon"]:hover{background:var(--accent);}
body.woocommerce-cart .coupon-error-notice{flex-basis:100%;font-size:12.5px;color:var(--accent-dark);margin:0;}

/* Applied-coupon chips — code + the actual amount it's knocking off,
   confirmed right in this box (not just the Cart Totals sidebar). */
body.woocommerce-cart .coupon-applied-list{order:-2;flex-basis:100%;display:flex;flex-wrap:wrap;gap:8px;margin-bottom:4px;}
body.woocommerce-cart .coupon-applied-chip{display:inline-flex;align-items:center;gap:8px;background:rgba(47,111,69,0.08);border:1px solid rgba(47,111,69,0.3);border-radius:100px;padding:6px 6px 6px 14px;font-family:var(--font-body);font-size:12.5px;}
body.woocommerce-cart .coupon-applied-code{font-weight:700;color:#2f6f45;letter-spacing:.03em;}
body.woocommerce-cart .coupon-applied-amount{color:#2f6f45;font-weight:600;}
body.woocommerce-cart .coupon-applied-chip a.woocommerce-remove-coupon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:rgba(47,111,69,0.15);color:#2f6f45;text-decoration:none;font-size:14px;line-height:1;transition:background-color .15s,color .15s;}
body.woocommerce-cart .coupon-applied-chip a.woocommerce-remove-coupon:hover{background:#2f6f45;color:#fff;}

/* Available-coupons list — admin opt-in per coupon (Cart Coupon List box on
   the coupon edit screen), rendered via woocommerce_cart_coupon so no core
   template needs forking. Clicking a chip fills #coupon_code and submits
   (see main.js). */
body.woocommerce-cart .coupon-list{order:3;flex-basis:100%;display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;}
body.woocommerce-cart .coupon-chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 14px;border:1px dashed var(--line-strong);border-radius:8px;background:var(--paper);cursor:pointer;font-family:var(--font-body);text-align:left;transition:border-color .15s,background .15s;}
body.woocommerce-cart .coupon-chip:hover{border-color:var(--accent);border-style:solid;background:var(--paper-2);}
body.woocommerce-cart .coupon-chip-code{font-size:12.5px;font-weight:700;color:var(--ink);letter-spacing:.03em;}
body.woocommerce-cart .coupon-chip-desc{font-size:11.5px;color:var(--ink-soft);}

/* The cart auto-updates on any quantity change (see main.js — it clicks
   this button programmatically once WooCommerce's own handler has enabled
   it), so the manual button itself is hidden rather than shown to click. */
body.woocommerce-cart button[name="update_cart"]{display:none;}

/* ---- Cross-sells: reuses the same .spot-card / ul.products grid as the
   shop and "You may also like" — this section just adds the heading. ---- */
body.woocommerce-cart .cross-sells{padding-top:8px;border-top:1px solid var(--line);}
body.woocommerce-cart .cross-sells h2{font-family:var(--font-display);font-weight:650;font-size:clamp(20px,2.4vw,26px);margin:24px 0 24px;}

/* ---- Order summary sidebar --------------------------------------------- */
body.woocommerce-cart .cart_totals{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:26px 26px 24px;}
body.woocommerce-cart .cart_totals h2{font-family:var(--font-display);font-weight:650;font-size:20px;margin:0 0 18px;}
body.woocommerce-cart .cart_totals table.shop_table{width:100%;border-collapse:collapse;}
body.woocommerce-cart .cart_totals table.shop_table tr{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:11px 0;border-bottom:1px solid var(--line);}
body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td{padding:0;border:none;font-weight:400;text-align:right;font-size:14px;}
body.woocommerce-cart .cart_totals table.shop_table th{text-align:left;color:var(--ink-soft);font-weight:500;}

body.woocommerce-cart .cart_totals table.shop_table tr.cart-subtotal td{color:var(--ink);font-weight:600;}

body.woocommerce-cart .cart_totals table.shop_table tr.cart-discount{background:rgba(47,111,69,0.07);margin:0 -12px;padding:11px 12px;border-radius:8px;border-bottom:none;}
body.woocommerce-cart .cart_totals tr.cart-discount th,
body.woocommerce-cart .cart_totals tr.cart-discount td{color:#2f6f45;font-weight:650;}
body.woocommerce-cart .cart_totals a.woocommerce-remove-coupon{margin-left:8px;color:var(--ink-soft);font-weight:500;font-size:12px;text-decoration:underline;}
body.woocommerce-cart .cart_totals a.woocommerce-remove-coupon:hover{color:var(--accent-dark);}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total{border-bottom:none;border-top:1px solid var(--line-strong);margin-top:4px;padding-top:16px;}
body.woocommerce-cart .cart_totals tr.order-total th{font-size:16px;font-weight:650;color:var(--ink);}
body.woocommerce-cart .cart_totals tr.order-total td{font-size:19px;font-weight:650;color:var(--accent);}

body.woocommerce-cart .wc-proceed-to-checkout{margin-top:20px;}
body.woocommerce-cart a.checkout-button{display:block;width:100%;text-align:center;box-sizing:border-box;background:var(--accent);color:var(--paper);font-family:var(--font-body);font-weight:650;font-size:15px;padding:15px 22px;border-radius:100px;text-decoration:none;transition:background-color .2s ease,transform .15s ease;}
body.woocommerce-cart a.checkout-button:hover{background:var(--accent-dark);transform:translateY(-1px);}

body.woocommerce-cart .cart-totals-trust{margin-top:20px;padding-top:18px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:12px;}
body.woocommerce-cart .cart-totals-trust-item{display:flex;align-items:center;gap:10px;font-size:12.5px;color:var(--ink-soft);}
body.woocommerce-cart .cart-totals-trust-icon{width:20px;height:20px;flex:0 0 auto;color:var(--ink);}
body.woocommerce-cart .cart-totals-trust-icon svg{width:100%;height:100%;}

/* ---- Empty state -------------------------------------------------------- */
body.woocommerce-cart .cart-empty-state{text-align:center;max-width:420px;margin:0 auto;padding:64px 24px;}
body.woocommerce-cart .cart-empty-icon{width:56px;height:56px;margin:0 auto 24px;color:var(--line-strong);}
body.woocommerce-cart .cart-empty-icon svg{width:100%;height:100%;}
body.woocommerce-cart .cart-empty-state h2{font-family:var(--font-display);font-weight:450;font-size:22px;margin:0 0 12px;}
body.woocommerce-cart .cart-empty-state p{font-size:14.5px;color:var(--ink-soft);margin:0 0 28px;}

@media (max-width:640px){
	body.woocommerce-cart .cart-hero{padding:40px 0 32px;}
	body.woocommerce-cart table.cart tr.cart_item{padding:16px;}
	body.woocommerce-cart table.cart td.product-subtotal{margin-left:0;}
}
