﻿/* =========================================================
   DIANAPARTS — CATEGORY GLOW HOVER
   Светящийся эффект карточек категорий
   ========================================================= */

.category-card,
.category-item,
.popular-category-card,
.catalog-category-card,
.categories-grid > a,
.category-grid > a {
    position: relative !important;
    overflow: hidden !important;
    isolation: isolate;
}

/* мягкий желтый блик внутри карточки */
.category-card::before,
.category-item::before,
.popular-category-card::before,
.catalog-category-card::before,
.categories-grid > a::before,
.category-grid > a::before {
    content: "";
    position: absolute;
    inset: -2px;
    background:
        radial-gradient(circle at 30% 0%, rgba(255, 210, 45, 0.35), transparent 35%),
        linear-gradient(135deg, rgba(255, 210, 45, 0.20), transparent 45%, rgba(255,255,255,0.10));
    opacity: 0;
    transition: opacity .25s ease;
    z-index: 1;
    pointer-events: none;
}

/* светящаяся рамка */
.category-card::after,
.category-item::after,
.popular-category-card::after,
.catalog-category-card::after,
.categories-grid > a::after,
.category-grid > a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 210, 45, 0);
    box-shadow:
        0 0 0 rgba(255, 210, 45, 0),
        inset 0 0 0 rgba(255, 210, 45, 0);
    transition: border-color .25s ease, box-shadow .25s ease;
    z-index: 3;
    pointer-events: none;
}

/* hover карточки */
.category-card:hover,
.category-item:hover,
.popular-category-card:hover,
.catalog-category-card:hover,
.categories-grid > a:hover,
.category-grid > a:hover {
    transform: translateY(-7px) scale(1.015) !important;
    border-color: rgba(255, 210, 45, 0.55) !important;
    box-shadow:
        0 22px 55px rgba(0, 0, 0, 0.50),
        0 0 32px rgba(255, 210, 45, 0.20) !important;
}

/* включаем внутренний блик */
.category-card:hover::before,
.category-item:hover::before,
.popular-category-card:hover::before,
.catalog-category-card:hover::before,
.categories-grid > a:hover::before,
.category-grid > a:hover::before {
    opacity: 1;
}

/* включаем светящуюся рамку */
.category-card:hover::after,
.category-item:hover::after,
.popular-category-card:hover::after,
.catalog-category-card:hover::after,
.categories-grid > a:hover::after,
.category-grid > a:hover::after {
    border-color: rgba(255, 210, 45, 0.65);
    box-shadow:
        0 0 22px rgba(255, 210, 45, 0.35),
        inset 0 0 18px rgba(255, 210, 45, 0.08);
}

/* картинка чуть приближается */
.category-card img,
.category-item img,
.popular-category-card img,
.catalog-category-card img,
.categories-grid > a img,
.category-grid > a img {
    transition: transform .35s ease, filter .35s ease;
    position: relative;
    z-index: 0;
}

.category-card:hover img,
.category-item:hover img,
.popular-category-card:hover img,
.catalog-category-card:hover img,
.categories-grid > a:hover img,
.category-grid > a:hover img {
    transform: scale(1.045);
    filter: saturate(1.12) contrast(1.05);
}

/* текст поверх блика */
.category-card h3,
.category-card p,
.category-card span,
.category-item h3,
.category-item p,
.category-item span,
.popular-category-card h3,
.popular-category-card p,
.popular-category-card span,
.catalog-category-card h3,
.catalog-category-card p,
.catalog-category-card span,
.categories-grid > a h3,
.categories-grid > a p,
.categories-grid > a span,
.category-grid > a h3,
.category-grid > a p,
.category-grid > a span {
    position: relative;
    z-index: 4;
}

/* желтая линия под названием при наведении */
.category-card h3::after,
.category-item h3::after,
.popular-category-card h3::after,
.catalog-category-card h3::after,
.categories-grid > a h3::after,
.category-grid > a h3::after {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-top: 7px;
    border-radius: 999px;
    background: #f3c623;
    transform: scaleX(0.55);
    transform-origin: left;
    opacity: 0.65;
    transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease;
}

.category-card:hover h3::after,
.category-item:hover h3::after,
.popular-category-card:hover h3::after,
.catalog-category-card:hover h3::after,
.categories-grid > a:hover h3::after,
.category-grid > a:hover h3::after {
    transform: scaleX(1);
    opacity: 1;
    box-shadow: 0 0 14px rgba(255, 210, 45, 0.70);
}

/* на телефоне эффект мягче */
@media (max-width: 768px) {
    .category-card:hover,
    .category-item:hover,
    .popular-category-card:hover,
    .catalog-category-card:hover,
    .categories-grid > a:hover,
    .category-grid > a:hover {
        transform: translateY(-3px) scale(1.005) !important;
        box-shadow:
            0 14px 32px rgba(0, 0, 0, 0.40),
            0 0 18px rgba(255, 210, 45, 0.16) !important;
    }

    .category-card:hover img,
    .category-item:hover img,
    .popular-category-card:hover img,
    .catalog-category-card:hover img,
    .categories-grid > a:hover img,
    .category-grid > a:hover img {
        transform: scale(1.025);
    }
}
