/* Keep catalog images inside frames with a definite size at every breakpoint. */
body.theme-dark {
  --catalog-surface: #151c29;
  --catalog-edge: #2e3a4b;
  --catalog-ink: #f3eee7;
  --catalog-muted: #c4c5cc;
  --catalog-accent: #edd0a5;
  --catalog-media: #f5f2ec;
  --catalog-media-edge: #e5dfd4;
}

html[data-theme="light"] body.theme-dark {
  --catalog-surface: #fff;
  --catalog-edge: #ddd6c9;
  --catalog-ink: #1d2633;
  --catalog-muted: #535d6a;
  --catalog-accent: #684719;
}

body.theme-dark[data-page="home"] .hero.premium-hero {
  min-height: 0;
  padding: clamp(30px, 5.5vw, 78px) 0;
  background: radial-gradient(ellipse at 14% 20%, #33445e 0%, transparent 50%), #101b2d;
}

body.theme-dark[data-page="home"] .premium-hero .hero-bg-gradient {
  background: linear-gradient(100deg, #1b304c44, #0c1629e8);
}

body.theme-dark[data-page="home"] .premium-hero .hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 5vw, 78px);
  min-height: 0;
  padding: 0;
  text-align: start;
}

body.theme-dark[data-page="home"] .premium-hero .hero-title {
  font-size: clamp(1.65rem, 3.7vw, 3.6rem);
  line-height: 1.36;
  letter-spacing: normal;
  margin-block: 0 .45em;
}

body.theme-dark[data-page="home"] .premium-hero .hero-subtitle {
  max-inline-size: 56ch;
  font-size: clamp(.88rem, 1.5vw, 1.05rem);
  line-height: 1.85;
  margin-block: 0 1.1rem;
}

body.theme-dark[data-page="home"] .premium-hero .hero-ctas {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  max-width: none;
  gap: 10px;
  margin: 16px 0 0;
}

body.theme-dark[data-page="home"] .premium-hero .hero-ctas .button {
  width: auto;
  min-height: 44px;
  padding: .55rem .85rem;
  font-size: .85rem;
}

body.theme-dark[data-page="home"] .premium-hero .hero-scroll {
  display: none;
}

body.theme-dark[data-page="home"] .bo-hero-feature {
  position: static;
  inset: auto;
  display: block;
  justify-self: center;
  width: min(100%, 430px);
  height: auto;
  max-height: none;
  margin: 0;
  opacity: 1;
  padding: clamp(8px, 1.3vw, 16px);
  border: 1px solid #e8cda54d;
  border-radius: 20px;
  background: #1b2c45;
}

body.theme-dark[data-page="home"] .bo-hero-feature .bo-hero-photo {
  aspect-ratio: 4 / 3;
  border-radius: 13px;
}

body.theme-dark[data-page="home"] .bo-hero-feature figcaption {
  display: block;
  color: #f7e7d2;
  background: transparent;
  text-align: center;
  border: 0;
  padding: 7px 0 0;
  margin: 0;
  font-size: .84rem;
  overflow-wrap: anywhere;
}

body.theme-dark[data-page="home"] .intro-band {
  background: var(--catalog-surface);
  border-color: var(--catalog-edge);
}

.catalog-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
  gap: 10px;
  padding-block: 14px;
}

.catalog-shortcuts a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid var(--catalog-edge);
  border-radius: 10px;
  color: var(--catalog-ink);
  font-size: .85rem;
  font-weight: 700;
}

.catalog-shortcuts a:hover {
  border-color: var(--catalog-accent);
}

body.theme-dark .categories-grid .category-card,
body.theme-dark .categories-grid .category-card.category-more {
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  min-width: 0;
  padding: 9px 9px 3px;
  text-align: start;
  background: var(--catalog-surface);
  border-color: var(--catalog-edge);
  box-shadow: 0 5px 18px #0002;
}

body.theme-dark .categories-grid .category-top {
  position: static;
  order: 1;
  justify-content: flex-start;
  min-height: 24px;
  margin: 6px 3px 0;
}

body.theme-dark .categories-grid .category-count {
  color: var(--catalog-muted);
  background: transparent;
  border: 0;
  padding: 0;
  font-size: .72rem;
}

body.theme-dark .categories-grid .category-arrow {
  display: none;
}

body.theme-dark .categories-grid .category-card .category-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
  padding: 0;
  margin: 0;
  border: 1px solid #e5dfd433;
  border-radius: 10px;
  background: #283b54 !important;
}

body.theme-dark .categories-grid .category-card .category-illustration.bo-has-product-photo {
  background: var(--catalog-media) !important;
  border-color: var(--catalog-media-edge);
}

