/* ==========================================================================
   bm_homecategories — messe cards
   Base card design lives in the theme (occ-custom.css, .occ-messe-card).
   This file layers section header, grid layout, deadline badge and
   polish on top, and is self-contained enough to stand without the theme.
   ========================================================================== */

.bm-homecategories {
  margin-bottom: 2.5rem;
}

/* Visually hidden, still read by screen readers */
.bm-homecategories .bm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Section header
   -------------------------------------------------------------------------- */

.bm-homecategories__header {
  margin-bottom: 1.5rem;
}

.bm-homecategories__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.25rem;
}

.bm-homecategories__subtitle {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 0;
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   Card base — list = image on the left (horizontal); grid = image on top
   -------------------------------------------------------------------------- */

.bm-homecategories .occ-messe-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.bm-homecategories .occ-messe-card:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
  border-color: #d4d4d4;
  transform: translateY(-3px);
}

/* Right-hand column: body stacked above the action buttons */
.bm-homecategories .occ-messe-card__content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

/* Inspiration image (default vertical sizing; list overrides to a left column) */
.bm-homecategories .occ-messe-card__image {
  display: block;
  position: relative;
  width: 100%;
  height: 190px;
  margin: 0;
  overflow: hidden;
  background: #eef1f4;
  /* Vertical/grid: round only the top corners (image sits on top) */
  border-radius: 14px 14px 0 0;
}

.bm-homecategories .occ-messe-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.bm-homecategories .occ-messe-card:hover .occ-messe-card__image img {
  transform: scale(1.05);
}

/* Gradient shade so overlays stay legible over busy images */
.bm-homecategories .occ-messe-card__image-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.12) 28%, rgba(0, 0, 0, 0) 55%);
}

/* Fair-dates badge on the banner */
.bm-homecategories .occ-messe-card__date-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.62rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  background: rgba(17, 24, 39, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.bm-homecategories .occ-messe-card__date-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Messe logo overlaid bottom-left on the banner */
.bm-homecategories .occ-messe-card__logo {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 50%;
  padding: 7px 11px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.bm-homecategories .occ-messe-card__logo img {
  display: block;
  max-height: 52px;
  max-width: 100%;
  width: auto;
  transition: none;
}

/* Card carrying only a logo (no inspiration/category image) — keeps the
   layout's image height; just centres the logo on a neutral background */
.bm-homecategories .occ-messe-card__image--logo-only {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f8;
}

.bm-homecategories .occ-messe-card__image--logo-only .occ-messe-card__logo {
  position: static;
  max-width: 70%;
  background: transparent;
  box-shadow: none;
}

.bm-homecategories .occ-messe-card__image--logo-only .occ-messe-card__logo img {
  max-height: 96px;
}

/* Body + actions get their own padding now the card itself has none */
.bm-homecategories .occ-messe-card__body {
  padding: 1.1rem 1.25rem 0.5rem;
}

.bm-homecategories .occ-messe-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.bm-homecategories .occ-messe-card__title-link {
  color: inherit;
  text-decoration: none;
}

.bm-homecategories .occ-messe-card__title-link:hover {
  color: #000;
  text-decoration: underline;
}

.bm-homecategories .occ-messe-card__description {
  font-size: 1rem;
  color: #6c757d;
  line-height: 1.55;
  margin: 0.5rem 0 0;
}

.bm-homecategories .occ-messe-card__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem 1.25rem;
  margin-top: auto;
}

/* flex-basis: 0 makes buttons share the row regardless of the theme's
   width:100% (flex-basis overrides width for flex sizing), so they sit
   next to each other instead of stacking. */
.bm-homecategories .occ-messe-card__actions .occ-messe-card__btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  text-align: center;
}

/* "Vigtig information" button */
/* "Vigtig information" + "Udstillerguide" share the same light-grey style */
.bm-homecategories .occ-messe-card__btn--info,
.bm-homecategories .occ-messe-card__btn--outline {
  background: #e3e3e3;
  color: #333;
  border: none;
  cursor: pointer;
}

.bm-homecategories .occ-messe-card__btn--info:hover,
.bm-homecategories .occ-messe-card__btn--outline:hover {
  background: #d6d6d6;
  color: #333;
}

