/* --- تنظیمات پایه --- */
:root {
    --primary: #0f172a;
    --accent: #3b82f6;
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --container: 1280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: #334155; }

.btn-outline { border-color: var(--border); background-color: white; color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 2.2rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.section-title p { color: var(--text-muted); font-size: 1.1rem; }

/* --- 1. نو بار بالا (Top Bar) --- */
.top-bar {
    background-color: var(--primary);
    color: #cbd5e1;
    padding: 10px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.top-bar-content { display: flex; justify-content: space-between; align-items: center; }
.top-info span { margin-inline-start: 20px; }
.top-info i { margin-inline-end: 5px; color: var(--accent); }

.lang-select {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

/* --- 2. هدر (Header) --- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border);
    height: 80px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.navbar { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu { display: flex; gap: 32px; align-items: center; height: 100%; }

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 10px;
    padding-bottom: 10px;
    cursor: pointer;
}

.nav-link { font-size: 0.95rem; font-weight: 500; color: var(--text-main); padding: 8px 0; }
.nav-link:hover, .nav-link.active { color: var(--accent); }

.chevron { font-size: 0.7rem; margin-right: 5px; transition: transform 0.2s; }
.nav-item:hover .chevron { transform: rotate(180deg); }

/* --- مگا منو --- */




.nav-item.open .mega-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.mega-sidebar {
    background-color: #f8fafc;
    border-left: 1px solid var(--border);
    padding: 20px 0;
}

/* اصلاح حاشیه سایدبار در حالت راست‌چین */
html[dir="rtl"] .mega-sidebar {
    border-left: none;
    border-right: 1px solid var(--border);
}

.cat-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.cat-item:hover, .cat-item.active { background-color: white; color: var(--primary); font-weight: 600; }

.mega-content { padding: 30px; background-color: white; }
.mega-panel { display: none; animation: fadeIn 0.3s ease; }
.mega-panel.active { display: block; }
.mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

.mini-card {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius);
    transition: background 0.2s;
    cursor: pointer;
}
.mini-card:hover { background-color: #f1f5f9; }
.mini-card img { width: 80px; height: 80px; border-radius: 6px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   --- 3. اسلایدر تصویر (نسخه بی‌نقص درگ و لمسی) ---
   =================================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 600px; 
    overflow: hidden; 
    touch-action: pan-y; /* اجازه اسکرول عمودی، اما کنترل افقی دست ماست */
    user-select: none; 
    margin-bottom: 60px;
    cursor: grab;
}
.hero-slider:active { cursor: grabbing; }

/* اورلی تاریک برای خوانایی 100% متن روی هر عکسی */
.slide::after {
    content: '';
    position: absolute;
    inset: 0;
    /*background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));*/
    z-index: 1;
    pointer-events: none; /* جلوگیری از تداخل با کلیک و درگ */
}

.slides-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.slide {
    flex: 0 0 100%; 
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

.slide-content h1 { 
    font-size: 3.2rem; 
    margin-bottom: 20px; 
    font-weight: 800; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); 
}

.slide-content p { 
    font-size: 1.25rem; 
    margin-bottom: 35px; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    width: 55px; height: 55px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.slider-btn:hover { 
    background: white; 
    color: var(--primary); 
    border-color: white;
}

.prev-btn { left: 25px; }
.next-btn { right: 25px; }

/* جابجایی دکمه‌ها در حالت راست‌چین */
html[dir="rtl"] .prev-btn { left: auto; right: 25px; }
html[dir="rtl"] .next-btn { right: auto; left: 25px; }


/* --- 4. بخش‌های محتوا --- */
.section { padding: 80px 0; }
.bg-white { background: white; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-img img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }

.custom-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.custom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.card-img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.card-img-wrapper img.card-img-top, .card-img-top {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
}

.custom-card:hover .card-img-top { transform: scale(1.05); }

.custom-card .card-icon {
    width: 70px; height: 70px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; border-radius: 50%;
    background: #eff6ff; padding: 10px;
}
.custom-card .card-icon img { width: 100%; height: 100%; object-fit: contain; }

.custom-card .card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.custom-card .card-title {
    font-size: 1.15rem; font-weight: 700; color: var(--primary);
    margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2rem; line-height: 1.4;
}

.custom-card .card-text {
    color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}

.custom-card .btn { margin-top: auto; transition: all 0.3s ease; }
.custom-card .btn:hover { transform: scale(1.02); }

.custom-card .btn-outline-primary { color: var(--accent); border: 1px solid var(--accent); background: transparent; width: 100%; }
.custom-card .btn-outline-primary:hover { background: var(--accent); color: white; }

.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-icon { width: 60px; height: 60px; background: #eff6ff; color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 20px; }
.card-price { font-size: 1.3rem; font-weight: 900; color: var(--accent); margin-bottom: 15px; display: block; }

.team-img { width: 100%; height: 300px; }
.team-info { padding: 20px; text-align: center; }
.team-role { color: var(--text-muted); font-size: 0.9rem; }

/* --- فوتر --- */
footer { background-color: #0f172a; color: #94a3b8; padding: 60px 0 20px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: white; margin-bottom: 20px; font-size: 1.1rem; }
.footer-col ul li { margin-bottom: 10px; transition: 0.2s; cursor: pointer; }
.footer-col ul li:hover { color: var(--accent); padding-inline-start: 5px; }
.social-icons a { display: inline-flex; width: 40px; height: 40px; background: rgba(255,255,255,0.1); align-items: center; justify-content: center; border-radius: 50%; margin-left: 10px; color: white; transition: 0.3s; }
.social-icons a:hover { background: var(--accent); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; }

/* --- ریسپانسیو --- */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    
    /* ریسپانسیو اسلایدر */
    .hero-slider { height: 60vh; }
    .slide-content h1 { font-size: 2rem; }
    .slide-content p { font-size: 1rem; margin-bottom: 25px; }
    .slider-btn { width: 40px; height: 40px; font-size: 0.9rem; }
    .prev-btn { left: 15px; }
    .next-btn { right: 15px; }
    html[dir="rtl"] .prev-btn { left: auto; right: 15px; }
    html[dir="rtl"] .next-btn { right: auto; left: 15px; }

    /* ریسپانسیو بقیه اجزا */
    .about-grid { grid-template-columns: 1fr; }
    .card-img-wrapper { height: 180px; }
    .custom-card .card-title { font-size: 1rem; min-height: 2.8rem; }
    .custom-card .card-body { padding: 16px; }
    .section-title h2 { font-size: 1.8rem; }
}

@media (max-width: 576px) {
    .card-img-wrapper { height: 160px; }
    .custom-card .card-body { padding: 14px; }
    .custom-card .card-title { font-size: 0.95rem; }
    .custom-card .card-text { font-size: 0.85rem; }
}

/* ========== BLOG BUTTON ========== */
.blog-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 0;
    margin-top: auto;
    position: relative;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.blog-btn i {
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

/* ========== HOVER ========== */
.blog-btn:hover {
    color: #6b2a2a;
    gap: 12px;
}

.blog-btn:hover i {
    transform: translateX(-5px);
}

/* ========== LINE UNDER BUTTON ========== */
.blog-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to left, #0f172a, #0f172a);
    transition: all 0.4s ease;
    border-radius: 10px;
}

.blog-btn:hover::after {
    width: 100%;
    right: auto;
    left: 0;
}

/* ========== RESPONSIVE ========== */

/* تبلت */
@media (max-width: 768px) {
    .blog-btn {
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .blog-btn i {
        font-size: 0.8rem;
    }
    
    .blog-btn:hover {
        gap: 10px;
    }
}

/* موبایل */
@media (max-width: 576px) {
    .blog-btn {
        font-size: 0.8rem;
        gap: 5px;
        padding: 6px 0;
    }
    
    .blog-btn i {
        font-size: 0.75rem;
    }
    
    .blog-btn:hover {
        gap: 8px;
    }
    
    .blog-btn::after {
        height: 1.5px;
    }
}

.product-card{
    height: 450px;
}

.product-card .card-img-wrapper {
    height: 350px; /* یا هر مقداری که میخواید */
    overflow: hidden; /* برای برش اضافی */
}

.product-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
}