body.theme-dark .categories-grid .category-illustration::before {
  display: none;
}

body.theme-dark .categories-grid .category-illustration svg {
  width: 48%;
  height: 58%;
}

body.theme-dark .categories-grid .category-card h3 {
  order: 2;
  color: var(--catalog-ink);
  margin: 1px 3px 5px;
  font-size: clamp(.86rem, 1.45vw, 1.12rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.theme-dark .categories-grid .category-card p {
  order: 3;
  color: var(--catalog-muted);
  margin: 0 3px 8px;
  font-size: .76rem;
}

body.theme-dark .categories-grid .category-card > a {
  order: 4;
  min-height: 44px;
  align-items: center;
  margin: auto 3px 0 !important;
  padding: 4px 0 !important;
  justify-content: flex-start !important;
  color: var(--catalog-accent) !important;
  border-color: var(--catalog-edge);
}

body.theme-dark .category-directory > *,
body.theme-dark .catalog-tools,
body.theme-dark .catalog-category-groups {
  border-color: var(--catalog-edge);
}

body.theme-dark[data-page="catalog"] .catalog-tools {
  margin-block: 0 14px;
}

body.theme-dark .catalog-tools input,
body.theme-dark .catalog-tools select,
body.theme-dark .pipe-filters select {
  min-height: 44px;
  max-width: 100%;
}

body.theme-dark .product-grid > *,
body.theme-dark .product-details > * {
  min-width: 0;
}

body.theme-dark .shop-card {
  background: var(--catalog-surface);
  border-color: var(--catalog-edge);
}

body.theme-dark .shop-card-media,
body.theme-dark .product-photo,
body.theme-dark .product-thumbnail,
.bo-hero-photo {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
  background: var(--catalog-media);
}

body.theme-dark .shop-card-media {
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--catalog-media-edge);
}

body.theme-dark .product-photo,
body.theme-dark .product-photo.has-placeholder-photo {
  aspect-ratio: 1;
  min-height: 0;
  max-height: min(70vh, 36rem);
  border-color: var(--catalog-media-edge);
}

body.theme-dark .product-thumbnail {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

body.theme-dark .categories-grid .category-illustration img.bo-category-product-photo,
body.theme-dark[data-page="home"] .bo-hero-feature .bo-hero-photo img,
body.theme-dark .shop-card-media img,
body.theme-dark .product-photo img,
body.theme-dark .product-thumbnail img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  padding: clamp(6px, 1.35vw, 16px) !important;
  object-fit: contain;
  object-position: center;
  transform: none !important;
  filter: none;
}

body.theme-dark .product-photo img {
  padding: clamp(10px, 2.2vw, 26px) !important;
}

body.theme-dark .product-thumbnail img {
  padding: 4px !important;
}

body.theme-dark .has-placeholder-photo img.product-placeholder-art {
  padding-block-end: clamp(27px, 3vw, 38px) !important;
}

body.theme-dark .product-thumbnail .product-placeholder-label {
  display: none;
}

body.theme-dark .shop-card-content .brandline {
  color: var(--catalog-accent);
  overflow-wrap: anywhere;
}

body.theme-dark .shop-card h3,
body.theme-dark .shop-card p,
body.theme-dark .shop-card-category {
  overflow-wrap: anywhere;
}

body.theme-dark .shop-card h3 {
  color: var(--catalog-ink);
  font-size: clamp(.85rem, 1.15vw, 1rem);
  line-height: 1.6;
}

body.theme-dark .shop-card p,
body.theme-dark .shop-card-category {
  color: var(--catalog-muted);
}

body.theme-dark .shop-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

body.theme-dark .shop-card-actions :is(.button, .details-link),
body.theme-dark .product-image-link {
  min-height: 44px;
}

.product-image-link {
  display: inline-flex;
  align-items: center;
  margin-block: 8px 0;
  padding: 5px 11px;
  color: var(--catalog-accent);
  border: 1px solid var(--catalog-edge);
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 700;
}

.product-image-link[hidden] {
  display: none;
}

@media (min-width: 761px) {
  body.theme-dark[data-page="home"] .premium-hero .hero-content:has(.bo-hero-feature) {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body.theme-dark .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.theme-dark .categories-grid .category-card > a {
    font-size: .75rem;
  }

  body.theme-dark[data-page="home"] .bo-hero-feature {
    width: min(100%, 280px);
  }

  body.theme-dark[data-page="home"] .bo-hero-feature .bo-hero-photo {
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 359px) {
  body.theme-dark .categories-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-dark .categories-grid .category-card,
  body.theme-dark .shop-card {
    transition: none;
    transform: none;
  }
}
