/*
 * Herbadrug UI — shared brand-page structures
 * FTP: /user/documents/upload/herbadrug-ui/css/brand-pages.css
 * All rules are scoped to the custom hd- namespace and JS-enabled brand pages.
 */

.hd-brand {
  --hd-brand-ink: #17202a;
  --hd-brand-paper: #f7f7f5;
  --hd-brand-surface: #ffffff;
  --hd-brand-accent: #425466;
  --hd-brand-muted: #65717e;
  --hd-brand-line: rgba(23, 32, 42, 0.16);
  --hd-brand-on-dark: #ffffff;
  --hd-brand-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hd-brand-display: var(--hd-brand-font);
  color: var(--hd-brand-ink);
  font-family: var(--hd-brand-font);
}

.hd-brand:empty {
  display: none;
}

body.hd-brand-page .manufacturerDetail > .category-title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hd-brand-top,
.hd-brand-bottom {
  width: 100%;
  color: var(--hd-brand-ink);
  font-family: var(--hd-brand-font);
}

.hd-brand-top {
  margin-block: 0 var(--hd-space-lg);
}

.hd-brand-bottom {
  margin-block: var(--hd-space-xl) 0;
}

.hd-brand-section {
  position: relative;
  padding-block: var(--hd-space-xl);
}

