/*
 * Dealbox.sk – stránka kategórie V4
 * Shoptet Step
 * Kompaktné podkategórie, kratší horný úvod, nízky AI poradca
 */

/* --------------------------------------------------------------------------
   Horná časť kategórie
   -------------------------------------------------------------------------- */

body.type-category .category-title {
  margin: 0 0 14px;
}

body.type-category .category-perex {
  margin-bottom: 18px;
}

body.type-category .category-perex .category-intro {
  margin: 0;
}

body.type-category .category-perex .category-intro + .category-intro {
  margin-top: 16px;
}

body.type-category .category-perex .category-intro h2 {
  margin: 0 0 8px;
  color: #142f36;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 800;
  line-height: 1.18;
}

body.type-category .category-perex .category-intro p {
  max-width: 920px;
  margin: 0;
  color: #4a5960;
  font-size: 15px;
  line-height: 1.65;
}

/* Hore ostane stručný úvod. Ďalšie odseky sa nestratia zo spodného SEO textu. */
body.type-category .category-perex .category-intro p:nth-of-type(n + 2) {
  display: none;
}

body.type-category .category-perex > :first-child img,
body.type-category .category-perex .category-intro img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  overflow: hidden;
  border: 1px solid rgba(20, 63, 72, .14);
  border-radius: 22px;
  background: #f5f7f8;
  box-shadow: 0 12px 30px rgba(11, 35, 42, .13);
  clip-path: inset(0 round 22px);
}

/* Hero býva v editore vložené dovnútra H2 alebo picture. */
body.type-category .category-perex .category-intro h2:has(> img),
body.type-category .category-perex .category-intro picture {
  display: block;
  overflow: hidden;
  margin: 0;
  border-radius: 22px;
  line-height: 0;
  clip-path: inset(0 round 22px);
}

body.type-category .category-perex .category-intro h2:has(> img) img,
body.type-category .category-perex .category-intro picture img {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Kompaktné karty podkategórií
   -------------------------------------------------------------------------- */

body.type-category .subcategories.with-image {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 26px !important;
  padding: 0 !important;
  list-style: none !important;
}

body.type-category .subcategories.with-image > li {
  float: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.type-category .subcategories.with-image > li > a {
  position: relative;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100% !important;
  height: 112px !important;
  min-height: 112px !important;
  max-height: 112px !important;
  overflow: hidden;
  padding: 12px 13px !important;
  border: 1px solid #2d5660 !important;
  border-radius: 15px;
  background: linear-gradient(180deg, #173f48 0%, #10343d 100%);
  box-shadow: 0 7px 18px rgba(11, 35, 42, .11);
  text-decoration: none !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

body.type-category .subcategories.with-image > li > a::after {
  content: "";
  position: absolute;
  top: 50% !important;
  right: 0;
  bottom: auto !important;
  left: auto !important;
  width: 3px !important;
  height: 30px !important;
  border-radius: 999px 0 0 999px;
  background: #ef3e45;
  transform: translateY(-50%) !important;
}

body.type-category .subcategories.with-image > li > a:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 62, 69, .82) !important;
  box-shadow: 0 11px 24px rgba(11, 35, 42, .18);
}

body.type-category .subcategories.with-image > li > a:focus-visible {
  outline: 3px solid rgba(239, 62, 69, .55);
  outline-offset: 3px;
}

body.type-category .subcategories.with-image > li > a > .image {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 66px !important;
  height: 66px !important;
  min-width: 66px !important;
  min-height: 66px !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.type-category .subcategories.with-image > li > a > .image img {
  display: block;
  width: 64px !important;
  height: 58px !important;
  max-width: 64px !important;
  max-height: 58px !important;
  margin: 0 auto !important;
  object-fit: contain;
  transform: none !important;
}

body.type-category .subcategories.with-image > li > a > .text {
  display: -webkit-box !important;
  min-width: 0;
  min-height: 0 !important;
  max-height: 57px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  color: #f7fbfc !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: left !important;
  text-wrap: balance;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* --------------------------------------------------------------------------
   Kompaktnejší AI poradca v kategórii
   -------------------------------------------------------------------------- */

body.type-category #dbx-ai-box {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center !important;
  gap: 16px !important;
  min-height: 0 !important;
  margin: 20px 0 24px !important;
  padding: 15px 18px !important;
  border-radius: 16px !important;
}

body.type-category #dbx-ai-box .dbx-ai-robot {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  margin: 0 !important;
}

body.type-category #dbx-ai-box .dbx-ai-robot img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

body.type-category #dbx-ai-box .dbx-ai-content {
  min-width: 0;
  margin: 0 !important;
}

body.type-category #dbx-ai-box .dbx-ai-title {
  margin: 0 0 3px !important;
  font-size: 18px !important;
  line-height: 1.16 !important;
}

