/* ==========================================================================
   Cart (Panier.dc.html) — line-item table + sticky summary card, full width.
   ========================================================================== */

/* The page's own "Panier" title is replaced by the serif heading below. */
.woocommerce-cart .entry-header,
.woocommerce-cart .page-title { display: none; }

.jl-cart__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin: 8px 0 40px;
}
.jl-cart__title {
  margin: 0;
  font-family: var(--jl-serif);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1.05;
}
.jl-cart__title em { font-style: italic; color: var(--jl-bordeaux); }
.jl-cart__count { font-size: 14px; color: var(--jl-text-50); }

/* --- Two columns: line items + summary --- */
@media (min-width: 769px) {
  .woocommerce-cart .woocommerce-cart-form { float: left; width: 60%; margin: 0; }
  .woocommerce-cart .cart-collaterals { float: right; width: 36%; }
  .woocommerce-cart .cart-collaterals .cart_totals { width: 100%; float: none; }
  .woocommerce-cart .cart-collaterals .cross-sells { width: 100%; float: none; margin-top: 40px; }
}

/* --- Line-item table --- */
/* Fixed layout so the columns always fit the 60% column — otherwise the wide
   quantity stepper pushes the table past its container and under the card. */
.woocommerce-cart table.cart { width: 100%; table-layout: fixed; border: 0; margin: 0; }
.woocommerce-cart table.cart thead th.product-remove { width: 30px; }
.woocommerce-cart table.cart thead th.product-thumbnail { width: 92px; }
.woocommerce-cart table.cart thead th.product-price { width: 80px; }
.woocommerce-cart table.cart thead th.product-quantity { width: 120px; }
.woocommerce-cart table.cart thead th.product-subtotal { width: 96px; }
/* The design's header row is just a bottom rule — drop Storefront's grey band. */
.woocommerce-cart table.cart thead,
.woocommerce-cart table.cart thead tr { background: transparent; }
.woocommerce-cart table.cart thead th {
  padding: 0 8px 16px;
  border: 0;
  border-bottom: 1px solid var(--jl-line);
  background: transparent;
  font: 500 11px/1 var(--jl-sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--jl-text-42);
  text-align: left;
}
/* Storefront fills table headers (#f8f8f8) and even rows (#fbfbfb) — the design
   has neither, so out-specify both on the cart and the totals tables. */
.woocommerce-cart table.cart:not(.has-background) thead th,
.woocommerce-cart table.cart:not(.has-background) tbody tr:nth-child(2n) td,
.woocommerce-cart .cart_totals table:not(.has-background) th,
.woocommerce-cart .cart_totals table:not(.has-background) td,
.woocommerce-cart fieldset,
.woocommerce-cart fieldset legend { background-color: transparent; }
/* Column alignment matches the design: price/subtotal right, quantity centred. */
.woocommerce-cart table.cart thead th.product-price,
.woocommerce-cart table.cart td.product-price { text-align: right; }
.woocommerce-cart table.cart thead th.product-quantity,
.woocommerce-cart table.cart td.product-quantity { text-align: center; }
.woocommerce-cart table.cart thead th.product-subtotal,
.woocommerce-cart table.cart td.product-subtotal { text-align: right; }

.woocommerce-cart table.cart tbody td {
  padding: 24px 8px;
  border: 0;
  border-bottom: 1px solid rgba(27, 21, 18, .08);
  background: transparent;
  vertical-align: middle;
}
/* Remove × hugs the thumbnail (the design groups ×, image and name together). */
.woocommerce-cart table.cart td.product-remove { width: 34px; padding-right: 0; text-align: right; }
.woocommerce-cart table.cart td.product-remove a.remove {
  position: relative;        /* anchor the ::before mask, centred via inset:0 */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--jl-r-pill);
  border: 1px solid var(--jl-line);
  background: #fff !important;        /* Woo enforces a coloured remove link inline */
  color: var(--jl-text-50) !important;
  font-size: 0;                       /* hide the raw text node / any icon font */
}
/* Render our own × SVG — a Font Awesome ::before (filled times-circle) otherwise
   loads over the link, and Storefront hides the raw text node. */
