/*
Theme Name: _v3
Theme URI: https://sleepie.dk/
Author: Sleepie.dk
Description: Conversion-focused affiliate theme for Sleepie.dk — tykfyr-affiliate, soft Scandinavian sleep aesthetic, no WooCommerce.
Version: 3.0.0
Requires PHP: 8.1
Text Domain: sleepie-v3
License: GNU General Public License v2 or later
*/

:root {
  --sl-color-bg: #f4f2f8;
  --sl-color-bg-alt: #ebe6f2;
  --sl-color-surface: #ffffff;
  --sl-color-surface-muted: #faf8fc;
  --sl-color-night: #1e2a44;
  --sl-color-night-soft: #2d3d5c;
  --sl-color-lavender: #9b8cb8;
  --sl-color-lavender-dim: #c4b8d9;
  --sl-color-beige: #e8dfd4;
  --sl-color-cloud: #d8d6de;
  --sl-color-text: #25223a;
  --sl-color-text-muted: #5c5670;
  --sl-color-text-soft: #7a748c;
  --sl-color-accent: #4a6fa5;
  --sl-color-accent-hover: #3d5d8c;
  --sl-color-cta: #c26b5e;
  --sl-color-cta-hover: #a8594d;
  --sl-color-success: #3d7c6b;
  --sl-color-deal: #b85c4a;
  --sl-focus: #4a90d9;
  --sl-radius-sm: 8px;
  --sl-radius-md: 14px;
  --sl-radius-lg: 22px;
  --sl-space-xs: 0.35rem;
  --sl-space-sm: 0.65rem;
  --sl-space-md: 1rem;
  --sl-space-lg: 1.5rem;
  --sl-space-xl: 2.25rem;
  --sl-space-2xl: 3.5rem;
  --sl-font-display: "Fraunces", "Georgia", serif;
  --sl-font-body: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --sl-shadow-sm: 0 2px 8px rgba(30, 42, 68, 0.06);
  --sl-shadow-md: 0 8px 28px rgba(30, 42, 68, 0.08);
  --sl-shadow-lg: 0 18px 48px rgba(30, 42, 68, 0.1);
  --sl-max-readable: 42rem;
  --sl-max-content: 1180px;
  --sl-header-h: 4.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--sl-font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--sl-color-text);
  background: var(--sl-color-bg);
  -webkit-font-smoothing: antialiased;
}

h1 {
  line-height: normal;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--sl-color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--sl-color-accent-hover);
}

a.brandLink {
  font-weight: 600;
  text-decoration: none;
  color: var(--sl-color-night-soft);
}
a.brandLink:hover {
  color: var(--sl-color-accent);
}

