/* Product variant dropdown: replace the operating-system select menu with a
 * contained, readable Select2 menu that belongs to the product card. */
#product .product-variants-item--enhanced {
  position: relative;
}

#product .product-variants-item--enhanced > .select2-container {
  display: block;
  transition: none !important;
}

/* Match variant fields to the quantity control's neutral Bootstrap border. */
#product .product-variants-item .custom-select,
#product .product-variants-item .select2-selection--single {
  border: 1px solid #ced4da !important;
}

#product .product-variants-item--enhanced .select2-selection--single:focus-visible {
  border-color: #243a58 !important;
  box-shadow: 0 0 0 3px rgba(36, 58, 88, 0.12) !important;
  outline: 0;
}

#product .product-variant-option--selection {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

#product .product-variant-option--selection .product-variant-option__title {
  flex: 0 0 auto;
  color: #171a1f;
  font-size: 15px;
  font-weight: 650;
}

#product .product-variant-option--selection .product-variant-option__summary {
  min-width: 0;
  overflow: hidden;
  color: #68717c;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
}

#product .product-variant-option--selection .product-variant-option__summary::before {
  content: "·";
  margin: 0 7px;
  color: #9ba2aa;
}

#product .product-variants-item--enhanced > .select2-container--open {
  z-index: 1200;
}

#product .product-variants-item--enhanced .select2-dropdown {
  right: 0;
  left: auto !important;
  width: min(440px, calc(100vw - 32px)) !important;
  min-width: 100%;
  margin-top: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9dde2;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(22, 34, 51, 0.16), 0 3px 10px rgba(22, 34, 51, 0.08);
  animation: bm-variant-dropdown-in 150ms ease-out;
}

#product .product-variants-item--enhanced .select2-results {
  padding: 6px;
}

#product .product-variants-item--enhanced .select2-results__options {
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #aeb5bd transparent;
  scrollbar-width: thin;
}

#product .product-variants-item--enhanced .select2-results__option {
  position: relative;
  margin: 2px 0;
  padding: 11px 42px 11px 12px;
  color: #252a31;
  background: transparent;
  border-radius: 8px;
  line-height: 1.35;
  white-space: normal;
  transition: background-color 120ms ease, color 120ms ease;
}

#product .product-variants-item--enhanced .select2-results__option--highlighted[aria-selected],
#product .product-variants-item--enhanced .select2-results__option:hover {
  color: #172b4d;
  background: #f1f4f7;
}

#product .product-variants-item--enhanced .select2-results__option[aria-selected="true"] {
  color: #18395f;
  background: #eaf1f8;
}

#product .product-variants-item--enhanced .select2-results__option[aria-selected="true"]::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 20px;
  height: 20px;
  color: #fff;
  background: #243a58;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  transform: translateY(-50%);
}

#product .product-variant-option--result {
  display: grid;
  gap: 2px;
}

#product .product-variant-option,
#product .product-variant-option > * {
  margin: 0 !important;
}

#product .product-variant-option--result .product-variant-option__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#product .product-variant-option--result .product-variant-option__description {
  color: #69727e;
  font-size: 13px;
  font-weight: 450;
  line-height: 1.4;
}

#product .product-variants-item--enhanced .select2-results__option--highlighted .product-variant-option__description,
#product .product-variants-item--enhanced .select2-results__option[aria-selected="true"] .product-variant-option__description {
  color: #536579;
}

@keyframes bm-variant-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* The wide header uses a 48px content gutter. Give the utility bar the same
 * inner edge instead of aligning it to the container's outer edge. */
@media (min-width: 1440px) {
  html body header#header .header-nav > .container,
  html body header#header .header-nav > .container.p-0 {
    box-sizing: border-box !important;
    padding-right: 48px !important;
    padding-left: 48px !important;
  }
}

/* When the product has no Stolebussen status, remove the empty first status
 * column. This keeps delivery, variants and quantity on one left edge. */