.woocommerce-cart table.cart td.product-remove a.remove::before {
  content: "" !important;
  position: absolute;
  inset: 0;
  background-color: currentColor;
  -webkit-mask: var(--jl-icon-x) center / 14px 14px no-repeat;
  mask: var(--jl-icon-x) center / 14px 14px no-repeat;
}
.woocommerce-cart table.cart td.product-remove a.remove::after { content: none !important; }
.woocommerce-cart table.cart td.product-remove a.remove:hover {
  border-color: var(--jl-bordeaux);
  color: var(--jl-bordeaux) !important;
  background: #fff !important;
}
.woocommerce-cart table.cart td.product-thumbnail { width: 92px; }
.woocommerce-cart table.cart td.product-thumbnail img {
  width: 72px;
  height: 72px;
  max-width: none;            /* override Storefront's img{max-width:100%}, which
                                 squashed the image to the cell width (→ rectangle) */
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(181, 144, 77, .4);   /* gold edge */
}
.woocommerce-cart table.cart td.product-name {
  font-family: var(--jl-serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.15;
}
.woocommerce-cart table.cart td.product-name a { color: var(--jl-ink); text-decoration: none; }
.woocommerce-cart table.cart td.product-name a:hover { color: var(--jl-bordeaux); }
/* Native <dl class="variation"> is replaced by our single-line .jl-line__meta. */
.woocommerce-cart table.cart td.product-name dl.variation { display: none; }
.woocommerce-cart table.cart td.product-name .jl-line__meta,
.woocommerce-cart table.cart td.product-name .wc-item-meta {
  margin: 5px 0 0;
  font-family: var(--jl-sans);
  font-weight: 400;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--jl-text-50);
}
.woocommerce-cart table.cart td.product-name .wc-item-meta li { margin: 0; }
/* Links inside the line meta (e.g. the custom-order "Voir le dessin") read as links */
.woocommerce-cart table.cart td.product-name .jl-line__meta a {
  color: var(--jl-bordeaux);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.woocommerce-cart table.cart td.product-name .jl-line__meta a:hover { color: var(--jl-bordeaux-dark); }
.woocommerce-cart table.cart td.product-price {
  color: var(--jl-text-70);
  font-size: 14px;
  white-space: nowrap;
}
.woocommerce-cart table.cart td.product-subtotal {
  font-weight: 500;
  font-size: 15px;
  color: var(--jl-ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* quantity field as a pill (native input; edits auto-apply via cart.js) */
.woocommerce-cart table.cart .quantity {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  background: #fff;
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-r-pill);
}
.woocommerce-cart table.cart .quantity .qty {
  width: 34px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  text-align: center;
  font: 500 14px var(--jl-sans);
  color: var(--jl-ink);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.woocommerce-cart table.cart .quantity .qty::-webkit-outer-spin-button,
.woocommerce-cart table.cart .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Round − / + steppers flanking the input (injected by cart.js). */
.woocommerce-cart table.cart .quantity .jl-qty-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-r-pill);
  background: #fff;
  box-shadow: none;
  color: var(--jl-bordeaux);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.woocommerce-cart table.cart .quantity .jl-qty-btn:hover {
  border-color: var(--jl-bordeaux);
  background: rgba(110, 28, 47, .06);
}
.woocommerce-cart table.cart .quantity .jl-qty-btn:disabled {
  opacity: .4;
  cursor: default;
  border-color: var(--jl-line);
  background: #fff;
}
.woocommerce-cart table.cart .quantity .jl-qty-btn svg { display: block; }

/* Read-only quantity (sold-individually items): same pill, visibly inert. */
.woocommerce-cart table.cart .quantity.jl-qty-readonly {
  background: #fff;
  border-color: rgba(27, 21, 18, .08);
}
.woocommerce-cart table.cart .quantity.jl-qty-readonly .qty {
  color: var(--jl-text-50);
  cursor: default;
}

/* --- Actions row (no coupon on the cart — entered at checkout) ---
   Just the "Continuer mes achats" link: quantity edits auto-apply, so the native
   "Mettre à jour le panier" button is hidden (kept in the DOM for the tip plugin,
   which clicks it to refresh the cart). */
.woocommerce-cart table.cart td.actions {
  padding: 28px 0 0;
  border-bottom: 0;
}
.woocommerce-cart table.cart td.actions::after { content: ""; display: block; clear: both; }
.woocommerce-cart table.cart td.actions button[name="update_cart"] { display: none; }
.jl-cart__continue {
  float: left;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--jl-bordeaux);
}
.woocommerce-cart table.cart td.actions .jl-cart__continue,
.woocommerce-cart table.cart td.actions .jl-cart__continue:hover { text-decoration: none; }
.jl-cart__continue::before { content: "\2190"; }
.jl-cart__continue:hover { color: var(--jl-bordeaux-dark); }

/* --- Summary card (.cart_totals) --- */
.woocommerce-cart .cart_totals {
  padding: 34px;
  background: #fff;
  border: 1px solid var(--jl-line);
  border-radius: 20px;
  box-shadow: 0 22px 44px rgba(27, 21, 18, .07);
  position: sticky;
  top: 24px;
}
.woocommerce-cart .cart_totals h2 {
  margin: 0 0 24px;
  font-family: var(--jl-serif);
  font-weight: 600;
  font-size: 26px;
}
/* Take the totals table out of table layout entirely (a display:block <td>/<tr>
   inside a display:table can't be forced full-width reliably). Rows become flex:
   subtotal/total are space-between, the shipping row stacks into a column. */
.woocommerce-cart .cart_totals table,
.woocommerce-cart .cart_totals table tbody { display: block; width: 100%; border: 0; margin: 0; }
.woocommerce-cart .cart_totals table tr {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding: 11px 0;
  border-top: 1px solid rgba(27, 21, 18, .08);
}
.woocommerce-cart .cart_totals table tr:first-child { border-top: 0; }
.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
  display: block;
  padding: 0;
  border: 0;
  font-size: 14px;
}
.woocommerce-cart .cart_totals table th { font-weight: 400; text-align: left; color: var(--jl-text-70); }
.woocommerce-cart .cart_totals table td { text-align: right; color: var(--jl-ink); font-weight: 500; }