:focus-visible {
  outline: 2px solid var(--sl-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100000;
  padding: var(--sl-space-sm) var(--sl-space-lg);
  background: var(--sl-color-surface);
  color: var(--sl-color-night);
  font-weight: 600;
  border-radius: var(--sl-radius-sm);
  box-shadow: var(--sl-shadow-md);
}
.skip-link:focus {
  left: var(--sl-space-md);
  top: var(--sl-space-md);
}

/* Layout */
.sl-container {
  width: 100%;
  max-width: var(--sl-max-content);
  margin-inline: auto;
  padding-inline: var(--sl-space-lg);
}
.sl-container--narrow {
  max-width: 800px;
}

.site-main {
  min-height: 50vh;
  padding-block: var(--sl-space-xl);
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .site-main,
  .site-footer {
    transition: filter 0.22s ease;
  }
}
@media (min-width: 900px) {
  body:has(.has-mega:hover) .site-main,
  body:has(.has-mega:focus-within) .site-main,
  body:has(.has-mega:hover) .site-footer,
  body:has(.has-mega:focus-within) .site-footer {
    filter: blur(10px);
    pointer-events: none;
  }
}
@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
  body:has(.has-mega:hover) .site-main,
  body:has(.has-mega:focus-within) .site-main,
  body:has(.has-mega:hover) .site-footer,
  body:has(.has-mega:focus-within) .site-footer {
    filter: none;
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: #2b2843;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sl-space-lg);
  min-height: var(--sl-header-h);
}
@media (min-width: 900px) {
  .header-inner {
    align-items: stretch;
  }
}
.site-brand {
  display: flex;
  align-items: center;
  gap: var(--sl-space-sm);
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--sl-font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.site-brand img {
  height: 2.25rem;
  width: auto;
}
.site-brand__text {
  display: none;
}
@media (min-width: 480px) {
  .site-brand__text {
    display: inline;
  }
}

/* Nav */
.nav-primary-wrap {
  display: none;
}
@media (min-width: 900px) {
  .nav-primary-wrap {
    display: flex;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
  }
}
.nav-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}
.nav-primary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-primary > li {
  position: relative;
}
.nav-primary > li > a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: var(--sl-radius-sm);
}
.nav-primary > li > a:hover,
.nav-primary > li > a:focus-visible,
.nav-primary > li.current-menu-item > a {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
@media (min-width: 900px) {
  .nav-cluster {
    align-items: stretch;
  }
  .nav-primary {
    align-items: stretch;
  }
  .nav-primary > li {
    display: flex;
    align-items: center;
  }
}

/* Mega menu */
.has-mega > a::after {
  content: "";
  display: inline-block;
  width: 0.35em;
  height: 0.35em;
  margin-left: 0.35em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  vertical-align: 0.15em;
  opacity: 0.5;
}
.mega-panel {
  display: none;
  position: absolute;
  left: 0;
  transform: none;
  top: 100%;
  z-index: 910;
  box-sizing: border-box;
  /* JS sets pixel width (documentElement.clientWidth); avoid 100vw — it ignores scrollbar and causes horizontal scroll */
  width: 100%;
  max-width: none;
  padding: 0;
  background: var(--sl-color-surface);
  border-radius: 0 0 var(--sl-radius-md) var(--sl-radius-md);
  box-shadow: var(--sl-shadow-lg);
  border: 1px solid rgba(30, 42, 68, 0.06);
  border-top: 0;
}
.mega-panel__inner {
  padding-block: var(--sl-space-md);
  padding-top: calc(var(--sl-space-md) + 0.35rem);
}
.has-mega:hover > .mega-panel,
.has-mega:focus-within > .mega-panel {
  display: grid;
}
.mega-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: var(--sl-space-sm) var(--sl-space-md);
}
.mega-col h3,
.mega-col__title {
  margin: 0 0 var(--sl-space-sm);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sl-color-text-soft);
  font-family: var(--sl-font-body);
}
.mega-col__title a {
  color: inherit;
  text-decoration: none;
}
.mega-col__title a:hover {
  color: var(--sl-color-accent);
}
.mega-col ul,
.mega-col__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mega-col a,
.mega-col__list a {
  display: block;
  padding: 0.28rem 0;
  color: var(--sl-color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.mega-col a:hover,
.mega-col__list a:hover {
  color: var(--sl-color-accent);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: auto;
  border: 0;
  border-radius: var(--sl-radius-sm);
  background: var(--sl-color-surface);
  color: var(--sl-color-night);
  cursor: pointer;
  box-shadow: var(--sl-shadow-sm);
}
.site-header .menu-toggle {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}
.site-header .menu-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}
@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }
}
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}
.mobile-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}
.mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 42, 68, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mobile-drawer.is-open .mobile-drawer__backdrop {
  opacity: 1;
}
.mobile-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, 400px);
  height: 100%;
  background: var(--sl-color-surface);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: var(--sl-space-lg);
  box-shadow: var(--sl-shadow-lg);
}
.mobile-drawer.is-open .mobile-drawer__panel {
  transform: translateX(0);
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-nav a {
  display: block;
  padding: 0.65rem 0;
  color: var(--sl-color-night);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 42, 68, 0.06);
}
.mobile-nav .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.5rem 0.85rem;
  border-left: 2px solid rgba(30, 42, 68, 0.1);
}
.mobile-nav .sub-menu a {
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: none;
  padding: 0.4rem 0;
  color: var(--sl-color-text-muted);
}
.mobile-nav .sub-menu a:hover {
  color: var(--sl-color-accent);
}