@media (min-width: 1350px) {
  #product .product-add-to-cart:not(:has(> .glance .stolebussen)) {
    grid-template-columns: minmax(0, 1fr);
  }

  #product .product-add-to-cart:not(:has(> .glance .stolebussen)) > .glance {
    display: none;
  }

  #product .product-add-to-cart:not(:has(> .glance .stolebussen)) .delivery-time {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #product .product-variants-item--enhanced .select2-dropdown {
    animation: none;
  }
}

/* Desktop mega menu: fast, intentional hover feedback without the previous
 * ~300 ms opening lag and ~500 ms closing tail. */
@media (min-width: 992px) and (hover: hover) {
  #bm-menu:not(.bm-vertical) > .bm-nav > .bm-item > a {
    transition: color 120ms ease, box-shadow 120ms ease;
  }

  #bm-menu:not(.bm-vertical) > .bm-nav > .bm-item > a:hover,
  #bm-menu:not(.bm-vertical) > .bm-nav > .bm-item.bm-hover-open > a,
  #bm-menu:not(.bm-vertical) > .bm-nav > .bm-item:focus-within > a {
    color: #243a58;
    box-shadow: inset 0 -2px 0 #243a58;
  }

  #bm-menu:not(.bm-vertical) > .bm-nav > .bm-item.has-dropdown > .bm-drop {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(5px);
    transition:
      opacity 130ms ease,
      transform 130ms ease,
      visibility 0s linear 130ms;
  }

  #bm-menu:not(.bm-vertical) > .bm-nav > .bm-item.has-dropdown.bm-hover-open > .bm-drop,
  #bm-menu:not(.bm-vertical) > .bm-nav > .bm-item.has-dropdown:focus-within > .bm-drop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }
}

/* Exhibition models use lifestyle/showroom photography. Let those photographs
 * fill their tiles; the standard 40px catalogue padding is only appropriate
 * for isolated packshots on a neutral background. */
.product-miniature:has(.product-miniature__title a[href*="/udstillingsmodeller/"]) .product-miniature__thumb {
  overflow: hidden;
  background: #f7f7f5;
}

.product-miniature:has(.product-miniature__title a[href*="/udstillingsmodeller/"]) .product-miniature__thumb img.img-fluid {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  object-fit: cover !important;
  mix-blend-mode: normal !important;
  transform: none !important;
}

/* Keep the fixed header the same height as its in-flow state. Bootstrap's
 * .mt-2 margin otherwise becomes part of the fixed box and creates a visible
 * 10px jump exactly when sticky mode starts. */
@media (min-width: 992px) {
  .header-top.sticky .header-top__row {
    margin-top: 0 !important;
  }

  .header-top.sticky {
    animation-duration: 260ms !important;
    animation-timing-function: cubic-bezier(.22, 1, .36, 1) !important;
    will-change: transform;
    box-shadow: 0 8px 24px rgba(18, 32, 49, .08);
  }
}

/* Category-description CTA used where Stolebussen should open as a modal rather
 * than rendering its complete form inline. */
#category-description .bm-category-stolebus-cta-wrap {
  margin: 18px 0 4px;
}

#category-description .bm-category-stolebus-cta {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 20px;
  border: 1px solid #223767;
  border-radius: 8px;
  background: #223767;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

#category-description .bm-category-stolebus-cta:hover,
#category-description .bm-category-stolebus-cta:focus-visible {
  border-color: #17294f;
  background: #17294f;
  color: #fff;
  box-shadow: 0 8px 20px rgba(34, 55, 103, .18);
  outline: 0;
  transform: translateY(-1px);
}

#category-description .bm-category-stolebus-cta span {
  font-size: 20px;
  line-height: 1;
  transition: transform 160ms ease;
}

#category-description .bm-category-stolebus-cta:hover span,
#category-description .bm-category-stolebus-cta:focus-visible span {
  transform: translateX(3px);
}

@media (max-width: 575.98px) {
  #category-description .bm-category-stolebus-cta {
    width: 100%;
  }
}