body.type-category #dbx-ai-box .dbx-ai-text {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

body.type-category #dbx-ai-box .dbx-ai-benefits {
  display: flex !important;
  flex-wrap: wrap;
  gap: 3px 13px !important;
  margin-top: 7px !important;
}

body.type-category #dbx-ai-box .dbx-ai-benefits span {
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}

body.type-category #dbx-ai-box .dbx-ai-action {
  margin: 0 !important;
}

body.type-category #dbx-ai-box .dbx-ai-btn {
  white-space: nowrap;
}

/* Produktové karty nepredlžuje opakujúci sa text. */
body.type-category #products .p-desc {
  display: none !important;
}

/* Spodný SEO obsah zostáva plne viditeľný. */
body.type-category .category__secondDescription {
  margin-top: 38px;
}

/* --------------------------------------------------------------------------
   Responzívne rozloženie
   -------------------------------------------------------------------------- */

@media (max-width: 1199px) {
  body.type-category .subcategories.with-image {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  body.type-category .category-title {
    margin-bottom: 10px;
  }

  body.type-category .category-perex {
    margin-bottom: 14px;
  }

  body.type-category .category-perex .category-intro + .category-intro {
    margin-top: 12px;
  }

  body.type-category .category-perex .category-intro h2 {
    margin-bottom: 6px;
    font-size: 19px;
  }

  body.type-category .category-perex .category-intro p {
    font-size: 13px;
    line-height: 1.55;
  }

  body.type-category .category-perex > :first-child img,
  body.type-category .category-perex .category-intro img {
    border-radius: 14px;
    box-shadow: 0 7px 18px rgba(11, 35, 42, .09);
    clip-path: inset(0 round 14px);
  }

  body.type-category .category-perex .category-intro h2:has(> img),
  body.type-category .category-perex .category-intro picture {
    border-radius: 14px;
    clip-path: inset(0 round 14px);
  }

  body.type-category .subcategories.with-image {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 15px 0 21px !important;
  }

  body.type-category .subcategories.with-image > li > a {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 7px;
    height: 104px !important;
    min-height: 104px !important;
    max-height: 104px !important;
    padding: 9px 8px !important;
    border-radius: 13px;
  }

  body.type-category .subcategories.with-image > li > a::after {
    height: 25px !important;
  }

  body.type-category .subcategories.with-image > li > a > .image {
    width: 50px !important;
    height: 54px !important;
    min-width: 50px !important;
    min-height: 54px !important;
  }

  body.type-category .subcategories.with-image > li > a > .image img {
    width: 50px !important;
    height: 48px !important;
    max-width: 50px !important;
    max-height: 48px !important;
  }

  body.type-category .subcategories.with-image > li > a > .text {
    max-height: 60px;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    -webkit-line-clamp: 4;
  }

  body.type-category #dbx-ai-box {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px !important;
    margin: 16px 0 20px !important;
    padding: 12px !important;
    border-radius: 13px !important;
  }

  body.type-category #dbx-ai-box .dbx-ai-robot {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
  }

  body.type-category #dbx-ai-box .dbx-ai-title {
    font-size: 15px !important;
  }

  body.type-category #dbx-ai-box .dbx-ai-text {
    font-size: 12px !important;
  }

  body.type-category #dbx-ai-box .dbx-ai-benefits {
    display: none !important;
  }

  body.type-category #dbx-ai-box .dbx-ai-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  body.type-category #dbx-ai-box .dbx-ai-btn {
    display: block !important;
    width: 100%;
    padding: 11px 14px !important;
    text-align: center;
  }

  body.type-category .category__secondDescription {
    margin-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.type-category .subcategories.with-image > li > a {
    transition: none;
  }
}
