/* ============================================================
   Tillex — WooCommerce styling
   Restyles WooCommerce's default markup to match the Tillex
   product-card and product-detail design. Loaded only when
   WooCommerce is active (see functions.php).
   ============================================================ */

/* Archive wrapper: WooCommerce output sits inside .tlx-container from the template. */
.woocommerce-products-header { margin-bottom: 16px; }

/* Tighten the oversized top gap between the site header and page content
   on the product archive and single-product templates (was ~52px). */
.tlx-archive.tlx-section,
.tlx-single.tlx-section { padding-top: 20px; }

/* Catalog mode: hide the price-based ordering select and the result count
   (replaced by the search box + filter tags in archive-product.html). */
.woocommerce-ordering,
.woocommerce-result-count { display: none !important; }

.woocommerce-breadcrumb {
  font-size: 13px; color: var(--text-muted); margin-bottom: 20px;
}
.woocommerce-breadcrumb a { color: var(--ink-600); }

/* ---- Shop toolbar: filter tags + search (archive-product.html) ---- */
.tlx-shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px;
}
.tlx-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tlx-tag {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard);
}
.tlx-tag { cursor: pointer; }
.tlx-tag:hover {
  border-color: var(--tillex-yellow);
  color: #000;
}
.tlx-tag--active,
.tlx-tag--active:hover {
  background: var(--tillex-yellow);
  border-color: var(--tillex-yellow);
  color: #000;
}
/* In-page filter styled like the site search field (magnifier + rounded input). */
.tlx-shop-filter {
  position: relative;
  flex: 0 1 300px;
  min-width: 220px;
}
.tlx-shop-filter__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tillex-silver);
  pointer-events: none;
}
.tlx-shop-filter input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 0 16px 0 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 14px;
  color: var(--ink-800);
}
.tlx-shop-filter input:focus {
  outline: none;
  border-color: var(--tillex-silver);
  box-shadow: 0 0 0 3px rgba(138, 141, 143, 0.18);
}
.tlx-shop-filter input::placeholder { color: var(--text-muted); }

/* ---- Shared search-results page (search.html) ---- */
.tlx-search-box {
  position: relative;
  display: flex;
  max-width: 560px;
  margin: 4px 0 28px;
}
.tlx-search-box__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tillex-silver);
  pointer-events: none;
}
.tlx-search-box input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 52px;
  box-sizing: border-box;
  padding: 0 16px 0 46px;
  border: 1px solid var(--border-strong);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: #fff;
  font-size: 16px;
  color: var(--ink-800);
}
.tlx-search-box input[type="search"]:focus { outline: none; }
.tlx-search-box__submit {
  flex: 0 0 auto;
  height: 52px;
  padding: 0 26px;
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--tillex-yellow);
  color: #000;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.tlx-search-page__count { font-size: 14px; color: var(--text-muted); margin: 0 0 20px; }

/* ---- Related products (single product) ---- */
.tlx-related { margin-top: 0; }
.tlx-related > h2 { font-size: clamp(20px, 3vw, 26px); margin: 0 0 22px; }

/* ---- Leaf category pages: bigger, richer product cards ----
   auto-FIT (not auto-fill) so the cards stretch to fill the width: 2 products =
   two big boxes, 3 = three columns, 4+ = four → 2 on tablet, 1 on mobile. */