/* Breadcrumbs */
.breadcrumb-wrapper {
  margin-bottom: var(--sl-space-lg);
  font-size: 0.875rem;
  color: var(--sl-color-text-muted);
}
.breadcrumb-wrapper a {
  color: var(--sl-color-text-muted);
}
.breadcrumb-wrapper a:hover {
  color: var(--sl-color-accent);
}
.breadcrumb-wrapper .wpseo-breadcrumb {
  margin: 0;
}

/* Buttons */
.sl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.65rem 1.25rem;
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.sl-btn--primary {
  background: var(--sl-color-cta);
  color: #fff;
  box-shadow: 0 4px 14px rgba(194, 107, 94, 0.35);
}
.sl-btn--primary:hover {
  background: var(--sl-color-cta-hover);
  color: #fff;
  transform: translateY(-1px);
}
.sl-btn--secondary {
  background: var(--sl-color-night);
  color: #fff;
}
.sl-btn--secondary:hover {
  background: var(--sl-color-night-soft);
  color: #fff;
}
.sl-btn--ghost {
  background: transparent;
  border: 2px solid rgba(30, 42, 68, 0.15);
  color: var(--sl-color-night);
}
.sl-btn--ghost:hover {
  border-color: var(--sl-color-lavender);
  background: rgba(155, 140, 184, 0.08);
  color: var(--sl-color-night);
}
.sl-btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

/* Badges & pills */
.sl-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sl-badge--deal {
  background: rgba(184, 92, 74, 0.12);
  color: var(--sl-color-deal);
}
.sl-badge--shipping {
  background: rgba(61, 124, 107, 0.14);
  color: var(--sl-color-success);
}
.sl-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--sl-color-surface);
  border: 1px solid rgba(30, 42, 68, 0.08);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sl-color-night-soft);
  text-decoration: none;
  box-shadow: var(--sl-shadow-sm);
}
.sl-pill:hover {
  border-color: var(--sl-color-lavender-dim);
  color: var(--sl-color-night);
}
.sl-pill.is-active {
  background: rgba(74, 111, 165, 0.12);
  border-color: var(--sl-color-accent);
  color: var(--sl-color-accent-hover);
}

/* Cards */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--sl-color-surface);
  border-radius: var(--sl-radius-md);
  overflow: hidden;
  border: 1px solid rgba(30, 42, 68, 0.06);
  box-shadow: var(--sl-shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover {
  box-shadow: var(--sl-shadow-md);
  transform: translateY(-2px);
}
.product-card__media {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--sl-color-surface-muted);
}
.product-card__media a {
  display: block;
  height: 100%;
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-card__badges {
  position: absolute;
  top: var(--sl-space-sm);
  left: var(--sl-space-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.product-card__body {
  padding: var(--sl-space-md);
  display: flex;
  flex-direction: column;
  gap: var(--sl-space-sm);
  flex: 1;
}
.product-card__title {
  margin: 0;
  font-family: var(--sl-font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}
.product-card__title a {
  color: var(--sl-color-text);
  text-decoration: none;
}
.product-card__title a:hover {
  color: var(--sl-color-accent);
}
.product-card__meta {
  font-size: 0.8125rem;
  color: var(--sl-color-text-soft);
}
.product-card__excerpt {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--sl-color-text-soft);
}
.product-card__rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--sl-color-text-muted);
}
.stars {
  color: #c9a227;
  letter-spacing: 0.05em;
}
.product-card__price {
  margin-top: auto;
  font-family: var(--sl-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--sl-color-night);
}
.product-card__price s {
  font-size: 0.85em;
  color: var(--sl-color-text-soft);
  font-weight: 500;
  margin-right: 0.35rem;
}
.product-card__actions .sl-btn {
  width: 100%;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sl-space-lg);
}

