/* === categories.css === */
/* Плавный скролл для якорных ссылок */
html {
scroll-behavior: smooth;
}

/* === БЛОК КАТЕГОРИЙ === */
.categories-section {
padding: 24px 0;
}
.cat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    background: #f1f1f1 !important;
    border: 0 !important;
    border-radius: 12px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
    color: var(--text-primary);
    position: relative;
    box-shadow: none !important;
    text-decoration: none;
    overflow: hidden;
    gap: 12px;
}
.cat-card:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
}

/* === «БЕГУЩИЙ СВЕТ» ПО КОНТУРУ ПРИ НАВЕДЕНИИ === */



.cat-card::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
pointer-events: none;
z-index: 2;
padding: 2px;
background: conic-gradient(from var(--vk-a),
rgba(0,229,255,0) 0deg, #00e5ff 60deg, #9b6bff 140deg, #ff3d94 210deg, #00e5ff 300deg, rgba(0,229,255,0) 360deg);
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
filter: blur(.4px) saturate(1.2);
opacity: 0;
transition: opacity .22s ease;
}
.cat-card:hover::after {
opacity: 1;
animation: vk-run 2.4s linear infinite;
}

/* === ИКОНКА КАТЕГОРИИ (БЕЗ КРУГЛОЙ ОПРАВЫ) === */
.cat-icon {
font-size: 22px;
display: flex;
align-items: center;
justify-content: center;
width: auto;
height: auto;
border-radius: 0;
background: none;
color: var(--neon-cyan);
transition: transform 0.3s var(--ease-spring);
box-shadow: none;
}
.cat-icon img.cat-icon-img {
width: 86px !important;
height: 86px !important;
}
.cat-card:hover .cat-icon {
transform: scale(1.12) translateY(-1px);
color: #fff;
}

/* === НАЗВАНИЕ КАТЕГОРИИ === */
.cat-name {
font-family: 'Manrope', 'Inter', sans-serif;
font-size: 15px;
font-weight: 600;
line-height: 1.2;
color: var(--text-secondary);
transition: color 0.3s;
}
.cat-card:hover .cat-name {
color: var(--text-primary);
}

/* === АДАПТИВНОСТЬ КАТЕГОРИЙ === */
@media (max-width: 1200px) {
.cat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}
}
@media (max-width: 768px) {
.cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.cat-card {
padding: 14px 6px;
gap: 8px;
}
.cat-icon img.cat-icon-img {
width: 60px !important;
height: 60px !important;
}
.cat-name {
font-size: 13px;
}
}
@media (max-width: 480px) {
.cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}
.cat-card {
padding: 12px 4px;
gap: 6px;
}
.cat-icon img.cat-icon-img {
width: 48px !important;
height: 48px !important;
}
.cat-name {
font-size: 11px;
}
}

/* ==========================================================================
   === CAT CARD DARK: тёмный фон + белый текст ===
   Базовая .cat-card имеет background: #f1f1f1 !important, из-за чего
   в тёмной теме карточка оставалась светлой, а текст — тёмным/серым.
   Перекрываем: в тёмной теме фон серо-тёмный, текст — белый.
   ========================================================================== */

html body:not(.light-theme) .cat-card {
    background: #3a3a3a !important;
    background-color: #3a3a3a !important;
    background-image: none !important;
    color: #ffffff !important;
}

html body:not(.light-theme) .cat-card:hover {
    background: #454545 !important;
    background-color: #454545 !important;
}

