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

/* ===== کانتینر اصلی صفحه ===== */
.cat-browse {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    direction: rtl;
    font-family: Vazir, sans-serif;
}

/* ===== Breadcrumb ===== */
.cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0 20px;
    font-size: 0.88rem;
    color: #64748b;
}
.cat-breadcrumb a {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s;
}
.cat-breadcrumb a:hover { color: #4f46e5; text-decoration: underline; }
.cat-breadcrumb__sep { color: #cbd5e1; }
.cat-breadcrumb__current {
    color: #0f172a;
    font-weight: 600;
}

/* ===== تیتر صفحه ===== */
.cat-browse__header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.cat-browse__header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.cat-browse__title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    position: relative;
}
.cat-browse__subtitle {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* ===== گرید دسته‌ها ===== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
    margin-bottom: 40px;
}

/* کارت دسته - مستطیل عمودی شیک */
/* ساختار: عکس مربعی تمام‌عرض در بالا + متن در پایین */
.cat-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.04);
}
.cat-card::after {
    /* خط تزئینی پایین کارت */
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}
.cat-card:hover {
    transform: translateY(-8px);
    border-color: #c7d2fe;
    box-shadow: 0 24px 50px -12px rgba(99, 102, 241, 0.22),
                0 0 0 1px rgba(99, 102, 241, 0.06);
}
.cat-card:hover::after { width: 70%; }

/* بخش عکس - تمام عرض، مربعی، بدون حاشیه داخلی */
.cat-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;  /* مربعی بر اساس عرض کارت */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
    overflow: hidden;
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.08));
}
.cat-card:hover .cat-card__image {
    filter: drop-shadow(0 6px 12px rgba(99, 102, 241, 0.15));
}

/* عکس - تمام عرض، حاشیه‌چسبیده به کارت */
.cat-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cat-card:hover .cat-card__image img {
    transform: scale(1.06);
}

/* آیکون (اگه عکس نبود) */
.cat-card__icon {
    width: 60%;
    max-width: 100px;
    height: auto;
    color: #6366f1;
    transition: color 0.4s ease, transform 0.4s ease;
}
.cat-card:hover .cat-card__icon {
    color: #4f46e5;
    transform: scale(1.08);
}

/* بخش متن پایین کارت */
.cat-card__body {
    padding: 14px 16px 16px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.cat-card__title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    position: relative;
    transition: color 0.2s ease;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.cat-card:hover .cat-card__title { color: #4f46e5; }

.cat-card__desc {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    position: relative;
    margin-top: 2px;
}

/* badge تعداد زیردسته یا محصول - روی گوشه عکس */
.cat-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.4);
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* badge سبز برای محصولات */
.cat-card__badge--product {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    box-shadow: 0 4px 10px -2px rgba(16, 185, 129, 0.4);
}

/* ===== گرید محصولات (در استایل متفاوت) ===== */
.prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}

.prod-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.prod-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    border-color: #10b981;
}

.prod-card__image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f9fafb;
    position: relative;
}
.prod-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.prod-card:hover .prod-card__image img { transform: scale(1.05); }

.prod-card__discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc2626;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.prod-card__body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.prod-card__brand {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 4px;
}
.prod-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}
.prod-card__price { margin-top: auto; }
.prod-card__price-original {
    font-size: 0.78rem;
    color: #9ca3af;
    text-decoration: line-through;
    margin-bottom: 2px;
}
.prod-card__price-current {
    font-size: 1.05rem;
    font-weight: 700;
    color: #10b981;
}
.prod-card__price-current small {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6b7280;
}

/* ===== حالت خالی ===== */
.cat-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.cat-empty__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    color: #cbd5e1;
}
.cat-empty__title {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 8px;
}
.cat-empty__desc {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 20px;
}

/* ===== نوار کناری (در صورت نیاز) ===== */
.cat-browse__sidebar-toggle {
    display: none;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .cat-browse { padding: 16px 12px 40px; }
    .cat-browse__title { font-size: 1.4rem; }
    .cat-browse__header { padding: 16px; margin-bottom: 20px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .cat-card { border-radius: 14px; }
    .cat-card__body { padding: 10px 10px 12px; }
    .cat-card__title { font-size: 0.88rem; }
    .cat-card__desc { font-size: 0.72rem; -webkit-line-clamp: 1; }
    .cat-card__badge { font-size: 0.62rem; padding: 3px 8px; top: 8px; left: 8px; }
    .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .prod-card__image { height: 140px; }
}

@media (max-width: 480px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cat-card__body { padding: 8px 8px 10px; }
    .cat-card__title { font-size: 0.82rem; }
    .cat-card__desc { display: none; }
    .prod-card__image { height: 120px; }
}
