.bdcats {
  max-width: 1420px;
  margin: 32px auto 42px;
  padding: 0 16px;
}

.bdcats h2 {
  margin: 0 0 18px;
  color: #0B171B;
  font-size: 28px;
  font-weight: 700;
}

.bdgrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.bdcat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #E7ECEE;
  border-radius: 5px;
  color: #0B171B !important;
  text-decoration: none !important;
  transition: .18s ease;
}

.bdcat:hover {
  border-color: #BFCBCC;
  box-shadow: 0 5px 18px rgba(11,23,27,.08);
  transform: translateY(-2px);
}

.bdcat img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
  background: #FFFFFF;
}

.bdcat strong {
  display: block;
  min-height: 54px;
  padding: 8px 36px 14px 14px;
  color: #0B171B;
  font-size: 15px;
  line-height: 1.25;
}

.bdcat::after {
  content: "→";
  position: absolute;
  right: 13px;
  bottom: 13px;
  color: #0B8577;
  font-size: 20px;
}

body.type-index .homepage-box.before-carousel {
  margin-bottom: 0;
  border-bottom: 0;
}

body.type-index .homepage-box.middle-banners-wrapper {
  margin-top: 0;
  border-top: 0;
}

body.type-index .benefitBanner.position--benefitHomepage {
  display: flex;
}

.benefitBanner:is(.position--benefitHomepage, .position--benefitCategory) .benefitBanner__item {
  justify-content: center;
  text-align: center;
}

.benefitBanner:is(.position--benefitHomepage, .position--benefitCategory) .benefitBanner__content {
  flex: 0 1 auto;
  min-width: 0;
}

body.type-index .position--benefitHomepage .benefitBanner__picture {
  flex: 0 0 75px;
  max-width: 75px;
}

body.type-index .position--benefitHomepage .benefitBanner__img {
  width: 75px;
  height: 75px;
  object-fit: contain;
}