/* Give the Showrooms link list a little more room on wide screens. The extra
 * .row class raises specificity above the theme's original !important grid
 * definition while leaving its tablet and mobile layouts untouched. */
@media (min-width: 1200px) {
  html body footer#footer #footer-blocks > .row.row:first-of-type {
    grid-template-columns:
      minmax(260px, 305px)
      repeat(4, minmax(0, 1fr))
      minmax(152px, 1.2fr) !important;
    grid-template-areas:
      "a b c d f g"
      "e e e e e e" !important;
  }
}

/* Brand directory: compact, logo-first cards using the PS9 manufacturer image
 * presenter. This replaces the old 330px-tall Bootstrap cards without affecting
 * product listing cards on individual brand pages. */
.page-manufacturer .brands-page {
  padding-bottom: clamp(56px, 7vw, 96px);
}

.page-manufacturer .brands-page__header {
  max-width: 660px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.page-manufacturer .brands-page__title {
  margin: 0 0 10px;
  text-align: left !important;
}

.page-manufacturer .brands-page__intro {
  margin: 0;
  color: #5f6368;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
}

.page-manufacturer .brand-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px;
}

.page-manufacturer .brand-miniature {
  min-width: 0;
}

.page-manufacturer .brand-card {
  display: flex;
  height: 100%;
  min-height: 236px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dedfdc;
  border-radius: 12px;
  background: #fff;
  color: #171a1f;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.page-manufacturer .brand-card__media {
  display: grid;
  min-height: 164px;
  flex: 1 1 auto;
  place-items: center;
  padding: 26px;
  background: #f5f4f1;
}

.page-manufacturer .brand-card__media picture {
  display: contents;
}

.page-manufacturer .brand-card__logo {
  display: block;
  width: 100%;
  max-width: 210px;
  height: 108px;
  object-fit: contain;
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.page-manufacturer .brand-card__content {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid #e4e4e1;
}

.page-manufacturer .brand-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.page-manufacturer .brand-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.page-manufacturer .brand-card__count {
  color: #73777d;
  font-size: 13px;
  line-height: 1.3;
}

.page-manufacturer .brand-card__arrow {
  flex: 0 0 auto;
  color: #223767;
  font-size: 22px;
  line-height: 1;
  transition: transform 180ms ease;
}

.page-manufacturer .brand-card:hover,
.page-manufacturer .brand-card:focus-visible {
  border-color: #223767;
  color: #171a1f;
  box-shadow: 0 10px 26px rgba(26, 38, 64, .1);
  outline: 0;
  transform: translateY(-2px);
}

.page-manufacturer .brand-card:hover .brand-card__logo,
.page-manufacturer .brand-card:focus-visible .brand-card__logo {
  transform: scale(1.035);
}

.page-manufacturer .brand-card:hover .brand-card__arrow,
.page-manufacturer .brand-card:focus-visible .brand-card__arrow {
  transform: translateX(3px);
}

@media (max-width: 1199.98px) {
  .page-manufacturer .brand-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767.98px) {
  .page-manufacturer .brands-page__header {
    margin-bottom: 24px;
  }

  .page-manufacturer .brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
  }

  .page-manufacturer .brand-card {
    min-height: 194px;
    border-radius: 10px;
  }

  .page-manufacturer .brand-card__media {
    min-height: 120px;
    padding: 18px;
  }

  .page-manufacturer .brand-card__logo {
    height: 82px;
  }

  .page-manufacturer .brand-card__content {
    min-height: 72px;
    align-items: flex-start;
    padding: 12px;
  }

  .page-manufacturer .brand-card__title {
    font-size: 14px;
  }

  .page-manufacturer .brand-card__arrow {
    margin-top: 1px;
    font-size: 19px;
  }
}

/* Product gallery navigation. The existing Swiper setup already expects these
 * controls; keep them compact and clearly visible over light and dark photos. */
