/*
 * WooCommerce surfaces — shop, product, cart, checkout.
 * All light context: decor photography needs a near-white ground.
 */

.woocommerce-page,
.woocommerce { background-color: var(--eld-bg); }

/* --- Shop / archive grid --- */

/*
 * Not scoped under .woocommerce: the homepage renders a product loop outside
 * that wrapper, and without this the h1-h6 rule in base.css wins and titles
 * fall back to Italiana — too decorative at card size.
 */
ul.products li.product .woocommerce-loop-product__title,
.woocommerce-loop-product__title,
.wc-block-grid__product-title {
  font-family: var(--eld-font-body);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--eld-ink);
}

/*
 * The card title is wrapped in the product link, and Blocksy paints that link
 * with the accent colour — which leaves the title a pale gold on near-white.
 * Titles are body copy here, not links; only the hover state is accent.
 */
ul.products li.product a,
ul.products li.product a .woocommerce-loop-product__title {
  color: var(--eld-ink);
}

ul.products li.product a:hover .woocommerce-loop-product__title {
  color: var(--eld-accent-h);
}

/* Product grid: hold four across on desktop, two on mobile. */
ul.products.columns-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  ul.products.columns-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem 1.5rem;
  }
}

ul.products.columns-4 li.product {
  width: 100%;
  margin: 0;
  float: none;
  clear: none;
}

ul.products li.product img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 0.875rem;
}

/* Category label under the title — quiet, uppercase, not a heading. */
ul.products li.product .eld-card-cat,
ul.products li.product .posted_in {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: var(--eld-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--eld-ink-3);
}

.woocommerce ul.products li.product a img,
.wc-block-grid__product-image img {
  border-radius: var(--eld-radius);
  background-color: var(--eld-bg-2);
}

.woocommerce ul.products li.product .price,
.wc-block-grid__product-price {
  font-family: var(--eld-font-body);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--eld-ink);
}

.woocommerce ul.products li.product .price del {
  color: var(--eld-ink-3);
  font-weight: 400;
}

.woocommerce ul.products li.product .price ins {
  text-decoration: none;
  color: var(--eld-accent-h);
}

/* Sale badge — full round, gold, no shadow */
.woocommerce span.onsale,
.wc-block-grid__product-onsale {
  background-color: var(--eld-accent);
  color: var(--eld-on-accent);
  border-radius: var(--eld-radius-full);
  font-family: var(--eld-font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: var(--eld-tracking-wide);
  padding: 0.375rem 0.875rem;
  min-height: 0;
  line-height: 1.4;
}

/* --- Single product --- */

.woocommerce div.product .product_title {
  font-family: var(--eld-font-body);
  font-weight: 500;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: 0;
  color: var(--eld-ink);
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  font-family: var(--eld-font-body);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--eld-ink);
}

.woocommerce div.product .woocommerce-product-details__short-description {
  color: var(--eld-ink-2);
  line-height: 1.7;
}

.woocommerce div.product .woocommerce-product-details__short-description ul {
  padding-left: 1.125rem;
}

.woocommerce div.product .woocommerce-product-details__short-description li {
  margin-bottom: 0.375rem;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  border-radius: var(--eld-radius) var(--eld-radius) 0 0;
  background-color: var(--eld-bg-2);
  border-color: var(--eld-border);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
  background-color: var(--eld-bg);
  border-bottom-color: var(--eld-bg);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  font-family: var(--eld-font-body);
  font-weight: 500;
  color: var(--eld-ink-2);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--eld-ink);
}

/* Quantity input matches the 44px control height */
.woocommerce .quantity .qty {
  min-height: var(--eld-control-h);
  border-radius: var(--eld-radius);
  border: 1px solid var(--eld-border-2);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/*
 * Delivery notice — required by art. L216-1. Rendered by inc/woocommerce.php.
 * Without a stated delivery window the statutory default of 30 days applies.
 */
.eld-delivery-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 1.25rem 0;
  padding: 0.875rem 1rem;
  border: 1px solid var(--eld-border);
  border-radius: var(--eld-radius);
  background-color: var(--eld-bg-2);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--eld-ink-2);
}

