/* --- متغیرهای رنگی و تنظیمات پایه --- */
:root {
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --dark-color: #1e293b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-color: #334155;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- کانتینر عمومی --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-title p {
    color: #64748b;
    font-size: 1.1rem;
}

/* --- دکمه‌ها --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50px;
    font-weight: 500;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Vazirmatn', sans-serif;
}

.btn:hover {
    background-color: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ================================================ */
/* ===== بخش 1: اسلایدر ===== */
/* ================================================ */
.hero-slider {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.slide.active {
    opacity: 1;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    max-width: 800px;
    padding: 20px;
}

.slide-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.slide-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background-color: var(--white);
    transform: scale(1.2);
}

/* ================================================ */
/* ===== بخش 2: درباره ما ===== */
/* ================================================ */
.about-image {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s;
}

.about-image:hover img {
    transform: scale(1.05);
}

.about-text h3 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

/* ================================================ */
/* ===== بخش 3: خدمات ===== */
/* ================================================ */
.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid var(--primary-color);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.15);
}

.service-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.service-card p {
    flex-grow: 1;
    margin-bottom: 20px;
}

/* ================================================ */
/* ===== بخش 4: محصولات ===== */
/* ================================================ */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--primary-color);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.15);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 700;
    text-transform: uppercase;
}

.product-title {
    font-size: 1.2rem;
    margin: 5px 0 10px;
    color: var(--dark-color);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* ================================================ */
/* ===== بخش 5: تیم ===== */
/* ================================================ */
.team-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid var(--primary-color);
}

.team-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.15);
}

.team-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    border: 4px solid var(--light-bg);
}

.team-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.team-role {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.team-card .btn {
    margin-top: auto;
}

/* ================================================ */
/* ===== بخش 6: مقالات ===== */
/* ================================================ */
.blog-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--primary-color);
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.15);
}

.blog-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-img {
    transform: scale(1.05);
}

.blog-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-date {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 10px;
    display: block;
}

.blog-title {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}

.read-more:hover {
    color: var(--secondary-color);
    gap: 10px;
}

/* ================================================ */
/* ===== واکنش‌گرایی ===== */
/* ================================================ */
@media (max-width: 1024px) {
    .slide-content h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 992px) {
    .section-padding {
        padding: 60px 0;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 400px;
    }
    
    .slide-content h1 {
        font-size: 2rem;
    }
    
    .slide-content p {
        font-size: 1rem;
    }
    
    .section-padding {
        padding: 40px 0;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .about-text h3 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .hero-slider {
        height: 350px;
    }
    
    .slide-content h1 {
        font-size: 1.5rem;
    }
    
    .slide-content p {
        font-size: 0.9rem;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .service-card {
        padding: 30px 20px;
    }
}


/* ================================================ */
/* ===== فیلتر دسته بندی محصولات ===== */
/* ================================================ */
.product-filters .filter-btn {
    padding: 8px 24px;
    border-radius: 50px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.product-filters .filter-btn:hover,
.product-filters .filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* ================================================ */
/* ===== استایل رگال (افقی) ===== */
/* ================================================ */
.ragal-wrapper {
    padding: 10px 0;
}

.ragal-container {
    display: flex;
    overflow-x: hidden; /* اسکرول بار مخفی است، با دکمه‌ها اسکرول می‌شود */
    scroll-behavior: smooth;
    gap: 0; /* از gap استفاده نمی‌کنیم تا انیمیشن محو شدن روان باشد */
    padding: 20px 0;
}

/* مخفی کردن اسکرول بار برای ظاهر تمیزتر */
.ragal-container::-webkit-scrollbar {
    display: none;
}
.ragal-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.ragal-item {
    /* عرض کارت در حالت رگال */
    min-width: 280px; 
    max-width: 280px;
    flex-shrink: 0;
    margin: 0 12px; /* فاصله بین کارت‌ها */
    transition: all 0.4s ease;
    opacity: 1;
    transform: scale(1);
}

/* کلاسی که در زمان فیلتر شدن به محصولات نامرتبط اضافه می‌شود */
.ragal-item.hidden-item {
    opacity: 0;
    width: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    transform: scale(0.8);
    pointer-events: none;
}

/* دکمه‌های چپ و راست رگال */
.ragal-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ragal-btn:hover {
    background: var(--primary-color);
    color: white;
}

.ragal-prev {
    right: -20px; /* قرارگیری در سمت راست */
}

.ragal-next {
    left: -20px; /* قرارگیری در سمت چپ */
}

@media (max-width: 768px) {
    .ragal-item {
        min-width: 240px;
        max-width: 240px;
    }
    .ragal-prev { right: 5px; }
    .ragal-next { left: 5px; }
    .ragal-btn { width: 35px; height: 35px; font-size: 0.8rem; }
}

@media (max-width: 768px) {
    .product-filters {
        /* خنثی کردن وسط‌چین و ردیف شدن بوت‌استرپ */
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        
        /* تنظیمات اسکرول */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch; /* اسکرول نرم روی آیفون */
        padding: 8px 16px;
        
        /* مخفی کردن اسکرول‌بار */
        scrollbar-width: none; /* فایرفاکس */
        -ms-overflow-style: none; /* اینترنت اکسپلورر/اج */
    }

    .product-filters::-webkit-scrollbar {
        display: none; /* کروم و سافاری */
    }

    .filter-btn {
        scroll-snap-align: start; /* چسبیدن مگنتی به لبه */
        flex-shrink: 0; /* جلوگیری از جمع شدن دکمه‌ها */
    }

    /* افکت محو شدن لبه‌ها برای حس رگال بودن */
    .product-filters {
        -webkit-mask-image: linear-gradient(to left, transparent 0%, black 3%, black 97%, transparent 100%);
        mask-image: linear-gradient(to left, transparent 0%, black 3%, black 97%, transparent 100%);
    }
}


/* کانتینر رگال - فقط اسکرول ساده */
.ragal-container {
    display: flex;
    gap: 24px;
    overflow-x: auto; /* همین خط اسکرول با موس و دست رو فعال می‌کنه */
    scroll-behavior: smooth; /* برای اینکه با زدن دکمه نرم بره */
    -webkit-overflow-scrolling: touch; /* نرمی اسکرول روی آیفون */
    scrollbar-width: none; /* مخفی کردن اسکرول بار در فایرفاکس */
    -ms-overflow-style: none; /* مخفی کردن در اینترنت اکسپلورر */
}

.ragal-container::-webkit-scrollbar {
    display: none; /* مخفی کردن اسکرول بار در کروم و سافاری */
}

/* ریسپانسیو کردن عرض کارت‌ها (مهمترین بخش) */
/* اگر این رو نذاریم، کارت‌ها کوچیک میشن تا جا بشن و دیگه اسکرولی در کار نیست */
.ragal-item {
    flex-shrink: 0;
    width: 85%; /* موبایل: حدودا یک کارت و نیم دیده بشه */
}

@media (min-width: 576px) {
    .ragal-item { width: 50%; } /* تبلت: دو کارت */
}

@media (min-width: 992px) {
    .ragal-item { width: 33.333%; } /* لپ‌تاپ: سه کارت */
}

@media (min-width: 1200px) {
    .ragal-item { width: 25%; } /* دسکتاپ: چهار کارت */
}