/* بهبود نمایش بخش‌های اسکرول در موبایل */

/* تنظیمات کلی برای موبایل */
@media only screen and (max-width: 767px) {
    /* غیرفعال کردن اسکرول افقی در موبایل */
    html {
        scroll-snap-type: y proximity !important;
    }
    
    /* تنظیم ارتفاع بخش‌ها */
    .scroll-section {
        min-height: 100vh;
        height: auto !important;
        scroll-snap-align: start;
        padding: 60px 0;
    }
    
    /* بخش Feature Area */
    #feature-area {
        padding: 80px 0 !important;
    }
    
    #feature-area .scroll-content {
        animation: none !important;
    }
    
    #feature-area .feature-single {
        margin-bottom: 30px;
        padding: 20px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 15px;
        backdrop-filter: blur(10px);
        transition: transform 0.3s ease;
    }
    
    #feature-area .feature-single:active {
        transform: scale(0.98);
    }
    
    #feature-area .feature-single .icon {
        font-size: 40px;
        margin-bottom: 15px;
    }
    
    #feature-area .feature-single h4 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    #feature-area .feature-single p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* بخش Why Choose Area */
    #why-chose-area {
        padding: 80px 0 !important;
    }
    
    #why-chose-area .scroll-content {
        animation: none !important;
    }
    
    /* گالری محصول در موبایل */
    #why-chose-area .product-gallery {
        margin-bottom: 40px;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    #why-chose-area .product-gallery img {
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    /* ویژگی‌های Why Choose */
    #why-chose-area .why-chose-single {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 15px;
        padding: 20px;
        margin-bottom: 20px;
        backdrop-filter: blur(10px);
        text-align: right;
        transition: transform 0.3s ease;
    }
    
    #why-chose-area .why-chose-single:active {
        transform: scale(0.98);
    }
    
    #why-chose-area .why-chose-single i {
        font-size: 35px;
        color: #504D9C;
        margin-bottom: 15px;
        display: block;
    }
    
    #why-chose-area .why-chose-single h4 {
        font-size: 17px;
        margin-bottom: 10px;
        color: #fff;
    }
    
    #why-chose-area .why-chose-single p {
        font-size: 14px;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.8);
    }
    
    /* بخش Product Area در موبایل */
    #product-area {
        padding: 60px 0 !important;
    }
    
    #product-area .scroll-content {
        animation: none !important;
    }
    
    /* اسلایدر محصولات در موبایل */
    .mobile-product-slider {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding: 20px 0;
        margin: 0 -15px;
    }
    
    .mobile-product-slider::-webkit-scrollbar {
        height: 4px;
    }
    
    .mobile-product-slider::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }
    
    .mobile-product-slider::-webkit-scrollbar-thumb {
        background: #504D9C;
        border-radius: 2px;
    }
    
    .mobile-product-wrapper {
        display: flex;
        gap: 20px;
        padding: 0 15px;
    }
    
    .mobile-product-item {
        flex: 0 0 85%;
        scroll-snap-align: center;
    }
    
    /* کارت محصول در موبایل */
    .product-card {
        height: 350px !important;
        margin-bottom: 0;
    }
    
    .product-card-front,
    .product-card-back {
        border-radius: 12px;
    }
    
    .product-image img {
        border-radius: 12px 12px 0 0;
    }
    
    .product-badge {
        font-size: 11px;
        padding: 4px 12px;
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .product-category,
    .product-colors {
        font-size: 13px;
    }
    
    .product-description {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .price-value {
        font-size: 18px;
    }
    
    .product-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    /* دکمه مشاهده همه محصولات */
    .view-all-btn {
        margin-top: 30px;
        padding: 10px 25px;
        font-size: 14px;
    }
    
    /* بخش FAQ */
    #faq-area {
        padding: 80px 0 !important;
    }
    
    #faq-area .scroll-content {
        animation: none !important;
    }
    
    /* نوار ناوبری اسکرول */
    .scroll-nav {
        display: none;
    }
    
    /* انیمیشن ساده برای ورود */
    .scroll-content {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
    
    /* بهبود فاصله‌گذاری */
    .section-heading {
        margin-top: 40px !important;
        margin-bottom: 30px !important;
        padding: 0 15px;
    }
    
    .section-heading h2 {
        margin-bottom: 15px !important;
    }
    
    .section-heading p {
        margin-bottom: 0 !important;
    }

    /* اصلاح فاصله‌گذاری برای بخش‌های مختلف */
    #feature-area,
    #why-chose-area,
    #product-area,
    #newsletter-area,
    #contact-area {
        padding-top: 90px !important; /* Increased for header clearance */
        padding-bottom: 60px !important;
    }

    /* حذف پدینگ اضافی از برخی بخش‌ها */
    .section-heading.text-center.pt-5 {
        padding-top: 0 !important;
    }
}