/* Shipping row → an "EXPÉDITION" eyebrow above full-width radio cards. */
.woocommerce-cart .cart_totals .woocommerce-shipping-totals {
  flex-direction: column;
  align-items: stretch;
  padding: 16px 0 6px;
}
.woocommerce-cart .cart_totals .woocommerce-shipping-totals th {
  padding: 0 0 12px;
  font: 500 12px/1 var(--jl-sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--jl-text-50);
}
.woocommerce-cart .cart_totals #shipping_method { list-style: none; width: 100%; margin: 0; padding: 0; }
.woocommerce-cart .cart_totals #shipping_method li {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 9px;
  padding: 13px 16px;
  border: 1px solid var(--jl-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.woocommerce-cart .cart_totals #shipping_method li:has(input:checked) {
  border-color: var(--jl-bordeaux);
  background: rgba(110, 28, 47, .06);
}
.woocommerce-cart .cart_totals #shipping_method input.shipping_method {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--jl-bordeaux);
}
.woocommerce-cart .cart_totals #shipping_method label {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font: 500 13.5px/1.3 var(--jl-sans);
  color: var(--jl-text-70);
  cursor: pointer;
}
.woocommerce-cart .cart_totals #shipping_method li:has(input:checked) label { color: var(--jl-ink); }
/* the design has no destination note / manual shipping calculator */
.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
.woocommerce-cart .cart_totals .woocommerce-shipping-calculator { display: none; }

.woocommerce-cart .cart_totals .order-total th { font-family: var(--jl-serif); font-size: 24px; font-weight: 600; color: var(--jl-ink); }
.woocommerce-cart .cart_totals .order-total td,
.woocommerce-cart .cart_totals .order-total .amount {
  font-family: var(--jl-serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--jl-bordeaux);
}
.woocommerce-cart .cart_totals .order-total { border-top-color: var(--jl-line); }

/* Tip widget, relocated into the summary card by cart.js */
.woocommerce-cart .cart_totals .jl-tip {
  padding: 16px 0 4px;
  border-top: 1px solid rgba(27, 21, 18, .1);
}
.woocommerce-cart .cart_totals .jl-tip__label {
  margin-bottom: 12px;
  font: 500 12px/1 var(--jl-sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--jl-text-50);
}
/* Tip + cart updates are AJAX round-trips (the tip is a recalculated cart fee).
   The pills give instant feedback via cart.js, so the plugin/WooCommerce loading
   veils + spinners just flash gray noise — suppress them for a seamless update. */
.woocommerce-cart .blockUI.blockOverlay,
.woocommerce-cart .blockUI.blockMsg { display: none !important; }

/* The widget only ever shows inside our relocated .jl-tip card. WooCommerce
   re-renders it in the cart form (left column) on every AJAX refresh; hiding it
   everywhere else kills the flash of the un-styled widget + "Retirer" button
   before cart.js moves it (also covers the initial pre-relocate render). */
.woocommerce-cart #wooot_order_tip_form { display: none; }

/* Four pills in a row: Aucun · 1 € · 2 € · 5 € (presets configured in the
   plugin; "Aucun" is injected by cart.js). */