.tlx-leaf-cat.woocommerce ul.products { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.tlx-leaf-cat.woocommerce ul.products li.product img { padding: 44px 30px 24px; }
.tlx-leaf-cat.woocommerce ul.products li.product .button { display: none; } /* our CTA replaces read-more */
/* A leaf category with a SINGLE product: lay that one card out horizontally
   (image left, text/info right) instead of one oversized centered card. */
.tlx-leaf-cat.woocommerce ul.products li.product:only-child > a.woocommerce-LoopProduct-link {
  display: grid;
  grid-template-columns: minmax(240px, 40%) 1fr;
  column-gap: clamp(24px, 4vw, 48px);
  align-items: start;
  text-align: left;
  padding: clamp(20px, 3vw, 34px);
}
.tlx-leaf-cat.woocommerce ul.products li.product:only-child > a > img {
  grid-column: 1;
  grid-row: 1 / span 50;
  align-self: center;
  width: 100%;
  padding: 0;
}
.tlx-leaf-cat.woocommerce ul.products li.product:only-child > a > :not(img) {
  grid-column: 2;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
}
.tlx-leaf-cat.woocommerce ul.products li.product:only-child .tlx-card-range-cta { margin-top: 18px; }
/* Keep the corner category tag's own padding (the reset above zeroed it). */
.tlx-leaf-cat.woocommerce ul.products li.product:only-child .tlx-card-cat { padding-left: 8px; padding-right: 8px; }
/* More room on these wide cards → larger colour dots. */
.tlx-leaf-cat .tlx-card-colours { gap: 7px; margin-bottom: 14px; }
.tlx-leaf-cat .tlx-card-colours .tlx-cc-dot { width: 18px; height: 18px; }
.tlx-card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 18px 12px; }
.tlx-card-chip {
  display: inline-block; padding: 3px 10px; border: 1px solid var(--border-strong);
  border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink-700); background: var(--bg-subtle);
}
/* Bit/drive-type chip (PH2 · T20) — tinted so it reads as the key differentiator. */
.tlx-card-chip--bit { background: var(--yellow-100, #FFF3D6); border-color: var(--tillex-yellow); color: #000; }
.tlx-card-range-cta {
  display: block; margin: auto 18px 18px; padding-top: 6px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--cc-orange);
}

/* "Works in" material grid (green check / yellow +P) on leaf-category cards */
.tlx-works { display: block; margin: 2px 18px 14px; }
.tlx-works__label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.tlx-works__list { display: flex; flex-wrap: wrap; gap: 10px; }
.tlx-works-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: auto; min-width: 58px; max-width: 84px; text-align: center; }
.tlx-works-item__ic { position: relative; line-height: 0; }
/* Higher specificity than ".woocommerce ul.products li.product img" so the big
   card-image padding / aspect-ratio does NOT apply to these little icons. */
.woocommerce ul.products li.product .tlx-works-item__ic img {
  padding: 0;
  aspect-ratio: auto;
  background: none;
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}
.tlx-works-item__name { font-size: 11px; line-height: 1.2; color: var(--ink-600); }
.tlx-works-item__badge {
  position: absolute; top: -6px; right: -6px; min-width: 15px; height: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 9px; font-weight: 700; line-height: 1;
  border: 1.5px solid #fff; box-sizing: content-box;
}
.tlx-works-item__badge--ok { background: #2e7d32; color: #fff; }
.tlx-works-item__badge--plug { background: var(--tillex-yellow); color: #000; padding: 0 4px; }
.tlx-works__legend { display: block; margin-top: 8px; font-size: 11px; color: var(--ink-600); font-style: italic; }

/* ---- Product grid ---- */
.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important;
  /* auto-fit (not auto-fill) so a category page with 2 or 3 sub-categories
     stretches them to fill the width instead of leaving empty columns. */
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  justify-content: start;
  gap: 18px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none !important; display: none !important; }

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  position: relative;
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  display: flex !important;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  padding: 0;
  transition: box-shadow var(--dur-base) var(--ease-standard);
}
.woocommerce ul.products li.product:hover { box-shadow: var(--shadow-md); }

/* Category corner tag (top-left), output by tillex-product.php loop hook */
.tlx-card-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-block;
  padding: 3px 8px;
  background: var(--tillex-yellow);
  color: #000;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: nowrap;
}
/* Product card short description + live-filter helpers */
.tlx-card-desc {
  margin: 0 18px 8px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-600);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tlx-card-idx { display: none; }
/* Colour dots on the product card — the colours this product is stocked in. */
.tlx-card-colours { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 18px 12px; }
.tlx-card-colours .tlx-cc-dot { width: 13px; height: 13px; border-radius: 50%; }
.tlx-card-colours__more { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-left: 2px; }
.woocommerce ul.products li.product.tlx-hidden { display: none !important; }
.tlx-shop-empty { padding: 32px 0; color: var(--text-muted); }

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
  display: flex; flex-direction: column; height: 100%;
}
.woocommerce ul.products li.product img {
  margin: 0 !important;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  /* Extra top padding so the yellow category tag (top-left) never overlaps the art. */
  padding: 38px 18px 14px;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  padding: 16px 18px 4px;
  font-size: 17px !important;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.01em;
}
.woocommerce ul.products li.product .price { display: none; } /* catalog mode */