#product .js-product-main-images .product-gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(31, 38, 48, .18);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 18px rgba(18, 29, 45, .14);
  color: #17294f;
  cursor: pointer;
  opacity: 1;
  transform: translateY(-50%);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

#product .js-product-main-images .product-gallery__nav--prev {
  right: auto;
  left: 18px;
}

#product .js-product-main-images .product-gallery__nav--next {
  right: 18px;
  left: auto;
}

#product .js-product-main-images .product-gallery__nav::after {
  display: none;
  content: none;
}

#product .js-product-main-images .product-gallery__nav svg {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

#product .js-product-main-images .product-gallery__nav:hover,
#product .js-product-main-images .product-gallery__nav:focus-visible {
  border-color: #223767;
  background: #fff;
  box-shadow: 0 7px 22px rgba(18, 29, 45, .2);
  outline: 0;
}

#product .js-product-main-images .product-gallery__nav.swiper-button-disabled {
  opacity: .32;
  pointer-events: none;
}

@media (max-width: 767.98px) {
  #product .js-product-main-images .product-gallery__nav {
    width: 40px;
    height: 40px;
  }

  #product .js-product-main-images .product-gallery__nav--prev {
    left: 12px;
  }

  #product .js-product-main-images .product-gallery__nav--next {
    right: 12px;
  }

  #product .js-product-main-images .product-gallery__nav svg {
    width: 20px;
    height: 20px;
  }
}

/* Legacy product Select2 appends its open menu directly below <body>. Keep
 * large combination lists compact, readable and internally scrollable. */
body#product > .select2-container--open { z-index: 2500 !important; }
body#product > .select2-container--open .select2-dropdown {
  box-sizing:border-box;overflow:hidden;background:#fff;border:1px solid #ced4da;
  border-radius:8px;box-shadow:0 10px 28px rgba(23,30,41,.12);
}
body#product > .select2-container--open .select2-search--dropdown { display:none; }
body#product > .select2-container--open .select2-results { padding:6px; }
body#product > .select2-container--open .select2-results__options[id^="select2-group_"] {
  max-height:min(320px,calc(100dvh - 220px));overflow-y:auto;overscroll-behavior:contain;
  scrollbar-color:#adb3ba transparent;scrollbar-width:thin;
}
body#product > .select2-container--open .select2-results__option {
  position:relative;margin:0;padding:10px 38px 10px 12px;color:#202020;background:#fff;
  border-radius:6px;font-size:15px;font-weight:400;line-height:1.35;white-space:normal;
}
body#product > .select2-container--open .select2-results__option--highlighted[aria-selected],
body#product > .select2-container--open .select2-results__option:hover { color:#202020;background:#f6f6f4; }
body#product > .select2-container--open .select2-results__option[aria-selected="true"] {
  color:#202020;background:#f0efeb;font-weight:600;
}
body#product > .select2-container--open .select2-results__option[aria-selected="true"]::after {
  content:"✓";position:absolute;top:50%;right:13px;color:#243a58;font-size:14px;
  font-weight:700;transform:translateY(-50%);
}

/* The brand already appears next to the product title. Avoid rendering the
 * duplicate manufacturer description/logo (and its fixed-height whitespace). */
body#product #product-description .product-expanded .manufacturer { display:none !important; }

@media (max-width:575px) {
  body.bm-compare-open .bm-compare-bar {
    z-index:1000000 !important;left:8px !important;right:8px !important;
    bottom:max(8px,env(safe-area-inset-bottom)) !important;width:auto !important;
    max-height:calc(100dvh - 16px);overflow:hidden;
  }
  body.bm-compare-open .bm-compare-bar__items { min-height:48px;overflow-x:auto;overflow-y:hidden; }
  body.bm-compare-open .bm-compare-bar__cta { min-height:44px;line-height:1.2; }
}

@media (max-width:575px) {
  body#product > .select2-container--open .select2-results__options[id^="select2-group_"] {
    max-height:min(260px,calc(100dvh - 270px));
  }
}
