/* Product category archive — phase 1 listing (Værktøj, Tilbehør and sub-categories).
   Full-bleed beige hero; toolbar and product grid constrained and centred. */

.sp-category-archive {
  --sp-ca-max-width: var(--bs-desktop-section-max-width, 1200px);
  --sp-ca-gutter: 1.25rem;
  --sp-gd-gutter: 2rem;
}

/* Make Astra's container full-width on category pages so our hero spans edge to
   edge and our own max-width controls the content width. The direct-child + body
   selector outranks Astra's inline `.ast-woo-shop-archive .site-content >
   .ast-container { max-width: 1406px }` rule. */
body.tax-product_cat .site-content > .ast-container {
  display: block; /* Astra makes this a flexbox (content + sidebar); we have neither */
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Hero (beige band) — fills the now full-width container edge to edge. */
.sp-category-archive-hero {
  padding: 2.5rem 0;
  background: var(--bs-color-base-10, #f5f0e3);
}

/* Hero inner and body share the same max-width and horizontal padding so the
   title lines up exactly with the toolbar/grid below it. */
.sp-category-archive-hero-inner,
.sp-category-archive-body {
  max-width: var(--sp-ca-max-width);
  margin-left: auto;
  margin-right: auto;
}

.sp-category-archive-hero-inner {
  padding-left: var(--sp-ca-gutter);
  padding-right: var(--sp-ca-gutter);
}

.sp-category-archive-body {
  padding: 1.5rem var(--sp-ca-gutter) 3rem;
}

.sp-category-archive-title {
  margin: 0 0 0.75rem;
  font-family: var(--bs-font-header, inherit);
  font-size: 2.25rem;
  text-transform: uppercase;
  color: var(--bs-color-base-100, #453f2e);
}

.sp-category-archive-description {
  color: var(--bs-color-base-100, #453f2e);
}

.sp-category-archive-description p {
  margin: 0 0 0.75rem;
}

.sp-category-archive-description p:last-child {
  margin-bottom: 0;
}

/* Desktop: flow the single category description into two columns to approximate
   the design's two-text-block layout (we only have one description field). The
   first (bold) line acts as the subtitle. */
@media (min-width: 768px) {
  .sp-category-archive-description {
    columns: 2;
    column-gap: 3rem;
  }
}

/* Mobile: collapse the description behind a "Læs mere" toggle (shown by JS only
   when the text actually overflows). */
.sp-category-archive-readmore {
  display: none;
  margin-top: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--bs-color-base-100, #453f2e);
  text-decoration: underline;
  cursor: pointer;
}

.sp-category-archive-readmore.is-visible {
  display: inline-block;
}

@media (max-width: 767px) {
  .sp-category-archive-description:not(.is-expanded) {
    max-height: 8em;
    overflow: hidden;
  }
}

/* Toolbar: breadcrumb + count + sort */
.sp-category-archive-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 100;
}

.sp-category-archive-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

.sp-category-archive-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.sp-category-archive-breadcrumb a:hover {
  text-decoration: underline;
}

/* The separator is a "value" in the design — dark and bold against the light
   breadcrumb text. */
.sp-category-archive-breadcrumb-sep {
  font-weight: 700;
  color: var(--bs-color-base-100, #453f2e);
}

.sp-category-archive-count {
  margin: 0;

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

/* Bold the number explicitly — the toolbar's light weight (100) would otherwise
   dilute <strong> to ~400 via the CSS `bolder` mapping. */
.sp-category-archive-count strong {
  font-weight: 700;

  font-family: var(--bs-font-roboto-bold);
  font-weight: var(--bs-font-roboto-bold-weight);
}

.sp-category-archive-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.sp-category-archive-sort-label {
  white-space: nowrap;

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

/* Custom disclosure dropdown (replaces the native <select>). Built on
   <details>/<summary> so it still toggles without JS. */
.sp-category-archive-sort-dropdown {
  position: relative;

  font-family: var(--bs-font-roboto-bold);
  font-weight: var(--bs-font-roboto-bold-weight);
}

.sp-category-archive-sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-weight: 700;
  color: var(--bs-color-base-100, #453f2e);
  white-space: nowrap;
  cursor: pointer;
  list-style: none; /* hide default disclosure marker (Firefox) */
}

.sp-category-archive-sort-trigger::-webkit-details-marker {
  display: none; /* hide default disclosure marker (WebKit) */
}

.sp-category-archive-sort-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.sp-category-archive-sort-dropdown[open] .sp-category-archive-sort-chevron {
  transform: translateY(1px) rotate(-135deg);
}

.sp-category-archive-sort-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 10;
  min-width: 12rem;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--bs-color-base-00, #fff);
  border: 0;
  border-radius: 0;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.sp-category-archive-sort-option {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 3px;
  color: var(--bs-color-base-100, #453f2e);
  text-decoration: none;
  white-space: nowrap;

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

.sp-category-archive-sort-option:hover {
  background: var(--bs-color-base-10, #f5f0e3);
}

.sp-category-archive-sort-option.is-selected {
  font-weight: 700;
  border-color: var(--bs-color-base-20, #ded9cd);
  border-left-color: var(--bs-color-action-30, #90a539);

  font-family: var(--bs-font-roboto-bold);
  font-weight: var(--bs-font-roboto-bold-weight);
}

/* Desktop: breadcrumb left, count centred, sort right. */
@media (min-width: 768px) {
  .sp-category-archive-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem 1.5rem;
  }

  .sp-category-archive-breadcrumb {
    justify-self: start;
  }

  .sp-category-archive-count {
    justify-self: center;
    text-align: center;
  }

  .sp-category-archive-sort {
    justify-self: end;
    margin-left: 0;
  }
}

/* Grid — single column on mobile (matches the design), three on desktop. */
.sp-category-archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-gd-gutter);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .sp-category-archive-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card */
.sp-product-card {
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  background: var(--bs-color-base-00, #fff);
  overflow: hidden;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.sp-product-card-link {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 1.25rem 1.25rem 0.75rem;
  color: inherit;
  text-decoration: none;
}

.sp-product-card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bs-color-base-100, #453f2e);

  font-family: var(--bs-font-alexandria);
}

.sp-product-card-subtitle {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  color: var(--bs-color-base-40, #b6a78b);

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

/* Global CSS forces a large bottom margin on the first <h2> (e.g.
   `h2:first-of-type { margin: 0 0 2rem }`). This higher-specificity selector
   overrides it so the subtitle sits right under the title, per the design. */
.sp-product-card-head .sp-product-card-title {
  margin-bottom: 0.2rem;
}

.sp-product-card-image {
  margin: 1rem 0;
  text-align: center;
}

.sp-product-card-image img {
  max-width: 100%;
  height: auto;
}

.sp-product-card-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: #f5c518;
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
  color: var(--bs-color-base-100, #453f2e);

  font-family: var(--bs-font-roboto-bold);
  font-weight: var(--bs-font-roboto-bold-weight);
}

/* Price row: variant properties on the left, price on the right. Pinned to the
   bottom of the card link via margin-top: auto; contents aligned to the top of
   the row so the price sits level with the first property line. */
.sp-product-card-priceline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.sp-product-card-attributes {
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--bs-color-base-100, #453f2e);

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

.sp-product-card-price {
  flex: 0 0 auto;
  /* Tight line-height so the price glyph top lines up with the first property
     line; the default (~1.5) leaves extra leading above the number. */
  line-height: 1;
  text-align: right;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bs-color-base-100, #453f2e);
}
/* 
.sp-product-card-price .woocommerce-Price-amount.amount {
  font-family: var(--bs-font-alexandria);
} */

.sp-product-card-price del {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--bs-color-base-40, #b6a78b);

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

.sp-product-card-price ins {
  text-decoration: none;

  font-family: var(--bs-font-alexandria);
}

/* Meta row sits outside the card link: stock left, "Se film" right. */
.sp-product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
}

.sp-product-card-video {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  /* Padding gives the hover/focus ring breathing room; the negative margin
     keeps the icon + text visually in place. Pill radius for a fully-rounded ring. */
  margin: -0.3rem -0.4rem;
  padding: 0.3rem 0.4rem;
  border: none;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--bs-color-base-100, #453f2e);
  cursor: pointer;
}

.sp-product-card-video-icon {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
}

.sp-product-card-video-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sp-product-card-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;

  font-family: var(--bs-font-roboto-light);
  font-weight: var(--bs-font-roboto-light-weight);
}

.sp-product-card-stock--in {
  color: var(--bs-color-action-30, #90a539);
}

.sp-product-card-stock--out {
  color: var(--bs-color-base-40, #b6a78b);
}

.sp-product-card-stock-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--bs-color-action-30, #90a539);
}

.sp-product-card-stock-check {
  display: block;
  width: 100%;
  height: 100%;
}

.sp-category-archive-empty {
  padding: 2rem 0;
}

/* "Se film" video lightbox */
.sp-category-archive-video-modal {
  width: min(900px, 92vw);
  max-width: 92vw;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: #000;
  overflow: visible;
}

.sp-category-archive-video-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.sp-category-archive-video-modal-iframe {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.sp-category-archive-video-modal-iframe iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sp-category-archive-video-modal-close {
  position: absolute;
  top: -2.25rem;
  right: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
