/* استایل بخش دسته‌بندی‌ها صفحه اصلی — منتقل‌شده از <style> داخل قالب برای کش بهتر */

.dg-categories *,
.dg-categories *::before,
.dg-categories *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.dg-categories {
    width: 100%;
    max-width: 1320px;
    margin: 50px auto;
    padding: 0 24px;
    direction: rtl;
    position: relative;
    overflow: hidden;
}

.dg-categories::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 100%;
    height: 300px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.dg-categories__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
}

/* کارت دسته - عرض ثابت برای ۴ تایی */
.dg-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    width: 280px;
    max-width: calc(25% - 30px);
    position: relative;
    cursor: pointer;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* هاله زیر آیکون */
.dg-category-card::before {
    content: '';
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    filter: blur(12px);
    transition: all 0.5s ease;
    opacity: 0;
}

.dg-category-card:hover::before {
    opacity: 1;
    width: 220px;
}

/* هاور: کل کارت بزرگ و بالا می‌رود */
.dg-category-card:hover {
    transform: translateY(-10px) scale(1.05);
}

/* کادر تصویر - بدون پس‌زمینه، بدون border-radius */
.dg-category-card__image {
    width: 300px;
    height: 300px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    position: relative;
    transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.12));
}

.dg-category-card:hover .dg-category-card__image {
    filter: drop-shadow(0 12px 28px rgba(99, 102, 241, 0.25));
}

/* عکس - بدون تغییر اندازه در هاور */
.dg-category-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: filter 0.5s ease;
}

/* کلیک: موج ملایم روی عکس (فیلتر، بدون scale) */
.dg-category-card.waving .dg-category-card__image img {
    animation: dg-wave-click 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes dg-wave-click {
    0% {
        filter: brightness(1) saturate(1);
    }
    30% {
        filter: brightness(1.3) saturate(1.3);
    }
    60% {
        filter: brightness(1.1) saturate(1.1);
    }
    100% {
        filter: brightness(1) saturate(1);
    }
}

/* حلقه موج که از وسط عکس پخش می‌شود - ملایم‌تر */
.dg-wave-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.5);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.dg-category-card.waving .dg-wave-ring {
    animation: dg-ring-spread 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes dg-ring-spread {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
        border-width: 3px;
    }
    100% {
        transform: translate(-50%, -50%) scale(12);
        opacity: 0;
        border-width: 1px;
    }
}

.dg-wave-ring--second {
    animation-delay: 0.2s !important;
}

.dg-category-card__icon {
    width: 150px;
    height: 150px;
    color: #6366f1;
    transition: all 0.5s ease;
}

.dg-category-card:hover .dg-category-card__icon {
    color: #4f46e5;
    transform: scale(1.1);
}

/* عنوان */
.dg-category-card__title {
    font-family: 'Vazir', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.dg-category-card:hover .dg-category-card__title {
    color: #6366f1;
}

/* توضیحات */
.dg-category-card__description {
    font-family: 'Vazir', sans-serif;
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.6;
    max-width: 200px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* خط زیر */
.dg-category-card::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #764ba2);
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dg-category-card:hover::after {
    width: 60%;
}

/* ریسپانسیو - فقط ۲ یا ۴ در هر ردیف */

/* تبلت: ۲ در هر ردیف */
@media (max-width: 992px) {
    .dg-categories__grid {
        gap: 30px;
    }

    .dg-category-card {
        width: 200px;
        max-width: calc(50% - 15px);
    }

    .dg-category-card__image {
        width: 220px;
        height: 220px;
    }
}

/* موبایل بزرگ: ۲ در هر ردیف */
@media (max-width: 768px) {
    .dg-categories {
        margin: 35px auto;
    }

    .dg-categories__grid {
        gap: 24px;
    }

    .dg-category-card {
        width: 160px;
        max-width: calc(50% - 12px);
    }

    .dg-category-card__image {
        width: 150px;
        height: 150px;
    }
}

/* موبایل کوچک: ۲ در هر ردیف با فاصله کمتر */
@media (max-width: 480px) {
    .dg-categories__grid {
        gap: 16px;
    }

    .dg-category-card {
        width: 140px;
        max-width: calc(50% - 8px);
    }

    .dg-category-card__image {
        width: 130px;
        height: 130px;
    }
}