/* [products] shortcode — plugin adds .row.products-loop-row */
.products-loop-row,
.row.products-loop-row {
  display: grid;
  gap: var(--sl-space-lg);
  grid-template-columns: 1fr;
  margin: 0; /* avoid Bootstrap .row negative margins if present */
}

@media (min-width: 640px) {
  .products-loop-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-loop-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.products-loop-row .product-grid {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.products-loop-row .wp-block-buttons {
  grid-column: 1 / -1;
  max-width: 28rem;
  margin-inline: auto;
  text-align: center;
}

/* Guides/posts: use fr tracks + container size (not viewport) so 3 cols fit the ~42rem column */
.entry-content .products-loop-row,
.entry-content .row.products-loop-row {
  display: grid !important;
  gap: var(--sl-space-lg);
  margin: 0;
  grid-template-columns: 1fr;
}

/* Viewport fallback (no container queries); overridden below when supported */
@media (min-width: 640px) {
  .entry-content .products-loop-row,
  .entry-content .row.products-loop-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .entry-content .products-loop-row,
  .entry-content .row.products-loop-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@container sl-entry (min-width: 26rem) {
  .entry-content .products-loop-row,
  .entry-content .row.products-loop-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@container sl-entry (min-width: 36rem) {
  .entry-content .products-loop-row,
  .entry-content .row.products-loop-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Archive: shortcode row is only a marker; cards slot into .products-grid */
.products-grid > .products-loop-row {
  display: contents;
}

/* Archive toolbar */
.archive-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sl-space-md);
  margin-bottom: var(--sl-space-lg);
  padding: var(--sl-space-md);
  background: var(--sl-color-surface);
  border-radius: var(--sl-radius-md);
  border: 1px solid rgba(30, 42, 68, 0.06);
}
.archive-toolbar__group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sl-color-text-soft);
  margin-bottom: 0.35rem;
}
.sort-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sort-list a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--sl-color-text-muted);
  background: var(--sl-color-surface-muted);
}
.sort-list a:hover,
.sort-list a.is-active {
  background: rgba(74, 111, 165, 0.15);
  color: var(--sl-color-night);
}

.archive-count {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--sl-color-text-muted);
}

/* Chips row */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--sl-space-md) 0 var(--sl-space-lg);
}

/* Typography — pages & posts */
.page-header h1,
.archive-header h1 {
  font-family: var(--sl-font-body);
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: bold;
  color: var(--sl-color-night);
  margin: 0 0 var(--sl-space-sm);
  letter-spacing: -0.02em;
}
.archive-intro,
.term-description {
  color: var(--sl-color-text-muted);
  max-width: 65ch;
}
.term-description p:first-child {
  margin-top: 0;
}

/* Collapsible product category intro (long term descriptions) */
.term-description-collapsible {
  margin-bottom: var(--sl-space-sm);
}
.term-description-collapsible__clip {
  position: relative;
  transition: max-height 0.35s ease;
}
.term-description-collapsible__clip.is-collapsed {
  max-height: 11rem;
  overflow: hidden;
}
.term-description-collapsible__clip.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.25rem;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(244, 242, 248, 0),
    var(--sl-color-bg) 85%
  );
}
.term-description-collapsible__toggle {
  margin-top: var(--sl-space-sm);
}

.entry-content {
  max-width: var(--sl-max-content);
  container-type: inline-size;
  container-name: sl-entry;
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: var(--sl-font-display);
  color: var(--sl-color-night);
  margin-top: var(--sl-space-xl);
}
.entry-content ul,
.entry-content ol {
  padding-left: 1.25em;
}
.entry-content blockquote {
  margin: var(--sl-space-lg) 0;
  padding: var(--sl-space-md) var(--sl-space-lg);
  border-left: 4px solid var(--sl-color-lavender-dim);
  background: var(--sl-color-surface-muted);
  border-radius: 0 var(--sl-radius-sm) var(--sl-radius-sm) 0;
  font-style: italic;
  color: var(--sl-color-text-muted);
}

