/**
 * The shop and product pages.
 *
 * WHY THIS FILE EXISTS
 * --------------------
 * The active theme is Hello Elementor, which ships essentially no WooCommerce
 * styling on purpose — it expects a page builder to supply it. Nothing did, so
 * the shop rendered as WooCommerce's unstyled fallback: a single column of
 * full-width product cards with a 300px thumbnail stretched to 1140px.
 *
 * The grid below does not depend on WooCommerce's `columns-N` class. That class
 * follows a setting someone may change, and a layout that breaks when a setting
 * moves is a trap; `auto-fill` with a sensible minimum gives a sane result at any
 * column count and on any screen.
 *
 * Colours are the site's own: the header navy and the account teal, so the shop
 * belongs to the same site as the pages either side of it.
 */

.woocommerce ul.products,
.woocommerce-page ul.products {
  --ols-navy: #1C244B;
  --ols-teal: #008b91;
  --ols-line: #e4e9ec;
  --ols-muted: #667279;

  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1.75rem;
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
}

/*
 * WooCommerce's clearfix pseudo-elements become GRID ITEMS once the list is a
 * grid, and the ::before took the first cell — which is why the first row of the
 * shop sat one column to the right of every row under it. A float clearfix in a
 * grid container is not a no-op, it is an extra child.
 */
/*
 * `body` is in the selector to win on SPECIFICITY rather than on order.
 *
 * Declaring a dependency on WooCommerce's stylesheets is the tidy fix and it is
 * still declared — but this site puts PageSpeed and WP Rocket's Remove Unused CSS
 * between the enqueue and the page, and both rewrite, reorder and inline. Source
 * order is not a thing to rely on here, so this rule does not.
 */
body.woocommerce ul.products::before,
body.woocommerce ul.products::after,
body.woocommerce-page ul.products::before,
body.woocommerce-page ul.products::after {
  content: none !important;
  display: none !important;
}

.woocommerce ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--ols-line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 139, 145, 0.4);
  box-shadow: 0 14px 30px rgba(28, 36, 75, 0.12);
}

/*
 * The square is the point. These images are 1:1 course covers, and letting them
 * set their own height is what produced a 1140px-tall thumbnail.
 */
.woocommerce ul.products li.product a img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  background: #f4f6f7;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ols-navy);
  padding: 1rem 1.1rem 0;
  margin: 0;
  /* Two lines, so cards in a row keep their tops and prices aligned. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.woocommerce ul.products li.product .price {
  display: block;
  padding: 0.55rem 1.1rem 0;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ols-teal);
}

.woocommerce ul.products li.product .price del { color: var(--ols-muted); font-weight: 400; }
.woocommerce ul.products li.product .price ins { text-decoration: none; }

.woocommerce ul.products li.product .star-rating {
  margin: 0.5rem 1.1rem 0;
  font-size: 0.8rem;
  color: #d8a13a;
}

/* Pushed to the bottom so buttons line up across a row of uneven titles. */
.woocommerce ul.products li.product .button {
  margin: auto 1.1rem 1.1rem;
  margin-top: auto;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--ols-navy);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.18s ease;
}

.woocommerce ul.products li.product .button:hover { background: var(--ols-teal); }
.woocommerce ul.products li.product .button.loading { opacity: 0.7; }

.woocommerce ul.products li.product .added_to_cart {
  margin: 0 1.1rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ols-teal);
}

/* ------------------------------------------------------- page furniture */

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering { margin-bottom: 1.75rem; }

.woocommerce .woocommerce-result-count { color: #667279; font-size: 0.92rem; }

.woocommerce .woocommerce-ordering select {
  border: 1px solid #e4e9ec;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: #1C244B;
  font-size: 0.92rem;
}

.woocommerce nav.woocommerce-pagination ul {
  border: 0;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
}

.woocommerce nav.woocommerce-pagination ul li { border: 0; }

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  border-radius: 10px;
  min-width: 2.4rem;
  padding: 0.5rem 0.7rem;
  color: #1C244B;
  background: #fff;
  border: 1px solid #e4e9ec;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
  background: #1C244B;
  border-color: #1C244B;
  color: #fff;
}

/* --------------------------------------------------------- single product */

.woocommerce div.product div.images img {
  border-radius: 16px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.woocommerce div.product .product_title {
  color: #1C244B;
  letter-spacing: -0.01em;
}

.woocommerce div.product p.price { color: #008b91; font-weight: 700; }

.woocommerce div.product form.cart .button {
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  background: #1C244B;
  color: #fff;
  font-weight: 600;
}

.woocommerce div.product form.cart .button:hover { background: #008b91; }

@media (max-width: 40rem) {
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 1rem;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 0.92rem; }
  .woocommerce ul.products li.product .price { font-size: 1rem; }
}
