/* ضمیره‌بندی فونت‌های فارسی */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

/* فونت ثانویه IRANSans */
@font-face {
    font-family: 'IRANSans';
    src: url('../../fonts/IRANSansWeb.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('../../fonts/IRANSansWeb_Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('../../fonts/IRANSansWeb_Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('../../fonts/IRANSansWeb_Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('../../fonts/IRANSansWeb_UltraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

/* تنظیمات پایه */
* {
    font-family: var(--site-font, 'Vazirmatn', 'IRANSans', sans-serif);
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    background-color: #f8fafc;
    color: #1e293b;
    font-family: var(--site-font, 'Vazirmatn', 'IRANSans', sans-serif);
}

/* فونت سایت (انتخاب‌شده از پنل مدیریت) */
html[data-font="iransans"] { --site-font: 'IRANSans', 'Vazirmatn', sans-serif; }
html[data-font="vazirmatn"] { --site-font: 'Vazirmatn', 'IRANSans', sans-serif; }

/* کنترل اندازه فونت (از پنل مدیریت) — متن عادی با font-size ریشه و عنوان‌ها با ضریب جداگانه */
html { font-size: 16px; }
html[data-fs="small"] { font-size: 15px; }
html[data-fs="normal"] { font-size: 16px; }
html[data-fs="large"] { font-size: 17px; }
html[data-fs="xlarge"] { font-size: 18px; }

:root { --heading-scale: 1; }
html[data-fsh="small"] { --heading-scale: 0.9; }
html[data-fsh="normal"] { --heading-scale: 1; }
html[data-fsh="large"] { --heading-scale: 1.15; }
html[data-fsh="xlarge"] { --heading-scale: 1.3; }

html .text-xl { font-size: calc(1.25rem * var(--heading-scale, 1)); }
html .text-2xl { font-size: calc(1.5rem * var(--heading-scale, 1)); }
html .text-3xl { font-size: calc(1.875rem * var(--heading-scale, 1)); }
html .text-4xl { font-size: calc(2.25rem * var(--heading-scale, 1)); }
html .text-5xl { font-size: calc(3rem * var(--heading-scale, 1)); }

/* در حالت موبایل اندازه فونت همه‌جا ۲ واحد کمتر */
@media (max-width: 767px) {
    html { font-size: 14px; }
    html[data-fs="small"] { font-size: 13px; }
    html[data-fs="normal"] { font-size: 14px; }
    html[data-fs="large"] { font-size: 15px; }
    html[data-fs="xlarge"] { font-size: 16px; }
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* انیمیشن‌های ظریف */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in-up {
    animation: fadeInUp 0.5s ease-out both;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* اسکلتون لودینگ محصولات */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: 1rem;
}
@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* کمکی: نمایش خط دوخطی عنوان محصول */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}