/* تنظیمات برای موبایل‌های کوچک */
@media only screen and (max-width: 479px) {
    #feature-area .feature-single,
    #why-chose-area .why-chose-single {
        padding: 15px;
    }
    
    #feature-area .feature-single .icon {
        font-size: 35px;
    }
    
    #why-chose-area .why-chose-single i {
        font-size: 30px;
    }
    
    .section-heading h2 {
        font-size: 24px !important;
        line-height: 34px !important;
    }
    
    #why-chose-area .product-gallery {
        max-width: 250px;
    }
    
    .mobile-product-item {
        flex: 0 0 90%;
    }
    
    .product-card {
        height: 320px !important;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .product-category,
    .product-colors {
        font-size: 12px;
    }
    
    .product-description {
        font-size: 12px;
    }
    
    .price-value {
        font-size: 16px;
    }
    
    .product-btn {
        padding: 7px 15px;
        font-size: 13px;
    }
}

/* انیمیشن‌های لمسی برای موبایل */
@media (hover: none) and (pointer: coarse) {
    .feature-single,
    .why-chose-single {
        -webkit-tap-highlight-color: transparent;
    }
    
    .feature-single:active,
    .why-chose-single:active {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .product-card {
        -webkit-tap-highlight-color: transparent;
    }
}

/* بهبود اسکرول در iOS */
@supports (-webkit-touch-callout: none) {
    .scroll-section {
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-product-slider {
        -webkit-overflow-scrolling: touch;
    }
}

/* تنظیمات برای لپتاپ (768px - 1366px) برای فضای کافی در هر بخش */
@media screen and (min-width: 768px) and (max-width: 1366px) {
    body {
        transform: none !important;
        zoom: normal !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    html {
        zoom: normal !important;
        -moz-transform: none !important; /* Reset Firefox specific scaling */
    }

    .scroll-section {
        padding: 160px 40px 80px 40px !important; /* افزایش بیشتر پدینگ بالا به 160px */
        min-height: 100vh; 
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100% !important;
        box-sizing: border-box;
    }

    .section-inner {
        width: 100%;
        max-width: 1140px; /* عرض استاندارد برای محتوا در این اندازه صفحه */
        margin: 0 auto;
        padding: 0 20px; /* پدینگ داخلی برای محتوا */
        box-sizing: border-box;
    }
    
    .section-inner .container { /* اطمینان از هم‌راستایی با section-inner */
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 auto !important; /* مرکزیت در section-inner */
    }

    .section-heading {
        text-align: center;
        margin-top: 0; 
        margin-bottom: 50px !important; 
    }

    .section-heading h2 {
        font-size: 36px !important; 
        line-height: 1.3 !important;
        margin-bottom: 20px !important;
    }

    .section-heading p {
        font-size: 18px !important; 
        line-height: 1.7 !important;
        max-width: 750px; 
        margin-left: auto;
        margin-right: auto;
    }

    #feature-area .feature-single,
    #why-chose-area .why-chose-single {
        padding: 30px; /* پدینگ داخلی کارت‌ها */
        margin-bottom: 30px; 
    }
    
    #feature-area .feature-single .icon,
    #why-chose-area .why-chose-single i {
        font-size: 48px; 
        margin-bottom: 20px;
    }

    #feature-area .feature-single h4,
    #why-chose-area .why-chose-single h4 {
        font-size: 22px; 
        margin-bottom: 15px;
    }

    #feature-area .feature-single p,
    #why-chose-area .why-chose-single p {
        font-size: 16px; /* افزایش اندازه فونت متن کارت‌ها */
    }
    
    #product-area .row.g-4 { 
        justify-content: center; 
    }
    .product-card {
        height: 420px !important; 
        margin-bottom: 30px;
    }
    .product-card .product-title {
        font-size: 22px;
    }
    .product-card .product-description {
        font-size: 15px;
    }
     .product-card .price-value {
        font-size: 20px;
    }


    #why-chose-area .product-gallery {
        text-align: center; /* مرکز کردن گالری */
    }
    #why-chose-area .product-gallery img {
        max-height: 450px; 
        width: auto;
        border-radius: 15px;
    }
    
    #why-chose-area .why-chose-cont {
        padding-top: 20px; /* فاصله از گالری */
    }


    #newsletter-area .form-control,
    #contact-area .form-control {
        font-size: 16px;
        padding: 15px;
    }
    #newsletter-area button, /* استایل برای دکمه‌های فرم */
    #contact-area button[type="submit"] {
        font-size: 16px;
        padding: 15px 30px;
    }

    #contact-area .section-heading { /* Targeting heading within contact-area */
        margin-top: 40px !important; /* Additional top margin for contact section heading */
    }
}

