/*
 * Canidiol - tunnel de commande maison 0.2.0 : PANIER (/panier/, page 615) rendu par notre document avec les
 * gabarits NATIFS cart/cart.php et cart/cart-totals.php. Charge apres tunnel.css (memes jetons de couleur).
 * Mobile d'abord : chaque ligne d'article est une carte (vignette | nom + prix | quantite + total | retirer),
 * zones tactiles >= 44 px, aucun debordement a 390 px. >= 1024 px : articles a gauche (60 %), totaux a droite
 * (40 %), memes bords que le tunnel. Les libelles data-title de woocommerce-smallscreen.css sont masques.
 */
body.cd-tm-cart .woocommerce { display: block; }
@media (min-width: 1024px) {
	body.cd-tm-cart .woocommerce { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 32px; align-items: start; }
	body.cd-tm-cart .woocommerce > * { grid-column: 1 / -1; }
	body.cd-tm-cart .woocommerce > form.woocommerce-cart-form { grid-column: 1; }
	body.cd-tm-cart .woocommerce > .cart-collaterals { grid-column: 2; }
}

/* Articles */
body.cd-tm-cart form.woocommerce-cart-form, body.cd-tm-cart .cart_totals { background: #fff; border-radius: var(--cd-r); padding: 16px; margin: 0 0 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); min-width: 0; }
body.cd-tm-cart table.shop_table.cart { display: block; width: 100%; margin: 0; border: 0; border-radius: 0; }
body.cd-tm-cart table.shop_table.cart thead { display: none; }
body.cd-tm-cart table.shop_table.cart tbody { display: block; }
body.cd-tm-cart table.shop_table.cart tr.cart_item {
	display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "thumb name remove" "thumb qty sub"; column-gap: 12px; row-gap: 6px;
	padding: 12px 0; border-bottom: 1px solid var(--cd-line-l); background: none;
}
/* woocommerce-smallscreen.css (< 768 px) masque la vignette, aligne tout a droite en !important et ajoute des
 * libelles ::before : neutralise ici avec une specificite superieure (0,3,3 et plus). */
body.cd-tm-cart table.shop_table.cart td { display: block; padding: 0; border: 0; text-align: left !important; background: none; min-width: 0; }
body.cd-tm-cart table.shop_table.cart td::before { display: none; content: none; }
body.cd-tm-cart table.shop_table.cart td.product-thumbnail { grid-area: thumb; display: block; }
body.cd-tm-cart td.product-thumbnail img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--cd-cream); }
body.cd-tm-cart td.product-name { grid-area: name; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
body.cd-tm-cart td.product-name a { color: var(--cd-text); text-decoration: none; font-weight: 500; }
body.cd-tm-cart td.product-name dl.variation { margin: 2px 0 0; font-size: 13px; color: var(--cd-soft); }
body.cd-tm-cart table.shop_table.cart td.product-price { display: none; }
body.cd-tm-cart td.product-remove { grid-area: remove; justify-self: end; }
body.cd-tm-cart td.product-remove a.remove { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -10px -10px 0 0; border-radius: 50%; color: var(--cd-soft) !important; font-size: 24px; line-height: 1; text-decoration: none; }
body.cd-tm-cart td.product-remove a.remove:hover { background: var(--cd-cream); color: var(--cd-err) !important; }
body.cd-tm-cart td.product-quantity { grid-area: qty; align-self: center; }
body.cd-tm-cart td.product-quantity .quantity input.qty { width: 76px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--cd-line); border-radius: 10px; font: inherit; font-size: 16px; text-align: center; }
body.cd-tm-cart table.shop_table.cart td.product-subtotal { grid-area: sub; align-self: center; justify-self: end; text-align: right !important; font-weight: 600; white-space: nowrap; }

/* Ligne d'actions : code promo natif + mise a jour (de secours, cart.js / tunnel.js la declenchent seuls) */
body.cd-tm-cart table.shop_table.cart tr:not(.cart_item) { display: block; }
body.cd-tm-cart td.actions { padding-top: 12px; }
body.cd-tm-cart td.actions .coupon { display: flex; flex-wrap: wrap; gap: 8px; float: none; margin: 0 0 10px; }
body.cd-tm-cart td.actions .coupon label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
body.cd-tm-cart td.actions .coupon #coupon_code { flex: 1 1 160px; min-width: 0; width: auto; min-height: 48px; margin: 0; padding: 10px 12px; border: 1px solid var(--cd-line); border-radius: 10px; font: inherit; font-size: 16px; text-transform: uppercase; }
body.cd-tm-cart td.actions .button { flex: 0 0 auto; min-height: 48px; margin: 0; padding: 0 18px; border: 1px solid var(--cd-main); border-radius: 32px; background: #fff; color: var(--cd-main); font: inherit; font-size: 15px; cursor: pointer; float: none; }
body.cd-tm-cart td.actions button[name="update_cart"] { width: 100%; }
body.cd-tm-cart td.actions button[name="update_cart"]:disabled { opacity: .5; cursor: default; }

/* Totaux (non collants : jamais de bloc fige par-dessus les articles) */
body.cd-tm-cart .cart-collaterals .cart_totals { float: none; width: auto; }
body.cd-tm-cart .cart_totals h2 { margin: 0 0 8px; font-size: 20px; font-weight: 500; color: var(--cd-text); }
body.cd-tm-cart .cart_totals table.shop_table { width: 100%; margin: 0; border: 0; border-collapse: collapse; table-layout: fixed; }
body.cd-tm-cart .cart_totals table.shop_table tr { display: table-row; }
body.cd-tm-cart .cart_totals table.shop_table th, body.cd-tm-cart .cart_totals table.shop_table td { display: table-cell; padding: 8px 0; border: 0; border-top: 1px solid var(--cd-line-l); background: none; overflow-wrap: anywhere; }
body.cd-tm-cart .cart_totals table.shop_table th { width: 55%; text-align: left; font-weight: 400; color: var(--cd-soft); }
body.cd-tm-cart .cart_totals table.shop_table td { text-align: right; }
body.cd-tm-cart .cart_totals table.shop_table td::before { display: none; content: none; }
body.cd-tm-cart .cart_totals tr.order-total th, body.cd-tm-cart .cart_totals tr.order-total td { color: var(--cd-text); font-size: 19px; font-weight: 600; }
body.cd-tm-cart .cart_totals .includes_tax { display: block; font-size: 13px; font-weight: 400; color: var(--cd-soft); }
body.cd-tm-cart .cart_totals tr.cd-tm-shipnext td { font-size: 14px; color: var(--cd-soft); }
body.cd-tm-cart .wc-proceed-to-checkout { padding: 12px 0 0; }
body.cd-tm-cart .wc-proceed-to-checkout a.checkout-button { margin: 0; font-size: 16px; min-height: 56px; }

/* Panier vide */
body.cd-tm-cart .wc-empty-cart-message, body.cd-tm-cart .cart-empty { margin: 0 0 12px; }
body.cd-tm-cart p.return-to-shop .button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 32px; background: var(--cd-main); color: #fff; text-decoration: none; }