/* Yoast FAQ block (.schema-faq.wp-block-yoast-faq-block) — answers visible; no accordion JS in this theme */
.schema-faq.wp-block-yoast-faq-block,
.schema-faq {
  margin: var(--sl-space-xl) 0;
  padding: var(--sl-space-lg);
  background: var(--sl-color-surface);
  border: 1px solid rgba(30, 42, 68, 0.08);
  border-radius: var(--sl-radius-md);
  box-shadow: var(--sl-shadow-sm);
}

.schema-faq-section {
  padding: var(--sl-space-md) 0;
  margin: 0;
  border-bottom: 1px solid rgba(30, 42, 68, 0.08);
}

.schema-faq-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.schema-faq-section:first-child {
  padding-top: 0;
}

.schema-faq-section .schema-faq-question {
  display: block;
  font-family: var(--sl-font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sl-color-night);
  margin: 0 0 var(--sl-space-sm);
  line-height: 1.35;
}

.schema-faq-section .schema-faq-answer {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--sl-color-text-muted);
}

.schema-faq-section .schema-faq-answer > *:first-child {
  margin-top: 0;
}

.schema-faq-section .schema-faq-answer > *:last-child {
  margin-bottom: 0;
}

/* Single product — mobile: visual order via flex + display:contents; desktop: two columns */
.single-product-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sl-space-xl);
}
@media (max-width: 959px) {
  .single-product-stack-left,
  .single-product-stack-right {
    display: contents;
  }
  .single-product-gallery {
    order: 1;
  }
  .single-product-summary-lead {
    order: 2;
  }
  .single-product-stack-left .spec-table {
    order: 3;
  }
  .single-product-summary {
    order: 4;
  }
}
@media (min-width: 960px) {
  .single-product-wrap {
    flex-direction: row;
    align-items: flex-start;
  }
  .single-product-stack-left,
  .single-product-stack-right {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: var(--sl-space-lg);
  }
  .single-product-stack-left {
    position: sticky;
    top: calc(var(--sl-header-h) + var(--sl-space-md));
    align-self: flex-start;
  }
}
.single-product-summary-lead {
  text-align: left;
}
.single-product-stack-left .spec-table {
  margin-top: 0;
}
.single-product-gallery {
  background: var(--sl-color-surface);
  border-radius: var(--sl-radius-lg);
  padding: var(--sl-space-lg);
  border: 1px solid rgba(30, 42, 68, 0.06);
  box-shadow: var(--sl-shadow-md);
  text-align: center;
}
.single-product-gallery__media {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}
.single-product-gallery__link {
  display: block;
}
.single-product-gallery__badges {
  z-index: 2;
}
.single-product-gallery img {
  max-height: 420px;
  width: auto;
  margin-inline: auto;
}
.single-product-gallery__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sl-space-md);
  background: rgba(30, 42, 68, 0.48);
  border-radius: var(--sl-radius-md);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.single-product-gallery__overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.single-product-gallery__more-btn {
  box-shadow: var(--sl-shadow-md);
}
@media (prefers-reduced-motion: reduce) {
  .single-product-gallery__overlay {
    transition: none;
  }
}
.single-product-summary .price-block,
.single-product-summary-lead .price-block {
  font-family: var(--sl-font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sl-color-night);
  margin: var(--sl-space-md) 0;
}
.single-product-summary .price-block s,
.single-product-summary-lead .price-block s {
  font-size: 0.55em;
  color: var(--sl-color-text-soft);
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: var(--sl-space-lg);
}
.spec-table th,
.spec-table td {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(30, 42, 68, 0.08);
  text-align: left;
}
.spec-table th {
  width: 38%;
  color: var(--sl-color-text-soft);
  font-weight: 600;
}