/* Fair dates (body fallback shown when the card has no banner) */
.bm-homecategories .occ-messe-card__dates {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #344054;
  background: #f1f4f8;
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  margin: 0.6rem 0 0;
}

.bm-homecategories .occ-messe-card__dates-label {
  color: #6c757d;
}

.bm-homecategories .occ-messe-card__dates .occ-messe-card__date-icon {
  color: #6c757d;
  opacity: 1;
}

/* Customer's stand info (address custom fields), shown under the dates */
.bm-homecategories .occ-messe-card__standinfo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem 1rem;
  margin: 0.6rem 0 0;
  padding: 0.7rem 0.9rem;
  background: #f6f8fa;
  border-radius: 8px;
}

.bm-homecategories .occ-messe-card__standinfo-row {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bm-homecategories .occ-messe-card__standinfo-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #8a939b;
  margin: 0 0 0.1rem;
}

.bm-homecategories .occ-messe-card__standinfo-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #344054;
  margin: 0;
  word-break: break-word;
}

/* Deadline */

.bm-homecategories .occ-messe-card__deadline {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: #212529;
  background: #fff8e6;
  border: 1px solid #f0e2b6;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  margin: 0.25rem 0 0;
}

.bm-homecategories .occ-messe-card__deadline-label {
  font-weight: 700;
}

.bm-homecategories .occ-messe-card__deadline-note {
  font-weight: 500;
  color: #8a6d1a;
}

/* "Opbygget stand" info box — shown only to a logged-in customer who has a
   built stand at this messe */
.bm-homecategories .occ-messe-card__opbygget {
  margin: 0.6rem 0 0;
  padding: 0.7rem 0.9rem;
  background: #f0f7f1;
  border: 1px solid #cfe6d4;
  border-left: 3px solid #4a9d63;
  border-radius: 8px;
}

.bm-homecategories .occ-messe-card__opbygget-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2f6b43;
  margin-bottom: 0.35rem;
}

.bm-homecategories .occ-messe-card__opbygget-body {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #344054;
}

/* Rich-text (WYSIWYG) content: restore list/paragraph spacing the theme may reset */
.rte-content p {
  margin: 0 0 0.6rem;
}

.rte-content p:last-child {
  margin-bottom: 0;
}

.rte-content ul,
.rte-content ol {
  margin: 0 0 0.6rem;
  padding-left: 1.4rem;
}

.rte-content ul {
  list-style: disc;
}

.rte-content ol {
  list-style: decimal;
}

.rte-content li {
  margin-bottom: 0.25rem;
}

/* Buttons: focus state for keyboard users */

.bm-homecategories .occ-messe-card__btn:focus-visible {
  outline: 2px solid #212529;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Must-have products — standalone section (homepage below cards + category page)
   Unprefixed so it also styles correctly outside .bm-homecategories.
   -------------------------------------------------------------------------- */

.bm-musthave-section {
  margin: 2.5rem 0;
  padding: 1.25rem 1.5rem 1.5rem;
  background: #F0F0F0;
  border-radius: 14px;
}

.bm-musthave-section__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4a4a4a;
  margin: 0 0 1rem;
}

.bm-musthave-section__viewport {
  position: relative;
}

.bm-musthave-section__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bm-musthave-section__item {
  min-width: 0;
}

.bm-musthave-section__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  padding: 0.85rem;
  text-decoration: none;
  color: #1d2733;
  background: #fff;
  border: 1px solid #e5e8ec;
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.bm-musthave-section__link:hover {
  border-color: #d4d4d4;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.bm-musthave-section__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f6f8fa;
  border-radius: 8px;
}

.bm-musthave-section__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bm-musthave-section__name {
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bm-musthave-section__price {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}

/* Slider variant (7+ products) */
.bm-musthave-section--slider .bm-musthave-section__list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.bm-musthave-section--slider .bm-musthave-section__item {
  flex: 0 0 170px;
  scroll-snap-align: start;
}

.bm-musthave-section__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  color: #1d2733;
  background: #fff;
  border: 1px solid #e0e3e8;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.bm-musthave-section__nav:hover {
  background: #f2f4f6;
}