.hd-brand-section__heading {
  max-width: 16ch;
  margin: 0;
  font-family: var(--hd-brand-display);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hd-brand-section__intro {
  max-width: 60ch;
  margin: var(--hd-space-sm) 0 0;
  color: var(--hd-brand-muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.hd-brand-hero {
  display: grid;
  min-height: clamp(29rem, 48vw, 36rem);
  overflow: hidden;
  background: var(--hd-brand-ink);
  color: var(--hd-brand-on-dark);
}

.hd-brand-hero__content {
  position: relative;
  z-index: var(--hd-z-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: clamp(2rem, 4vw, 4rem);
}

.hd-brand-hero__logo {
  width: min(11rem, 45vw);
  margin-block-end: clamp(1.5rem, 3vw, 2.75rem);
}

.hd-brand-hero__title {
  max-width: 11ch;
  margin: var(--hd-space-sm) 0 0;
  font-family: var(--hd-brand-display);
  color: var(--hd-brand-on-dark);
  font-size: clamp(2.5rem, 4.6vw, 4.75rem);
  font-weight: 650;
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.hd-brand-hero__lead {
  max-width: 35rem;
  margin: var(--hd-space-md) 0 0;
  font-size: clamp(1rem, 1.45vw, 1.1875rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.hd-brand-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: var(--hd-space-md);
}

.hd-brand-hero__media {
  position: relative;
  min-height: 24rem;
  overflow: hidden;
}

.hd-brand-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hd-brand-nav__header {
  display: grid;
  align-items: end;
  gap: var(--hd-space-md);
  margin-block-end: var(--hd-space-lg);
}

.hd-brand-nav__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.8vw, 1.5rem);
}

.hd-brand-nav-card {
  position: relative;
  grid-column: span 4;
  min-height: 24rem;
  overflow: hidden;
  background: var(--hd-brand-ink);
  color: var(--hd-brand-on-dark);
  isolation: isolate;
}

.hd-brand-nav-card__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  transition: transform 600ms var(--hd-ease);
}

.hd-brand-nav-card::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, transparent 35%, rgba(5, 12, 20, 0.82) 100%);
  pointer-events: none;
}

.hd-brand-nav-card__body {
  display: flex;
  min-height: inherit;
  align-items: flex-start;
  justify-content: flex-end;
  flex-direction: column;
  padding: clamp(1.25rem, 2vw, 2rem);
}

.hd-brand-nav-card__title {
  margin: 0;
  color: inherit;
  font-family: var(--hd-brand-display);
  font-size: clamp(1.625rem, 2.7vw, 2.75rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.035em;
}

.hd-brand-nav-card__link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin-block-start: 0.75rem;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.hd-brand-nav-card__link::after {
  margin-inline-start: 0.5rem;
  content: "→";
  transition: transform var(--hd-motion-fast) ease;
}

.hd-brand-nav-card:hover .hd-brand-nav-card__image {
  transform: scale(1.035);
}

.hd-brand-nav-card:hover .hd-brand-nav-card__link::after {
  transform: translateX(0.25rem);
}

.hd-brand-feature,
.hd-brand-story {
  display: grid;
  overflow: hidden;
  background: var(--hd-brand-surface);
}

.hd-brand-feature__media,
.hd-brand-story__media {
  min-height: clamp(24rem, 46vw, 38rem);
}

.hd-brand-feature__media img,
.hd-brand-story__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hd-brand-feature__content,
.hd-brand-story__content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: clamp(2rem, 5vw, 5rem);
}

.hd-brand-feature__title,
.hd-brand-story__title {
  max-width: 12ch;
  margin: var(--hd-space-sm) 0 0;
  color: inherit;
  font-family: var(--hd-brand-display);
  font-size: clamp(2.25rem, 5vw, 5rem);
  font-weight: 650;
  line-height: 0.96;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.hd-brand-feature__copy,
.hd-brand-story__copy {
  max-width: 58ch;
  margin: var(--hd-space-md) 0 0;
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  line-height: 1.7;
  text-wrap: pretty;
}

.hd-brand-feature__content .hd-button,
.hd-brand-story__content .hd-button {
  margin-block-start: var(--hd-space-md);
}

.hd-product-intro {
  display: grid;
  align-items: end;
  gap: var(--hd-space-md);
  padding-block: clamp(2rem, 4vw, 4rem) var(--hd-space-md);
  border-bottom: 1px solid var(--hd-brand-line);
}

.hd-product-intro__title {
  margin: 0;
  color: var(--hd-brand-ink);
  font-family: var(--hd-brand-display);
  font-size: clamp(2.25rem, 5vw, 4.75rem);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hd-product-intro__meta {
  margin: 0;
  color: var(--hd-brand-muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.hd-brand-facts {
  display: grid;
  border-block: 1px solid var(--hd-brand-line);
}

.hd-brand-fact {
  padding: var(--hd-space-md) 0;
}

.hd-brand-fact + .hd-brand-fact {
  border-top: 1px solid var(--hd-brand-line);
}

.hd-brand-fact__label {
  display: block;
  color: var(--hd-brand-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hd-brand-fact__value {
  display: block;
  margin-block-start: 0.5rem;
  font-family: var(--hd-brand-display);
  font-size: clamp(1.375rem, 2.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.hd-brand-faq__list {
  margin-block-start: var(--hd-space-lg);
  border-top: 1px solid var(--hd-brand-line);
}

.hd-brand-faq__item {
  display: grid;
  gap: var(--hd-space-sm);
  padding-block: var(--hd-space-md);
  border-bottom: 1px solid var(--hd-brand-line);
}

.hd-brand-faq__question {
  margin: 0;
  color: var(--hd-brand-ink);
  font-family: var(--hd-brand-display);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.hd-brand-faq__answer {
  max-width: 62ch;
  margin: 0;
  color: var(--hd-brand-muted);
  line-height: 1.65;
}

@media (min-width: 48rem) {
  .hd-brand-hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .hd-brand-nav__header,
  .hd-product-intro {
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  }

  .hd-brand-nav__header > :last-child,
  .hd-product-intro > :last-child {
    justify-self: end;
  }

  .hd-brand-feature,
  .hd-brand-story {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hd-brand-story__media {
    order: 2;
  }

  .hd-brand-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hd-brand-fact {
    padding: var(--hd-space-md);
  }

  .hd-brand-fact:first-child {
    padding-inline-start: 0;
  }

  .hd-brand-fact + .hd-brand-fact {
    border-top: 0;
    border-left: 1px solid var(--hd-brand-line);
  }

  .hd-brand-faq__item {
    grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.2fr);
    gap: var(--hd-space-lg);
  }
}

@media (min-width: 64rem) {
  .hd-brand-nav-card:first-child,
  .hd-brand-nav-card:nth-child(2) {
    grid-column: span 6;
    min-height: 31rem;
  }
}

@media (max-width: 63.99rem) {
  .hd-brand-nav-card {
    grid-column: span 6;
  }
}

@media (max-width: 47.99rem) {
  .hd-brand-top {
    margin-block-end: var(--hd-space-md);
  }

  .hd-brand-hero {
    min-height: auto;
  }

  .hd-brand-hero__content {
    min-height: 25rem;
  }

  .hd-brand-hero__media {
    min-height: 17rem;
    max-height: 23rem;
  }

  .hd-brand-hero__logo {
    margin-block-end: var(--hd-space-lg);
  }

  .hd-brand-hero__actions {
    width: 100%;
  }

  .hd-brand-hero__actions .hd-button {
    flex: 1 1 11rem;
  }

  .hd-brand-nav__grid {
    display: flex;
    width: calc(100% + var(--hd-page-gutter));
    gap: 0.75rem;
    margin-inline-end: calc(var(--hd-page-gutter) * -1);
    padding-inline-end: var(--hd-page-gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .hd-brand-nav__grid::-webkit-scrollbar {
    display: none;
  }

  .hd-brand-nav-card {
    flex: 0 0 min(82vw, 21rem);
    min-height: 27rem;
    scroll-snap-align: start;
  }

  .hd-brand-feature__media,
  .hd-brand-story__media {
    min-height: 21rem;
  }

  .hd-brand-feature__content,
  .hd-brand-story__content {
    min-height: 26rem;
  }

  .hd-product-intro {
    padding-block-start: var(--hd-space-lg);
  }
}