.eld-delivery-notice svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 0.125rem;
  stroke: var(--eld-accent);
  stroke-width: 1.5;
  fill: none;
}

.eld-retractation-note {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--eld-ink-3);
}

/* --- Breadcrumb --- */

.woocommerce .woocommerce-breadcrumb {
  font-family: var(--eld-font-body);
  font-size: 0.8125rem;
  color: var(--eld-ink-3);
}

.woocommerce .woocommerce-breadcrumb a { color: var(--eld-ink-2); }
.woocommerce .woocommerce-breadcrumb a:hover { color: var(--eld-accent); }

/* --- Cart & checkout --- */

.woocommerce table.shop_table {
  border-radius: var(--eld-radius);
  border-color: var(--eld-border);
}

.woocommerce table.shop_table th {
  font-family: var(--eld-font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--eld-tracking-eyebrow);
  color: var(--eld-ink-2);
}

.woocommerce table.shop_table td { color: var(--eld-ink-2); }

/*
 * The primary WooCommerce button.
 *
 * Woo styles a.button.alt from its own stylesheet, which loads after this one,
 * so an equally specific rule loses and the checkout button came out in
 * WooCommerce's default purple on the one page where the brand matters most.
 * Matching its specificity and setting the plugin's own custom properties
 * covers both the classic markup and anything reading the variables.
 */
:root {
  --wc-primary: var(--eld-accent);
  --wc-primary-text: var(--eld-on-accent);
}

.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt {
  background-color: var(--eld-accent);
  color: var(--eld-on-accent);
  border: 0;
}

.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #respond input#submit.alt:hover {
  background-color: var(--eld-accent-h);
  color: var(--eld-on-accent);
}

.woocommerce a.button.alt.disabled,
.woocommerce button.button.alt:disabled {
  background-color: var(--eld-bg-3);
  color: var(--eld-ink-2);
}

/*
 * Scoped to the commerce markup itself, not the whole page. As a bare
 * descendant selector this also caught the footer's column headings — which
 * are h2 — and blew them up to 22px on every cart and checkout page.
 */
.woocommerce-checkout .woocommerce h3,
.woocommerce-cart .woocommerce h2,
.woocommerce-checkout #order_review_heading {
  font-family: var(--eld-font-body);
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: 0;
  color: var(--eld-ink);
}

.woocommerce form .form-row label {
  font-family: var(--eld-font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--eld-ink-2);
}

.woocommerce form .form-row .required {
  color: var(--eld-error);
  text-decoration: none;
}

/* Terms checkbox — must be visible and never pre-checked (Code de la conso) */
.woocommerce-terms-and-conditions-wrapper {
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid var(--eld-border);
  border-radius: var(--eld-radius);
  background-color: var(--eld-bg-2);
}

.woocommerce-terms-and-conditions-wrapper .woocommerce-form__label-for-checkbox {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* The order button carries the legally mandated wording, so it needs room
   for a long label on narrow screens. */
.woocommerce #payment #place_order,
.woocommerce-checkout #place_order {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.3;
  white-space: normal;
  height: auto;
}

.woocommerce #payment ul.payment_methods {
  border-color: var(--eld-border);
  background-color: var(--eld-bg-2);
  border-radius: var(--eld-radius) var(--eld-radius) 0 0;
}

.woocommerce #payment div.payment_box {
  background-color: var(--eld-bg-3);
  border-radius: var(--eld-radius);
  color: var(--eld-ink-2);
  font-size: 0.875rem;
}

.woocommerce #payment div.payment_box::before { display: none; }

/* --- Notices --- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top: 0;
  border-left: 3px solid;
  border-radius: var(--eld-radius);
  background-color: var(--eld-bg-2);
  color: var(--eld-ink-2);
  font-size: 0.9375rem;
}

.woocommerce-message { border-left-color: var(--eld-success); }
.woocommerce-info { border-left-color: var(--eld-accent); }
.woocommerce-error { border-left-color: var(--eld-error); }

.woocommerce-message::before,
.woocommerce-info::before { color: var(--eld-accent); }
.woocommerce-error::before { color: var(--eld-error); }

/* --- Empty-state polish: an empty shop should not look broken --- */

.woocommerce-info.woocommerce-no-products-found,
.cart-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}