.bm-musthave-section__nav--prev {
  left: -8px;
}

.bm-musthave-section__nav--next {
  right: -8px;
}

@media (max-width: 767px) {
  .bm-musthave-section__list {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .bm-musthave-section--slider .bm-musthave-section__item {
    flex: 0 0 45%;
  }

  .bm-musthave-section__nav {
    display: none; /* native swipe on touch screens */
  }
}

/* --------------------------------------------------------------------------
   List layout — horizontal cards: image on the left, content on the right
   -------------------------------------------------------------------------- */

.bm-homecategories--list .occ-messe-card {
  flex-direction: row;
  margin-bottom: 1.25rem;
}

.bm-homecategories--list .occ-messe-card__image {
  /* Fluid: caps at 370px on wide screens, shrinks on narrower ones */
  flex: 0 0 clamp(240px, 34%, 370px);
  width: clamp(240px, 34%, 370px);
  height: auto;          /* stretches to the card's content height */
  min-height: 210px;
  /* Horizontal: round only the left corners — right side stays square,
     flush against the content column */
  border-radius: 14px 0 0 14px;
}

/* --------------------------------------------------------------------------
   Grid layout — compact vertical cards (image on top) in a responsive grid
   -------------------------------------------------------------------------- */

.bm-homecategories--grid .bm-homecategories__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.bm-homecategories--grid .occ-messe-card {
  height: 100%;
}

.bm-homecategories--grid .occ-messe-card__image {
  height: 180px;
}

/* --------------------------------------------------------------------------
   Responsive — stack list cards (image back on top) on small screens
   -------------------------------------------------------------------------- */

/* Tablet & below: stack the horizontal list cards (image on top, full width) */
@media (max-width: 991px) {
  .bm-homecategories--list .occ-messe-card {
    flex-direction: column;
  }

  .bm-homecategories--list .occ-messe-card__image {
    flex: 0 0 auto;
    width: 100%;
    height: 220px;
    min-height: 0;
    border-radius: 14px 14px 0 0;
  }

  .bm-homecategories__title {
    font-size: 1.35rem;
  }
}

/* Small phones: "Gå til messeshop" on its own full-width row, then
   Udstillerguide + Vigtig information side by side on the next row. */
@media (max-width: 575px) {
  .bm-homecategories .occ-messe-card__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .bm-homecategories .occ-messe-card__actions > .occ-messe-card__btn:first-child {
    flex: 0 0 100%;
    width: 100%;
  }

  .bm-homecategories .occ-messe-card__btn--outline,
  .bm-homecategories .occ-messe-card__btn--info {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bm-homecategories .occ-messe-card,
  .bm-homecategories .occ-messe-card__image img {
    transition: none;
  }

  .bm-homecategories .occ-messe-card:hover {
    transform: none;
  }

  .bm-homecategories .occ-messe-card:hover .occ-messe-card__image img {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   "Vigtig information" modal
   -------------------------------------------------------------------------- */

body.bm-info-modal-open {
  overflow: hidden;
}

.bm-homecategories .occ-messe-info-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bm-homecategories .occ-messe-info-modal[hidden] {
  display: none;
}

.bm-homecategories .occ-messe-info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.bm-homecategories .occ-messe-info-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.bm-homecategories .occ-messe-info-modal__close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
}

.bm-homecategories .occ-messe-info-modal__close:hover {
  color: #111;
}

.bm-homecategories .occ-messe-info-modal__title {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.bm-homecategories .occ-messe-info-modal__body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #344054;
}

.bm-homecategories .occ-messe-standplaner-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bm-homecategories .occ-messe-standplaner-list li {
  margin: 0;
  border-bottom: 1px solid #eaecf0;
}

.bm-homecategories .occ-messe-standplaner-list li:last-child {
  border-bottom: 0;
}

.bm-homecategories .occ-messe-standplaner-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.2rem;
  font-size: 0.95rem;
  color: #1d4ed8;
  text-decoration: none;
}

.bm-homecategories .occ-messe-standplaner-list a:hover {
  text-decoration: underline;
}

.bm-homecategories .occ-messe-standplaner-list__icon {
  font-size: 1.1rem;
}
