/* =========================================
   پروفایل هدر
   ========================================= */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: clamp(25px, 5vw, 40px) clamp(15px, 4vw, 30px);
    border-radius: var(--radius-xl);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: clamp(15px, 4vw, 30px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.15);
}

.profile-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><circle cx="50" cy="50" r="40" fill="none" stroke="white" stroke-width="2"/><circle cx="50" cy="50" r="30" fill="none" stroke="white" stroke-width="2"/><circle cx="50" cy="50" r="20" fill="none" stroke="white" stroke-width="2"/></svg>') repeat;
    animation: rotate 40s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ===== لوگو و تیک آبی ===== */
.mall-logo-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    z-index: 2;
}

.profile-logo-img {
    width: clamp(80px, 20vw, 110px);
    height: clamp(80px, 20vw, 110px);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
    background: var(--white);
}

/* تیک تأیید (verified) */
.verified-badge {
    position: absolute;
    bottom: 2px;
    /* هوشمند RTL/LTR: در RTL سمت چپ، در LTR سمت راست */
    inset-inline-end: 2px;
    background: var(--primary);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.4);
    z-index: 10;
}

.verified-badge svg {
    width: 14px;
    height: 14px;
}

/* فال‌بک: اگر از img قدیمی (بدون wrapper) استفاده شود */
.profile-header > img {
    width: clamp(80px, 20vw, 110px);
    height: clamp(80px, 20vw, 110px);
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    background: var(--white);
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

/* ===== اطلاعات پروفایل ===== */
.profile-info {
    flex: 1;
    position: relative;
    z-index: 2;
}

.profile-info h2 {
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 700;
    margin: 0 0 5px;
    letter-spacing: 0.3px;
    color: var(--white);
}

.profile-username {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    display: inline-block;
}

/* ===== آمار دنبال‌کنندگان ===== */
.follow-stats {
    display: flex;
    gap: clamp(10px, 3vw, 20px);
    flex-wrap: wrap;
}

.follow-stats a {
    text-decoration: none;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: clamp(6px, 2vw, 8px) clamp(12px, 3vw, 20px);
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
}

.follow-stats a strong {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 700;
    margin-inline-start: 4px;
}

@media (hover: hover) {
    .follow-stats a:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* =========================================
   گرید محصولات
   ========================================= */
.products-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    padding-bottom: 10px;
}

/* خط زیر عنوان - هوشمند RTL/LTR */
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-sm);
}

.product-count {
    background: var(--light-gray);
    padding: 8px 20px;
    border-radius: var(--radius-full);
    color: var(--gray);
    font-size: 14px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* =========================================
   کارت محصول
   ========================================= */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%; /* اضافه شود */
    border: 1px solid var(--border);
    cursor: pointer;
    animation: fadeInCard 0.4s ease-out forwards;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

/* ===== بخش تصویر ===== */
.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: var(--light-gray);
}

.product-image-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

/* ===== نگهدارنده برچسب‌ها ===== */
.product-badges-wrapper {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
    align-items: flex-start;
}

/* ===== برچسب‌های محصول (بدون تداخل با .badge هدر) ===== */
.product-badge {
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    line-height: 1.4;
}

.badge-banned { background: #fee2e2; color: var(--danger); }
.badge-draft  { background: var(--gray-200); color: var(--secondary); }
.badge-sale   {
    background: #ff4d4f;
    color: var(--white);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== محتوای کارت ===== */
.product-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: start;
}

.product-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
    line-height: 1.5;
    height: 2.25em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 12px;
    line-height: 1.6;
    height: 3.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ===== فروشنده ===== */
.product-meta {
    margin-bottom: 12px;
}

.seller-info {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    transition: opacity 0.2s;
}

.seller-info:hover { opacity: 0.75; }

.seller-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.seller-username {
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
}

/* ===== آمار کارت ===== */
.product-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--gray);
}

.stat-item img {
    width: 14px;
    height: 14px;
    opacity: 0.55;
}

/* ===== قیمت ===== */
.product-price {
    margin-top: auto;
    font-size: 17px;
    font-weight: 800;
    color: var(--success);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.product-price del {
    font-size: 13px;
    color: var(--gray);
    font-weight: 400;
}

/* ===== نوار اکشن پایین کارت ===== */
.footer-bar {
    display: flex;
    background: var(--light-gray);
    border-top: 1px solid var(--border);
    padding: 6px 4px;
    justify-content: space-around;
    z-index: 3;
}

.footer-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 3px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
    flex: 1;
    color: var(--gray);
}