/* تنظیمات برای لپتاپ‌های با رزولوشن بالاتر (1367px به بالا) */
@media screen and (min-width: 1367px) {
    body {
        transform: none !important;
        zoom: normal !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    html {
        zoom: normal !important;
        -moz-transform: none !important;
    }

    .scroll-section {
        padding: 130px 50px 100px 50px !important; /* افزایش پدینگ بالا، چپ/راست 50، پایین 100 */
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100% !important;
        box-sizing: border-box;
    }

    .section-inner {
        width: 100%;
        max-width: 1320px; /* عرض محتوای بیشتر */
        margin: 0 auto;
        padding: 0 25px;
        box-sizing: border-box;
    }
    
    .section-inner .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
    }

    .section-heading {
        margin-bottom: 60px !important;
    }

    .section-heading h2 {
        font-size: 42px !important; 
        margin-bottom: 25px !important;
    }

    .section-heading p {
        font-size: 20px !important; 
        max-width: 850px;
    }

    #feature-area .feature-single,
    #why-chose-area .why-chose-single {
        padding: 35px; /* پدینگ بیشتر برای کارت‌ها */
    }
    #feature-area .feature-single h4,
    #why-chose-area .why-chose-single h4 {
        font-size: 24px; 
    }
     #feature-area .feature-single p,
    #why-chose-area .why-chose-single p {
        font-size: 17px; 
    }

    .product-card {
        height: 450px !important;
    }
     .product-card .product-title {
        font-size: 24px;
    }
    .product-card .product-description {
        font-size: 16px;
    }
     .product-card .price-value {
        font-size: 22px;
    }
}

/* حذف استایل‌های مربوط به zoom و transform:scale برای فایرفاکس در این سایزها */
@supports (-moz-appearance:none) {
    @media screen and (min-width: 768px) { /* اعمال برای تمام سایزهای لپتاپ و بالاتر */
        body {
            /* اگر قبلا transform یا width خاصی برای فایرفاکس تنظیم شده بود، اینجا ریست شود */
            /* width: 100% !important; (اگر لازم است) */
            /* transform: none !important; (اگر لازم است) */
        }
        html {
            /* transform-origin: initial !important; (اگر لازم است) */
            /* transform: none !important; (اگر لازم است) */
        }
    }
} 