/* Podkategorie používají obrázky z administrace Shoptetu. */
.template-13 .subcategories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; padding: 0; }
.template-13 .subcategories::before, .template-13 .subcategories::after { content: none; }
.template-13 .subcategories > li { float: none; width: auto; padding: 0; margin: 0; min-width: 0; }
.template-13 .subcategories li a { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; border: 0; background: var(--mg-paper); padding: 12px; height: 100%; min-height: 88px; }

.template-13 .subcategories li a .text { display: block; position: static; width: auto; margin: 0; color: var(--mg-ink); font-weight: 700; line-height: 1.3; max-width: none; max-height: none; -webkit-line-clamp: unset; overflow: visible; padding: 0; text-align: left; }
.template-13 .subcategories li a .image { display: block; position: static; float: none; width: 88px; height: 62px; max-width: none; margin: 0; padding: 0; }
.template-13 .subcategories li a .image img { width: 100%; max-height: 62px; }
.template-13 .subcategories li a .image img { object-fit: contain; }
.template-13 .subcategories li a:not(:has(.image img)),
.template-13 .subcategories li a:has(img[src*="/folder.svg"], img[data-src*="/folder.svg"]) {
  grid-template-columns: minmax(0, 1fr);
  min-height: 54px;
}
.template-13 .subcategories li a:has(img[src*="/folder.svg"], img[data-src*="/folder.svg"]) .image { display: none; }
/* Filtry, řazení a stránkování. */
.template-13 .sidebar { font-size: 15px; }
.template-13.type-category :is(.products-top-wrapper, .sidebar .box-topProducts) { display: none; }
.template-13.type-category .sidebar .box-filters:not(:has(#filters)) { display: none; }
.template-13 :is(.filter-section, .box-bg-variant) { background: var(--mg-paper); border-color: var(--mg-line); }
.template-13 .filter-section h4 { font-size: 17px; }
.template-13 #category-header { border-bottom: 0; }
.template-13 #category-header input:checked + label { color: var(--mg-ink); text-decoration: underline var(--mg-orange); }
.template-13 #filters { background: var(--mg-paper); }
.template-13 #filters .filter-sections { background: transparent; }
.template-13 #filters .ui-slider-handle { background-color: var(--mg-orange); border-color: var(--mg-orange); }
.template-13 .pagination :is(.pagination__link, .pagination__currentPage) { min-width: 44px; min-height: 44px; padding: 10px 13px; }
.template-13 .pagination__currentPage { background: var(--mg-ink); color: #fff; }
/* Produktová karta: zachované ceny, množství a nativní formulář. */
.template-13 .products-block .product { padding: 10px; }
.template-13 .products-block .product .p { container-type: inline-size; border: 1px solid var(--mg-line); background: #fff; padding: 14px; height: 100%; transition: border-color .15s, box-shadow .18s; }
.template-13 .products-block .p > .image { background: var(--mg-paper); overflow: hidden; }
.template-13 .products-block .p > .image img { object-fit: contain; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.template-13 .products-block .p .name { color: var(--mg-ink); font-size: 17px; font-weight: 700; line-height: 1.35; min-height: 0; }
.template-13 :is(.products-block, .products-inline) .p .p-in-in a.name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  height: auto;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.template-13 .products-block .ratings-wrapper { margin-top: 10px; }
.template-13 .products-block .availability { font-size: 14px; }
.template-13 .products-block .price-final { color: var(--mg-ink); font-size: 25px; line-height: 1.2; }
.template-13 .products-block .price-additional { color: #64675c; font-size: 14px; }
.template-13 .products-block .p-tools .pr-action { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.template-13 .products-block .p-tools .btn.btn-cart { margin: 0; flex: 1 1 auto; min-height: 44px; }
.template-13 .products-block .p-desc { color: #62645f; line-height: 1.5; font-size: 14px; }
.template-13 .products-page.products-block .p-desc { display: none; }
.template-13 .products-block .stars-placeholder:empty { display: none; }
.template-13 .products-block .ratings-wrapper .stars-placeholder:empty { display: none; }
.template-13 .quantity { border-color: #c5c7bd; }
.template-13 .quantity .amount { color: var(--mg-ink); font-size: 16px; }

/* Strom kategorií v postranním panelu. */
.template-13 .sidebar :is(.box-categories, .box-filters) {
  padding: clamp(12px, 1.4vw, 18px);
  border: 0;
  background: var(--mg-paper);
}
.template-13 .sidebar #categories { display: grid; gap: 4px; }
.template-13 .sidebar #categories > .categories {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.template-13 .sidebar #categories > .categories > .topic { padding: 0; border: 0; background: transparent; }
.template-13 .sidebar #categories > .categories > .topic > a {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--mg-ink);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}
.template-13 .sidebar #categories > .categories.expandable > .topic > a { padding-inline-end: 36px; }
.template-13 .sidebar #categories > .categories > .topic.active > a {
  background: #e6e6e6;
}
.template-13 .sidebar #categories > .categories > ul {
  margin: 0;
  padding: 4px 0 6px 14px;
  border: 0;
  background: transparent;
}
.template-13 .sidebar #categories > .categories > ul > li > a {
  display: block;
  padding: 7px 10px;
  color: var(--mg-ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

.template-13 .sidebar #categories .topic::before,
.template-13 .sidebar #categories .topic > a::before,
.template-13 .sidebar #categories .cat-trigger::after { content: none; }
.template-13 .sidebar #categories .cat-trigger {
  position: absolute;
  inset: 0 0 0 auto;
  display: block;
  width: 34px;
  height: auto;
  font-size: 0;
}
.template-13 .sidebar #categories .categories:not(.expandable) > .topic .cat-trigger { display: none; }
.template-13 .sidebar #categories .expandable > .topic .cat-trigger::before,
.template-13 .sidebar #categories .expandable:not(.expanded) > .topic .cat-trigger::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 11px;
  height: 2px;
  margin: 0;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.template-13 .sidebar #categories .expandable:not(.expanded) > .topic .cat-trigger::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
.template-13 .sidebar .filter-section { background: transparent; }

.template-13 .products-block .product:hover { box-shadow: none !important; transform: none; }
.template-13 .products-block .product:hover .p { transform: none; }
.template-13 .products-block .product .p:has(:focus-visible) { border-color: #a5a79b; }
.template-13 .products-block .product .p .name { padding-inline: 0; text-decoration: none; text-align: left; }
.template-13 .products-block .product:hover .p .name { text-decoration: none; }
.template-13 .products-block .product .p .name:is(:focus-visible) { color: var(--mg-ink); text-decoration: underline; text-underline-offset: 3px; }
.template-13 .products-block .p-in:has(> .p-bottom > .mg-product-card-link) {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}
.template-13 .products-block .p-bottom:has(.mg-product-card-link) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
  margin-top: auto;
  padding: 12px 0 0;
  border-top: 0;
}
.template-13 .products-block .p-bottom:has(.mg-product-card-link)::before,
.template-13 .products-block .p-bottom:has(.mg-product-card-link)::after { content: none; }
.template-13 .products-block .p-bottom:has(.mg-product-card-link) > :is(.offers, [data-micro="offer"]) { grid-area: 1 / 1; min-width: 0; width: auto; margin: 0; text-align: left; }
.template-13 .products-block .p-bottom:has(.mg-product-card-link) .prices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 0;
}
.template-13 .products-block .p-bottom:has(.mg-product-card-link) .price-final { order: -1; margin: 0; font-size: 20px; }
.template-13 .products-block .p-bottom:has(.mg-product-card-link) .price-additional { margin: 0; font-size: 13px; }
.template-13 .products-block .p-bottom:has(.mg-product-card-link) .price-standard-wrapper-placeholder { display: none; }
.template-13 .products-block .p-bottom > .mg-product-card-link {
  grid-area: 1 / 2;
  position: static;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  align-self: start;
  margin: 0;
  min-height: 44px;
  padding: 7px 16px;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 767px) {
  .template-13 #filters { padding-inline: 12px; }
  .template-13 #filters .filter-sections { padding-inline: 0; }
  .template-13 .products-block .p-bottom:has(.mg-product-card-link) {
    align-content: start;
    align-items: center;
    column-gap: 8px;
    min-height: 0;
    padding: 8px 0 0;
  }
  .template-13 .products-block .p-bottom > .mg-product-card-link {
    align-self: center;
    padding-inline: 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@container (max-width: 215px) {
  .template-13 .products-block .p-bottom:has(.mg-product-card-link) { grid-template-columns: minmax(0, 1fr); }
  .template-13 .products-block .p-bottom > .mg-product-card-link {
    grid-area: 2 / 1;
    justify-self: stretch;
    justify-content: center;
  }
}

/* Kompaktní filtry na všech šířkách. */
.template-13 #filters .mg-filter-hidden { display: none; }
.template-13 #filters .mg-brand-toggle {
  margin: 8px 0 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--mg-ink);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.template-13 #filters .mg-year-range { display: grid; gap: 8px; margin-bottom: 8px; }
.template-13 #filters .mg-year-range label { display: block; margin: 0; }
.template-13 #filters .mg-year-range input[type="range"] {
  display: block;
  width: 100%;
  min-height: 24px;
  margin: 0;
  accent-color: var(--mg-ink);
}
.template-13 #filters .mg-year-range-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.template-13 #filters .mg-year-range-actions a { padding-block: 8px; text-decoration: underline; }

.template-13.mg-inquiry-mode .products-block .p-bottom:has(> .mg-product-card-link) .p-tools { display: none; }
.template-13 #filters .mg-year-range .btn {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.25;
}

.template-13 .sidebar #categories > .categories > ul > li.active > a { background: var(--mg-paper-hover); font-weight: 700; }

@media (hover: hover) and (pointer: fine) {
  .template-13 .subcategories li a:hover { background: var(--mg-paper-hover); }
  .template-13 .subcategories li a:hover .text { text-decoration: none; }
  .template-13 .sidebar #categories > .categories a:where(:hover) {
    background: var(--mg-paper-hover);
    color: var(--mg-ink);
    text-decoration: none;
  }
  .template-13 .products-block .product .p:hover { box-shadow: 0 6px 16px rgb(0 0 0 / 12%); }
}

@media (max-width: 991px) {
  .template-13 .products-block .p-bottom:has(> .mg-product-card-link) .prices > :is(.price-final, .price-additional) {
    flex: 0 0 auto;
  }
  .template-13 .products-block .p-bottom > .mg-product-card-link { align-self: end; }
}