/* Trust blocks */
.trust-panel {
  padding: var(--sl-space-lg);
  border-radius: var(--sl-radius-md);
  background: linear-gradient(135deg, rgba(155, 140, 184, 0.1), rgba(232, 223, 212, 0.35));
  border: 1px solid rgba(30, 42, 68, 0.06);
  margin-top: var(--sl-space-lg);
}
.trust-panel h3 {
  margin-top: 0;
  font-family: var(--sl-font-display);
  color: var(--sl-color-night);
}

/* Single post: body + TOC (TOC right on desktop) */
.single-post__split {
  display: flex;
  flex-direction: column;
  gap: var(--sl-space-xl);
  margin-bottom: var(--sl-space-lg);
}
.single-post__body {
  min-width: 0;
}
@media (min-width: 960px) {
  .single-post__split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11rem, 17.5rem);
    gap: var(--sl-space-xl);
    align-items: start;
  }
  .single-post__split .post-toc {
    margin-bottom: 0;
    position: sticky;
    top: calc(var(--sl-header-h) + var(--sl-space-md));
    max-height: calc(100vh - var(--sl-header-h) - var(--sl-space-xl));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Single post: table of contents */
.post-toc {
  padding: var(--sl-space-lg);
  border-radius: var(--sl-radius-md);
  background: var(--sl-color-surface);
  border: 1px solid rgba(30, 42, 68, 0.08);
  margin-bottom: 0;
  box-shadow: 0 4px 20px rgba(30, 42, 68, 0.06);
}
.post-toc__title {
  margin: 0 0 var(--sl-space-md);
  font-family: var(--sl-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--sl-color-night);
}
.post-toc__list {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: var(--sl-space-xs);
  font-family: var(--sl-font-body);
  font-size: 0.95rem;
  line-height: 1.35;
}
.post-toc__item a {
  color: var(--sl-color-accent);
  text-decoration: none;
  font-weight: 500;
}
.post-toc__item a:hover {
  color: var(--sl-color-accent-hover);
  text-decoration: underline;
}
.post-toc__item--depth3 {
  list-style-type: circle;
  margin-left: var(--sl-space-md);
}
.post-toc__item--depth4 {
  list-style-type: square;
  margin-left: var(--sl-space-xl);
}

body.single-post .entry-content h2,
body.single-post .entry-content h3,
body.single-post .entry-content h4 {
  scroll-margin-top: calc(var(--sl-header-h) + var(--sl-space-md));
}
.trust-disclosure {
  font-size: 0.875rem;
  color: var(--sl-color-text-muted);
  padding: var(--sl-space-md);
  background: var(--sl-color-surface-muted);
  border-radius: var(--sl-radius-sm);
  margin-top: var(--sl-space-md);
}

.product-buy-group {
  position: relative;
  display: inline-block;
}
/* Invisible hover bridge so the pointer can reach the tooltip without flicker */
.product-buy-group::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.75rem;
  z-index: 19;
}
.trust-disclosure.trust-disclosure--buy-hover {
  position: absolute;
  left: 0;
  top: calc(100% + 0.75rem);
  margin-top: 0;
  min-width: 14rem;
  max-width: min(22rem, calc(100vw - 2rem));
  z-index: 20;
  box-shadow: var(--sl-shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.25rem);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.product-buy-group:hover .trust-disclosure--buy-hover,
.product-buy-group:focus-within .trust-disclosure--buy-hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Single product: sticky buy bar on small screens */
@media (max-width: 959px) {
  body.single-products {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }
  body.single-products:has(.mobile-drawer.is-open) {
    padding-bottom: 0;
  }
  body.single-products .single-product-summary .product-buy-group {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 950;
    display: block;
    margin: 0 !important;
    padding: var(--sl-space-md) var(--sl-space-lg)
      calc(var(--sl-space-md) + env(safe-area-inset-bottom, 0px));
    background: var(--sl-color-surface);
    border-top: 1px solid rgba(30, 42, 68, 0.08);
    box-shadow: 0 -8px 28px rgba(30, 42, 68, 0.08);
  }
  body.single-products:has(.mobile-drawer.is-open) .single-product-summary .product-buy-group {
    visibility: hidden;
    pointer-events: none;
  }
  body.single-products .single-product-summary .product-buy-group::after {
    display: none;
  }
  body.single-products .single-product-summary .product-buy {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  body.single-products .single-product-summary .trust-disclosure.trust-disclosure--buy-hover {
    display: none;
  }
}

/* Section blocks (front page) */
.home-hero {
  padding: var(--sl-space-2xl) 0;
  background: linear-gradient(160deg, var(--sl-color-bg) 0%, #e4dde8 45%, var(--sl-color-beige) 100%);
  border-radius: 0 0 var(--sl-radius-lg) var(--sl-radius-lg);
  margin-bottom: var(--sl-space-2xl);
}
.home-hero__inner {
  display: grid;
  gap: var(--sl-space-xl);
  align-items: center;
}
@media (min-width: 880px) {
  .home-hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
.home-hero h1 {
  font-family: var(--sl-font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--sl-color-night);
  margin: 0 0 var(--sl-space-md);
  letter-spacing: -0.03em;
}
.home-hero p.lead {
  font-size: 1.15rem;
  color: var(--sl-color-text-muted);
  max-width: 42ch;
  margin: 0 0 var(--sl-space-lg);
}
.home-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sl-space-sm);
}
.home-hero__visual {
  border-radius: var(--sl-radius-lg);
  background: var(--sl-color-surface);
  padding: var(--sl-space-xl);
  box-shadow: var(--sl-shadow-lg);
  border: 1px solid rgba(30, 42, 68, 0.05);
  text-align: center;
  color: var(--sl-color-text-muted);
  font-size: 0.95rem;
}

.section-heading {
  margin-bottom: var(--sl-space-lg);
}
.section-heading__title {
  font-family: var(--sl-font-display);
  font-size: 1.75rem;
  margin: 0 0 var(--sl-space-xs);
  color: var(--sl-color-night);
}
.section-heading__subtitle {
  margin: 0;
  color: var(--sl-color-text-muted);
  max-width: 52ch;
}

.use-case-grid {
  display: grid;
  gap: var(--sl-space-md);
}
@media (min-width: 720px) {
  .use-case-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.use-case-card {
  padding: var(--sl-space-lg);
  background: var(--sl-color-surface);
  border-radius: var(--sl-radius-md);
  box-shadow: var(--sl-shadow-sm);
  border: 1px solid rgba(30, 42, 68, 0.06);
}
.use-case-card h3 {
  margin-top: 0;
  font-family: var(--sl-font-display);
  font-size: 1.15rem;
}

.guide-card {
  display: block;
  padding: var(--sl-space-lg);
  background: var(--sl-color-surface);
  border-radius: var(--sl-radius-md);
  border: 1px solid rgba(30, 42, 68, 0.06);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sl-shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}
.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sl-shadow-md);
}
.guide-card h3 {
  margin: 0 0 var(--sl-space-sm);
  font-family: var(--sl-font-display);
  font-size: 1.2rem;
  color: var(--sl-color-night);
}
.guide-card p {
  margin: 0;
  color: var(--sl-color-text-muted);
  font-size: 0.95rem;
}

.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Guides / blog CTA (mørk bånd på forsiden, single m.fl.) */
.cta-guides {
  margin: var(--sl-space-2xl) 0;
  padding: var(--sl-space-xl);
  background: var(--sl-color-night);
  color: #e8eaf0;
  border-radius: var(--sl-radius-lg);
  text-align: center;
}
.cta-guides h2 {
  font-family: var(--sl-font-display);
  margin-top: 0;
  color: #fff;
}
.cta-guides p {
  max-width: 46ch;
  margin-inline: auto;
  opacity: 0.9;
}
.cta-guides .sl-btn--primary {
  background: #fff;
  color: var(--sl-color-night);
  box-shadow: none;
}
.cta-guides .sl-btn--primary:hover {
  background: var(--sl-color-beige);
  color: var(--sl-color-night);
}

/* Pagination — the_posts_pagination (nav > .nav-links) & paginate_links list (ul.page-numbers) */
.navigation.pagination {
  margin-top: var(--sl-space-xl);
  width: 100%;
}

.pagination-nav {
  margin-top: var(--sl-space-xl);
  width: 100%;
}

.pagination-nav > .navigation.pagination {
  margin-top: 0;
}

.navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

/* paginate_links( …, 'type' => 'list' ): ul must be a flex row, not a “pill” */
.pagination-nav ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination-nav ul.page-numbers li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
}