/* "Læs mere" / read-more link styled as a quiet CTA */
.woocommerce ul.products li.product .button,
.woocommerce a.button {
  align-self: flex-start;
  margin: 0 18px 18px;
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--control-h-sm); padding: 0 16px;
  background: #fff; color: #000; border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
}
.woocommerce ul.products li.product .button:hover,
.woocommerce a.button:hover { background: var(--tillex-yellow); border-color: var(--tillex-yellow); color: #000; }

/* ============================================================
   SINGLE PRODUCT
   ============================================================ */
.woocommerce div.product {
  /* Row-gap kept small so the full-width segments below the image/summary
     (description, colour code, range table, related) sit close together;
     column-gap keeps the image↔summary breathing room. */
  display: flex; flex-wrap: wrap; gap: 22px 48px; align-items: flex-start;
}
.woocommerce div.product div.images {
  flex: 1 1 340px; min-width: 280px; margin: 0;
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  overflow: hidden; background: #fff;
  /* Stretch the framed panel to the height of the (often taller) text column and
     centre the image in it — no dead space below a short image before Description. */
  align-self: stretch; display: flex; align-items: center; justify-content: center;
}
/* Cap the height so tall products (screws / standing plugs) don't get giant. */
.woocommerce div.product div.images img {
  border-radius: 0; max-height: 520px; width: 100%; max-width: 100%;
  object-fit: contain; margin: 0 auto; padding: clamp(8px, 1.4vw, 14px);
}
.woocommerce div.product div.summary {
  flex: 1 1 360px; min-width: 280px; margin: 0;
}
.woocommerce div.product .product_title {
  font-size: clamp(30px, 4.6vw, 48px); letter-spacing: -0.02em; font-weight: 700; margin: 6px 0 16px;
}
.woocommerce div.product p.price,
.woocommerce div.product .price { display: none; } /* catalog mode */
.woocommerce div.product .woocommerce-product-details__short-description {
  font-weight: 300; font-size: 18px; line-height: 1.6; color: var(--text-body); max-width: 56ch;
}
.woocommerce div.product form.cart,
.woocommerce div.product .stock,
.woocommerce div.product .cart { display: none; } /* catalog mode: no purchase UI */

/* SKU / category meta line — not useful on a catalog site (SKU is the slug). */
.woocommerce div.product .product_meta { display: none; }

/* Tabs (description / additional info) */
.woocommerce div.product .woocommerce-tabs { width: 100%; margin-top: 32px; }
.woocommerce div.product .woocommerce-tabs ul.tabs {
  border-bottom: 1px solid var(--border-default); padding: 0; margin: 0 0 24px;
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before { border: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
  background: transparent; border: 0; border-radius: 0; margin: 0 20px 0 0; padding: 12px 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { border: 0 !important; box-shadow: none !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: #000; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
  border-bottom: 2px solid var(--tillex-yellow);
}

/* Related / up-sells: full-width block below the product, not a flex sibling */
.woocommerce div.product .related,
.woocommerce div.product .upsells {
  width: 100%;
  flex: 0 0 100%;
}
.woocommerce .related > h2, .woocommerce .upsells > h2 {
  font-size: clamp(24px, 3.4vw, 36px); margin-bottom: 24px;
}
/* Force the related grid horizontal (same responsive grid as the main loop) */
.woocommerce .related ul.products,
.woocommerce .upsells ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  gap: 18px;
}

/* Woo notices toned down (rarely shown in catalog mode) */
.woocommerce-message, .woocommerce-info { border-top-color: var(--tillex-yellow); }

/* ---- Subcategory tiles on category archives (main -> sub drill-down) ---- */
.woocommerce ul.products li.product-category { border: 1px solid var(--border-default); }
.woocommerce ul.products li.product-category a { display: flex; flex-direction: column; height: 100%; text-align: left; }
.woocommerce ul.products li.product-category img { aspect-ratio: 4/3; object-fit: contain; padding: 18px; margin: 0; background: #fff; }
.woocommerce ul.products li.product-category .woocommerce-loop-category__title {
  padding: 16px 18px 18px; margin: 0; font-size: 17px !important; font-weight: 700; color: #000;
  letter-spacing: -0.01em; border-top: 3px solid var(--tillex-yellow); flex: 1;
}
.woocommerce ul.products li.product-category .count {
  display: inline; background: none; color: var(--text-muted); font-weight: 500; font-size: 13px; margin-left: 6px;
}
/* A subcategory tile with no image still shows a clean panel */
.woocommerce ul.products li.product-category > a::before { content: none; }

/* ---- Single-product spacing + tabs cleanup (review round 2) ---- */
/* No duplicate "Additional information" heading below the tab */
.woocommerce div.product .woocommerce-Tabs-panel--additional_information > h2 { display: none; }
/* Tighten the gaps between summary / description / tabs / related */
.woocommerce div.product .woocommerce-tabs { margin-top: 28px; }
.woocommerce div.product .woocommerce-tabs .panel { margin-bottom: 0; }
.woocommerce .related.products, .woocommerce .upsells.products { margin-top: 40px; }
.woocommerce .related > h2, .woocommerce .upsells > h2 { margin-bottom: 20px; }