.woocommerce-cart .jl-tip #wooot_order_tip_form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
}
.woocommerce-cart .cart_totals .woo_order_tip,
.woocommerce-cart .cart_totals .jl-tip__none {
  padding: 13px 8px;
  border: 1px solid var(--jl-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  color: var(--jl-bordeaux);
  font: 500 13px var(--jl-sans);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.woocommerce-cart .cart_totals .woo_order_tip:hover,
.woocommerce-cart .cart_totals .jl-tip__none:hover { border-color: var(--jl-bordeaux); }
.woocommerce-cart .cart_totals .woo_order_tip.active,
.woocommerce-cart .cart_totals .jl-tip__none.active {
  border-color: var(--jl-brass);
  background: var(--jl-brass);
  color: #fff;
}
/* The plugin's own Apply (custom amounts, disabled) and Remove buttons are not
   part of this layout — the "Aucun" pill drives removal instead. !important is
   needed because the plugin's applyTip handler calls jQuery .show() on the remove
   button, writing an inline display that would otherwise out-rank a class selector
   and flash it in. */
.woocommerce-cart .cart_totals .woo_order_tip_apply,
.woocommerce-cart .cart_totals .woo_order_tip_remove { display: none !important; }

.woocommerce-cart .wc-proceed-to-checkout { padding: 20px 0 0; }
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  display: flex;
  width: 100%;
  padding: 17px;
  font-size: 15px;
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button::after { content: none; } /* drop Storefront's → arrow */
.jl-cart__tva { margin: 0 0 14px; font-size: 11px; color: var(--jl-text-42); }
.jl-cart__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 11px;
  color: var(--jl-text-50);
}
.jl-cart__secure svg { flex: none; }

/* --- Tablet / mobile (≤768px) ---
   Storefront's default responsive cart collapses the table into stacked rows
   with "Produit:/Prix:/…" data-title labels — cramped and off-brand. Replace it
   with a proper card per line item, and drop the labels the totals table grows
   at this width (desktop shows none). */
@media (max-width: 768px) {
  .woocommerce-cart .cart_totals { position: static; margin-top: 32px; }

  .woocommerce-cart table.cart,
  .woocommerce-cart table.cart tbody { display: block; }
  .woocommerce-cart table.cart thead { display: none; }

  .woocommerce-cart table.cart tbody tr.cart_item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    grid-template-areas:
      "thumb    name     remove"
      "thumb    price    price"
      "quantity quantity subtotal";
    column-gap: 16px;
    row-gap: 6px;
    align-items: center;
    padding: 18px;
    margin: 0 0 14px;
    border: 1px solid var(--jl-line);
    border-radius: 16px;
  }
  .woocommerce-cart table.cart tbody tr.cart_item td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
  }
  /* Suppress Storefront's per-cell data-title labels (re-added for price below). */
  .woocommerce-cart table.cart tbody tr.cart_item td::before { content: none !important; }

  .woocommerce-cart table.cart td.product-remove {
    grid-area: remove; width: auto; align-self: start; justify-self: end;
  }
  .woocommerce-cart table.cart td.product-thumbnail { grid-area: thumb; width: 72px; align-self: start; }
  .woocommerce-cart table.cart td.product-thumbnail img { width: 72px; height: 72px; }
  .woocommerce-cart table.cart td.product-name { grid-area: name; align-self: end; }
  /* Unit price under the meta — WooCommerce forces it display:block !important at
     this width, so it can't be hidden; label it instead to tell it apart from the
     bold line subtotal. */
  .woocommerce-cart table.cart td.product-price {
    grid-area: price; align-self: start; text-align: left;
    font-size: 13px; color: var(--jl-text-50);
  }
  .woocommerce-cart table.cart tbody tr.cart_item td.product-price::before {
    content: "Prix unitaire :\00a0" !important;
    color: var(--jl-text-42);
    font-weight: 400;
  }
  /* Quantity + subtotal share a footer row, divided from the details above. */
  .woocommerce-cart table.cart td.product-quantity {
    grid-area: quantity; text-align: left;
    margin-top: 12px; padding-top: 16px;
    border-top: 1px solid rgba(27, 21, 18, .08);
  }
  .woocommerce-cart table.cart td.product-subtotal {
    grid-area: subtotal; text-align: right; align-self: center; font-size: 17px;
    margin-top: 12px; padding-top: 16px;
    border-top: 1px solid rgba(27, 21, 18, .08);
  }
  .woocommerce-cart table.cart td.actions { display: block; padding-top: 20px; }

  /* Totals table: kill the data-title labels Storefront adds only on mobile. */
  .woocommerce-cart .cart_totals table td::before,
  .woocommerce-cart .cart_totals table th::before { content: none !important; }
}