.navigation.pagination .nav-links a.page-numbers,
.navigation.pagination .nav-links span.page-numbers,
.pagination-nav a.page-numbers,
.pagination-nav span.page-numbers {
  display: inline-flex;
  min-width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.45rem;
  box-sizing: border-box;
  border-radius: var(--sl-radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  background: var(--sl-color-surface);
  color: var(--sl-color-night);
  border: 1px solid rgba(30, 42, 68, 0.1);
  box-shadow: var(--sl-shadow-sm);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.navigation.pagination .nav-links a.page-numbers:hover,
.navigation.pagination .nav-links a.page-numbers:focus-visible,
.pagination-nav a.page-numbers:hover,
.pagination-nav a.page-numbers:focus-visible {
  background: rgba(155, 140, 184, 0.14);
  border-color: rgba(30, 42, 68, 0.14);
  color: var(--sl-color-night);
  outline: none;
}

.navigation.pagination .nav-links a.page-numbers:focus-visible,
.pagination-nav a.page-numbers:focus-visible {
  box-shadow: 0 0 0 2px var(--sl-color-surface), 0 0 0 4px rgba(74, 111, 165, 0.35);
}

.navigation.pagination .nav-links span.page-numbers.current,
.navigation.pagination .nav-links a.page-numbers.current,
.pagination-nav span.page-numbers.current,
.pagination-nav a.page-numbers.current {
  background: var(--sl-color-accent);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sl-shadow-sm);
}

.navigation.pagination .nav-links span.page-numbers.dots,
.pagination-nav span.page-numbers.dots {
  min-width: auto;
  height: auto;
  min-height: 2.5rem;
  padding: 0.25rem 0.35rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--sl-color-text-soft);
  font-weight: 500;
  cursor: default;
}

/* Footer */
.site-footer {
  margin-top: var(--sl-space-2xl);
  padding: var(--sl-space-2xl) 0 var(--sl-space-xl);
  background: var(--sl-color-night);
  color: #c8c9d4;
  font-size: 0.95rem;
}
.site-footer a {
  color: #e0e2ea;
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
}
.footer-grid {
  display: grid;
  gap: var(--sl-space-xl);
}
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.2fr repeat(3, 1fr);
  }
}
.footer-grid h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--sl-space-sm);
  color: #9fa3b8;
}
.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-grid li {
  margin-bottom: 0.45rem;
}
.footer-bottom {
  margin-top: var(--sl-space-xl);
  padding-top: var(--sl-space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.875rem;
  text-align: center;
  color: #8b90a8;
}

/* 404 & search */
.simple-hero {
  text-align: center;
  padding: var(--sl-space-2xl) 0;
}

/* Dimension list (sizes) */
.dimension-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sl-space-lg);
}
.dimension-list li.active .sl-pill {
  background: rgba(74, 111, 165, 0.15);
  border-color: var(--sl-color-accent);
}

/* Utilities */
.mt-0 { margin-top: 0; }
.mb-lg { margin-bottom: var(--sl-space-lg); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