html body:not(.light-theme) .cat-card .cat-name {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html body:not(.light-theme) .cat-card:hover .cat-name {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Иконка в тёмной теме — cyan, чтобы контрастировала с тёмным фоном */
html body:not(.light-theme) .cat-card .cat-icon {
    color: var(--neon-cyan, #94adae) !important;
}

/* Кнопка «Смотреть всё» в тёмной теме — градиент сохраняется, текст белый */
html body:not(.light-theme) .cat-card--all .cat-name {
    color: #94adae !important;
    -webkit-text-fill-color: #94adae !important;
}
html body:not(.light-theme) .cat-card--all {
    background: linear-gradient(135deg, #2b2b40 0%, #2f2f4d 100%) !important;
    border-color: rgba(0, 243, 255, 0.35) !important;
}

/* ==========================================================================
   === CAT-CARD--ALL: единый вид с .cat-card (v2) ===
   Кнопка <button class="cat-card cat-card--all"> — точно такой же вид,
   как у обычных <a class="cat-card">:
   - border-radius: 12px
   - без рамки (border: 0)
   - в тёмной теме фон как у cat-card (#3a3a3a), не градиент
   - иконка «+» без scale при hover (убираем дёрганье)
   - padding/gap без !important, чтобы работали медиа-запросы
   ========================================================================== */

/* Браузерные стили <button> — сбрасываем, но без !important на padding/gap */
.cat-card--all {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px 10px;
    margin: 0;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    position: relative;
    transition: background .3s var(--ease-spring), box-shadow .3s var(--ease-spring);
}

/* Мобильная адаптация — как у .cat-card */
@media (max-width: 1024px) {
    .cat-card--all { padding: 14px 6px; gap: 8px; }
}
@media (max-width: 640px) {
    .cat-card--all { padding: 12px 4px; gap: 6px; }
}

/* Светлая тема — как у обычной .cat-card (белый/светлый фон, без рамки) */
html body.light-theme .cat-card--all,
body.light-theme .cat-card--all {
    background: #f1f1f1 !important;
    background-color: #f1f1f1 !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 12px !important;
    color: #0369a1 !important;
}

/* Тёмная тема — как у обычной .cat-card (тёмный #3a3a3a, без рамки) */
html body:not(.light-theme) .cat-card--all {
    background: #3a3a3a !important;
    background-color: #3a3a3a !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 12px !important;
    color: #94adae !important;
}

/* Hover — тот же принцип, что у .cat-card */
html body.light-theme .cat-card--all:hover {
    background: #e8e8e8 !important;
    background-color: #e8e8e8 !important;
}
html body:not(.light-theme) .cat-card--all:hover {
    background: #454545 !important;
    background-color: #454545 !important;
}

/* Иконка «+» — круглая подложка, стабильный размер, без scale/rotate при hover */
.cat-card--all .cat-icon--all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    transform: none !important;
    transition: background .2s ease, color .2s ease;
}
.cat-card--all:hover .cat-icon--all {
    transform: none !important;
}
.cat-card--all .cat-icon--all svg,
.cat-card--all:hover .cat-icon--all svg {
    display: block;
    width: 18px;
    height: 18px;
    transform: none !important;
}

/* Тёмная тема: cyan подложка у «+» */
html body:not(.light-theme) .cat-card--all .cat-icon--all {
    background: rgba(0, 243, 255, 0.12) !important;
    color: #94adae !important;
}
html body:not(.light-theme) .cat-card--all:hover .cat-icon--all {
    background: rgba(0, 243, 255, 0.2) !important;
    color: #94adae !important;
}

/* Светлая тема: синяя подложка у «+» */
html body.light-theme .cat-card--all .cat-icon--all,
body.light-theme .cat-card--all .cat-icon--all {
    background: rgba(3, 105, 161, 0.1) !important;
    color: #0369a1 !important;
}
html body.light-theme .cat-card--all:hover .cat-icon--all {
    background: rgba(3, 105, 161, 0.16) !important;
}

/* Текст «Смотреть всё» — как остальные подписи */
html body:not(.light-theme) .cat-card--all .cat-name {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}
html body.light-theme .cat-card--all .cat-name {
    color: #0369a1 !important;
    -webkit-text-fill-color: #0369a1 !important;
}

/* Усиленный нижний внешний отступ у блока подкатегорий на страницах категорий.
   display: flow-root не даёт margin-bottom схлопнуться с margin-top следующего блока. */
section.section.subcategories-section,
.section.subcategories-section {
    margin-bottom: 48px !important;
    display: flow-root;
}

@media (max-width: 768px) {
    section.section.subcategories-section,
    .section.subcategories-section {
        margin-bottom: 28px !important;
    }
}
