/* ===== Grid of cards ===== */
.mkf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--mkf-gap);
}

@media (max-width:1100px) {
    .mkf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:820px) {
    .mkf-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:520px) {
    .mkf-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Two-column page layout (sidebar + content) ===== */
.mkf-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}

@media (max-width:920px) {
    .mkf-layout {
        grid-template-columns: 1fr;
    }

    .mkf-sidebar-wrap {
        order: 2;
    }
}

/* ===== Pager ===== */
.mkf-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.mkf-pager__num {
    opacity: .8;
}

/* ===== Breadcrumbs ===== */
.mkf-breadcrumbs {
    margin: 12px 0 6px;
    font-size: 14px;
    opacity: .9;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.mkf-breadcrumbs .sep {
    opacity: .5;
}

.mkf-breadcrumbs a {
    color: var(--mkf-on-surface);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 0, 0, .25);
}

.mkf-breadcrumbs a:hover {
    border-bottom-color: transparent;
}

/* ===== Category tree ===== */
.mkf-cattree {
    background: var(--mkf-surface);
    border: 1px solid var(--mkf-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.mkf-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mkf-tree li {
    margin: 2px 0;
}

.mkf-tree--parents li a {
    opacity: .85;
}

.mkf-tree .is-current strong {
    opacity: 1;
}

.mkf-tree details>summary {
    cursor: pointer;
    list-style: none;
}

.mkf-tree details>summary::-webkit-details-marker {
    display: none;
}

.mkf-tree details>summary a {
    font-weight: 600;
}

.mkf-tree details ul {
    margin: 6px 0 6px 12px;
    padding-left: 8px;
    border-left: 1px dashed var(--mkf-border);
}

.mkf-tree a {
    color: var(--mkf-on-surface);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 0, 0, .2);
}

.mkf-tree a:hover {
    border-bottom-color: transparent;
}


.mkf-text-right { text-align: right; }


/* === Плитка категорий на главной === */
.mkf-home-cats {
    margin: 20px 0 28px;
}

.mkf-home-cats-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mkf-home-cats-title {
    margin: 0;
    font-size: 20px;
}

.mkf-home-cats-subtitle {
    font-size: 13px;
    color: var(--mkf-muted);
}

.mkf-home-cats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.mkf-home-cat {
    position: relative;
    overflow: hidden;
    padding: 12px 12px 10px;
    border-radius: 16px;
    background: var(--mkf-surface);
    border: 1px solid var(--mkf-border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    text-decoration: none;
    color: var(--mkf-on-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 110px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.mkf-home-cat:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    border-color: rgba(37, 99, 235, 0.35);
}

.mkf-home-cat-text {
    max-width: 65%;
}

.mkf-home-cat-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.mkf-home-cat-link {
    font-size: 12px;
    color: var(--mkf-muted);
}

.mkf-home-cat-thumb {
    flex: 0 0 70px;
    height: 70px;
    border-radius: 12px;
    background: var(--mkf-thumb);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mkf-home-cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =========================================================
   Catalog category tiles (внутри страницы каталога)
   ========================================================= */

.mkf-cat-tiles{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Сама карточка */
.mkf-cat-tile{
  display: flex;
  flex-direction: row;      /* строго в строку */
  align-items: flex-start;
  gap: 12px;

  padding: 14px;
  border-radius: 16px;
  background: var(--mkf-surface);
  border: 1px solid var(--mkf-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);

  text-decoration: none;
  color: var(--mkf-on-surface);

  transition: transform .12s ease,
              box-shadow .12s ease,
              border-color .12s ease;
}

.mkf-cat-tile:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Иконка */
.mkf-cat-tile__icon{
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 14px;

  background: rgba(15, 23, 42, 0.04);

  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mkf-cat-tile__icon img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Текст */
.mkf-cat-tile__text{
  flex: 1 1 auto;
  min-width: 0;
}

.mkf-cat-tile__name{
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}

.mkf-cat-tile__hint{
  font-size: 12px;
  color: var(--mkf-muted);
}

/* Адаптив для hero и категорий */
@media (max-width: 1100px) {
    .mkf-hero-slide {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        padding-inline: 24px;
    }

    .mkf-home-cats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .mkf-hero-slide {
        grid-template-columns: minmax(0, 1fr);
        padding: 20px 18px 32px;
    }

    .mkf-hero-decoration {
        display: none;
    }
}

@media (max-width: 720px) {
    .mkf-home-cats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .mkf-home-cats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .mkf-home-cats-grid {
        grid-template-columns: 1fr;
    }
}