.footer-bar a:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.footer-bar .footer-label {
    font-size: 10px;
    color: var(--gray);
    font-weight: 600;
}

/* =========================================
   ریسپانسیو
   ========================================= */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }

    .product-card {
        border-radius: var(--radius-md);
        
    }

    .product-title { font-size: 14px; }
    .product-price { font-size: 15px; }

    .footer-bar .footer-label {
        display: none;
    }

    .section-header h2::after {
        inset-inline-start: 50%;
        transform: translateX(-50%);
    }

    /* لوگو و تیک در موبایل */
    .profile-logo-img {
        width: 90px;
        height: 90px;
    }

    .verified-badge {
        width: 26px;
        height: 26px;
        bottom: 0;
        inset-inline-end: 0;
    }

    .verified-badge svg {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 576px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info {
        text-align: center;
        width: 100%;
    }

    .follow-stats {
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .products-section {
        padding: 20px 15px;
        border-radius: var(--radius-lg);
    }

    .section-header {
        flex-direction: column;
        text-align: center;
    }
}
/* =========================================
   استایل‌های دارک مود (Dark Mode)
   ========================================= */

/* پس‌زمینه بخش اصلی محصولات */
[data-theme="dark"] .products-section {
    background: #1a1d21;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* عنوان بخش */
[data-theme="dark"] .section-header h2 {
    color: #e6edf3;
}

/* تعداد محصولات */
[data-theme="dark"] .product-count {
    background: #2d333b;
    color: #adbac7;
}

/* کارت محصول */
[data-theme="dark"] .product-card {
    background: #22272e;
    border-color: #373e47;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* پس زمینه جایگزین عکس تا زمان لود شدن */
[data-theme="dark"] .product-image-wrapper {
    background: #2d333b;
}

/* متون داخل کارت */
[data-theme="dark"] .product-title {
    color: #e6edf3;
}

[data-theme="dark"] .product-description {
    color: #adbac7;
}

[data-theme="dark"] .seller-username {
    color: #adbac7;
}

/* آمار کارت (خط جداکننده و متن) */
[data-theme="dark"] .product-stats {
    border-top-color: #373e47;
}

[data-theme="dark"] .stat-item {
    color: #8b949e;
}

/* نوار اکشن پایین کارت (فوتر کارت) */
[data-theme="dark"] .footer-bar {
    background: #1c2128;
    border-top-color: #373e47;
}

[data-theme="dark"] .footer-bar a {
    color: #adbac7;
}

[data-theme="dark"] .footer-bar a:hover {
    background: #2d333b;
    color: var(--primary); /* در صورت هاور شدن رنگ اصلی سایت را می‌گیرد */
}

[data-theme="dark"] .footer-bar .footer-label {
    color: #adbac7;
}

/* حاشیه و پس‌زمینه عکس پروفایل */
[data-theme="dark"] .profile-logo-img {
    background: #22272e;
    border-color: rgba(255, 255, 255, 0.1);
}

/* برچسب پیش‌نویس (Draft) که در حالت لایت خاکستری بود */
[data-theme="dark"] .badge-draft {
    background: #373e47;
    color: #adbac7;
}
/* =========================================
   حالت پایه (حالت روز / Light Mode)
========================================= */
.category-bar {
    display: flex;
    align-items: center;
    gap: 8px; 
    background-color: #f7fafc; /* پس‌زمینه روشن */
    padding: 10px 18px;
    border-radius: 8px; 
    border: 1px solid #e2e8f0; /* حاشیه روشن */
    width: fit-content;
    margin-bottom: 20px; 
}

.category-icon {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568; /* رنگ متن تیره برای حالت روز */
    display: flex;
    align-items: center;
}

.category-icon::after {
    content: '/'; 
    color: #a0aec0;
    margin: 0 8px 0 4px;
}

.category-name a {
    color: #3182ce; /* لینک آبی مناسب برای پس‌زمینه روشن */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out; 
}

.category-name a:hover {
    color: #2b6cb0; 
    text-decoration: underline;
    text-underline-offset: 4px; 
}

/* =========================================
   حالت شب (Dark Mode)
/* =========================================
   حالت شب (Dark Mode) برای نوار دسته‌بندی
========================================= */

[data-theme="dark"] .category-bar {
    background-color: #1a202c;
    border-color: #2d3748;
}

[data-theme="dark"] .category-icon {
    color: #a0aec0;
}

[data-theme="dark"] .category-icon::after {
    color: #4a5568;
}

[data-theme="dark"] .category-name a {
    color: #63b3ed;
}

[data-theme="dark"] .category-name a:hover {
    color: #90cdf4;
}