@media (max-width: 1199px) {
  .bdgrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .bdcats {
    padding: 0 10px;
    margin-top: 24px;
  }

  .bdcats h2 {
    font-size: 23px;
  }

  .bdgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .bdcat strong {
    font-size: 13px;
    min-height: 50px;
    padding: 7px 27px 10px 9px;
  }

  .bdcat::after {
    right: 9px;
    bottom: 9px;
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bdcat, .bdcat:hover {
    transition: none;
    transform: none;
  }
}

/* Úvod E-shop + servis. Text je v HTML banneru, fotografie jsou jen pozadí. */
body.type-index:has(.bdhome) .homepage-box.before-carousel {
  display: none;
}
/* Nezávisí na podpoře :has ani na tom, kam mobilní šablona vloží carousel. */
body.type-index.bd-home-active .homepage-box.before-carousel,
body.type-index.bd-home-active .wide-carousel,
body.type-index.bd-home-active #carousel {
  display: none !important;
}
body.type-index.bd-home-active .homepage-box.middle-banners-wrapper { padding-top: 22px; }
body.type-index:has(.bdhome) .homepage-box.middle-banners-wrapper {
  padding-top: 22px;
}
.bdhome {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-auto-rows: 1fr;
  gap: 16px;
  max-width: var(--bd-design-content-width, 1420px);
  margin: 0 auto;
  padding: 0 16px;
  font-family: var(--bd-design-body-font);
  text-align: left;
}
.bdhome *, .bdhome *::before, .bdhome *::after { box-sizing: border-box; }
.bdhome__card {
  display: flex;
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 450px;
  overflow: hidden;
  border-radius: var(--bd-design-radius, 5px);
  padding: clamp(24px, 2.6vw, 42px);
  color: var(--bd-design-ink);
  background: #deedf4;
}
.bdhome .bdhome__image {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center bottom;
  border: 0;
}
.bdhome__card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(240,247,249,.95), rgba(240,247,249,.74) 30%, rgba(240,247,249,0) 66%);
}
.bdhome__copy { display: flex; position: relative; z-index: 2; flex: 1; flex-direction: column; align-items: flex-start; max-width: 78%; }
.bdhome__card--shop::before { mask-image: linear-gradient(#000 0 45%, transparent 91%); }
.bdhome .bdhome__title {
  margin: 0 0 16px;
  padding: 0;
  color: inherit;
  font-family: var(--bd-design-heading-font);
  font-size: clamp(30px, 3.05vw, 44px);
  font-weight: 800;
  line-height: 1.09;
  letter-spacing: -.025em;
  text-align: left;
  text-transform: none;
  overflow-wrap: normal;
}
.bdhome .bdhome__description, .bdhome .bdhome__detail {
  max-width: 26ch;
  margin: 0 0 20px;
  padding: 0;
  color: inherit;
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 400;
  line-height: 1.4;
}
.bdhome .bdhome__detail { margin-top: -6px; font-size: 17px; }
.bdhome .bdhome__link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: 0 0 auto;
  width: 224px;
  min-height: 48px;
  margin-top: auto;
  max-width: 100%;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--bd-design-radius, 5px);
  background: var(--bd-design-yellow);
  color: var(--bd-design-ink);
  font-family: var(--bd-design-body-font);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  text-align: left;
  transition: background-color .15s ease;
}
.bdhome .bdhome__link:hover { background: var(--bd-design-yellow-hover); color: var(--bd-design-ink); }
.bdhome .bdhome__link:focus-visible { outline: 3px solid var(--bd-design-primary); outline-offset: 4px; }
.bdhome .bdhome__link svg { flex: 0 0 21px; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bdhome__card--service { color: var(--bd-design-white); background: #12353d; }
.bdhome__card--service::before {
  background: linear-gradient(100deg, rgba(7,40,48,.91), rgba(7,40,48,.63) 43%, rgba(7,40,48,0) 83%);
}
.bdhome__card--service .bdhome__copy { max-width: 76%; }
.bdhome__card--service .bdhome__title { max-width: 10ch; }
.bdhome__card--service .bdhome__description { max-width: 25ch; font-size: clamp(17px, 1.35vw, 20px); }
.bdhome__card--service .bdhome__link { background: var(--bd-design-white); color: #075d56; }
.bdhome__card--service .bdhome__link:hover { background: var(--bd-design-mint); color: #075d56; }
.bdhome__card--service .bdhome__link:focus-visible { outline-color: var(--bd-design-white); }
.bdhome + .bdcats { margin-top: 26px; }
#kategorie-dilu { scroll-margin-top: 145px; }
@media (max-width: 1199px) and (min-width: 992px) {
  .bdhome__card { min-height: 430px; padding: 24px; }
  .bdhome__copy, .bdhome__card--service .bdhome__copy { max-width: 88%; }
  .bdhome .bdhome__title { font-size: 32px; }
}
@media (max-width: 991px) {
  .bdhome { grid-template-columns: minmax(0, 1fr); }
  .bdhome__card { min-height: 400px; padding: 32px; }
  .bdhome__copy, .bdhome__card--service .bdhome__copy { max-width: 62%; }
  .bdhome .bdhome__title { font-size: 38px; }
}
@media (max-width: 599px) {
  body.type-index:has(.bdhome) .homepage-box.middle-banners-wrapper { padding-top: 14px; }
  .bdhome { padding: 0 10px; gap: 12px; }
  .bdhome__card { min-height: 0; padding: 24px 22px 218px; background: #e6f0f5; }
  .bdhome .bdhome__image { top: auto; bottom: 0; height: auto; aspect-ratio: 3 / 2; object-fit: contain; }
  .bdhome__card::before { inset: auto 0 0; aspect-ratio: 3 / 2; mask-image: none; background: linear-gradient(180deg, #e6f0f5, rgba(230,240,245,0) 38%); }
  .bdhome__copy, .bdhome__card--service .bdhome__copy { max-width: 100%; }
  .bdhome .bdhome__title { font-size: clamp(28px, 7.4vw, 38px); line-height: 1.12; }
  .bdhome .bdhome__description { max-width: 28ch; font-size: 18px; }
  .bdhome .bdhome__detail { font-size: 16px; max-width: 29ch; }
  .bdhome .bdhome__link { font-size: 17px; }
  .bdhome__card--service { background: #12353d; }
  .bdhome__card--service::before { background: linear-gradient(180deg, #12353d, rgba(18,53,61,0) 42%); }
  .bdhome__card--service .bdhome__title { max-width: none; }
  .bdhome + .bdcats { margin-top: 24px; }
}
@media (max-width: 359px) {
  .bdhome__card { padding: 20px 18px 180px; }
  .bdhome .bdhome__description { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .bdhome .bdhome__link { transition: none; } }

/* Mobil: poloviční prostor kolem nových karet; nativní kategorie se nemění. */
@media (max-width: 991px) {
  body.type-index:has(.bdhome) .homepage-box.middle-banners-wrapper { padding-top: 11px; }
  body.type-index.bd-home-active .homepage-box.middle-banners-wrapper { padding-top: 11px; }
  .bdhome { margin-inline: -10px; padding-inline: 8px; gap: 8px; }
  .bdhome + .bdcats { margin-top: 13px; }
}
@media (max-width: 767px) {
  body.type-index .middle-banners-wrapper .banner-wrapper:has(.bdhome) { margin-top: 10px; }
}
@media (max-width: 599px) {
  body.type-index:has(.bdhome) .homepage-box.middle-banners-wrapper { padding-top: 7px; }
  body.type-index.bd-home-active .homepage-box.middle-banners-wrapper { padding-top: 7px; }
  .bdhome { padding-inline: 5px; gap: 6px; }
  .bdhome + .bdcats { margin-top: 12px; }
}

/* Čtyři původní výhody mají na telefonu dva sloupce, nikoli úzké řádky textu. */
@media (max-width: 767px) {
  body.type-index .benefitBanner.position--benefitHomepage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  body.type-index .position--benefitHomepage .benefitBanner__item { display: flex; flex-direction: column; gap: 10px; width: auto; min-width: 0; padding: 0; margin: 0; }
  body.type-index .position--benefitHomepage .benefitBanner__picture { flex: 0 0 auto; display: flex; width: 56px; max-width: 56px; margin: 0; }
  body.type-index .position--benefitHomepage .benefitBanner__img { width: 56px; height: 56px; }
  body.type-index .position--benefitHomepage .benefitBanner__content { flex: 0 1 auto; width: 100%; min-width: 0; max-width: none; }
  body.type-index .position--benefitHomepage .benefitBanner__title { display: block; font-size: 15px; line-height: 1.35; overflow-wrap: normal; }
}
