﻿/* استایل متن انیمیشنی */
.animated-typewriter {
    position: relative;
    display: inline-block;
    min-height: 1.2em;
    line-height: 1.2;
}

    .animated-typewriter::after {
        content: '|';
        position: absolute;
        right: 0;
        color: var(--cursor-color, #007bff);
        animation: typewriter-blink 1s infinite;
        font-weight: bold;
    }

    .animated-typewriter.hide-cursor::after {
        display: none;
    }

@keyframes typewriter-blink {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0;
    }
}

/* انیمیشن برای حالت RTL */
.animated-typewriter.rtl::after {
    right: auto;
    left: 0;
}

/* استایل‌های اضافی */
.animated-typewriter.highlight {
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: highlight-sweep 2s ease-in-out infinite;
}

@keyframes highlight-sweep {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.productGalleryMain .swiper-slide-active {
    transform: translateX(0%);
    opacity: 1 !important;
}

.productGalleryMain .swiper-slide-next {
    transform: translateX(100%) ;
}

.productGalleryMain .swiper-slide-prev {
    transform: translateX(-100%) ;
}
/* =============================================================================
   PRODUCT GALLERY SWIPER FIXES
   ============================================================================= */

/* Main Gallery Container */
.product-gallery {
    margin-bottom: 30px;
    position: relative;
}

.productGalleryMain {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;

    position: relative !important;
    height: auto; /* ارتفاع ثابت */
}

    /* Critical: Fix swiper wrapper positioning */
    .productGalleryMain .swiper-wrapper {
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 1 !important;
        display: flex !important;
        transition-property: transform !important;
        transform: translate3d(0px, 0px, 0px) !important;
    }

    /* Critical: Fix slide positioning and prevent stacking */
    .productGalleryMain .swiper-slide {
        flex-shrink: 0 !important;
        width: 100% !important;
        height: 100% !important;
        position: relative !important;
        transition-property: transform !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f8f9fa;
    }

        /* Ensure images fit properly */
        .productGalleryMain .swiper-slide img.gallery-main-img {
            width: 100% !important;
            height: 100% !important;
            object-fit: contain !important;
            display: block !important;
            position: relative !important;
        }

        /* Video container in slides */
        .productGalleryMain .swiper-slide .video-container {
            position: relative !important;
            width: 100% !important;
            height: 100% !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }

    /* Navigation buttons - fix selectors */
    .productGalleryMain .swiper-button-next,
    .productGalleryMain .swiper-button-prev {
        background-color: rgba(255, 255, 255, 0.9) !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        color: var(--color-primary) !important;
        font-size: 18px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
        transition: all 0.3s ease !important;
        margin-top: -22px !important;
        z-index: 10 !important;
    }

        .productGalleryMain .swiper-button-next::after,
        .productGalleryMain .swiper-button-prev::after {
            font-size: 18px !important;
            font-weight: 600 !important;
        }

        .productGalleryMain .swiper-button-next:hover,
        .productGalleryMain .swiper-button-prev:hover {
            background-color: var(--color-primary) !important;
            color: white !important;
            transform: scale(1.1) !important;
        }

/* Thumbnails */
.productGalleryThumbs {
    margin-top: 15px !important;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

    .productGalleryThumbs .swiper-slide {
        cursor: pointer;
        opacity: 0.6;
        transition: opacity 0.3s;
        width: auto !important;
        height: 100px !important;
    }

    .productGalleryThumbs .swiper-slide-thumb-active {
        opacity: 1;
    }

    .productGalleryThumbs .thumb-img {
        width: 100px;
        height: 100px;
        object-fit: cover;
        border-radius: 6px;
        border: 2px solid transparent;
        transition: border-color 0.3s;
    }

    .productGalleryThumbs .swiper-slide-thumb-active .thumb-img {
        border-color: var(--color-primary);
    }

/* Single image handling */
.productGalleryMain.single-image .swiper-button-next,
.productGalleryMain.single-image .swiper-button-prev {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .productGalleryMain {
        height: 300px;
    }

    .productGalleryThumbs .thumb-img {
        width: 80px;
        height: 80px;
    }

    .productGalleryMain .swiper-button-next,
    .productGalleryMain .swiper-button-prev {
        width: 36px !important;
        height: 36px !important;
        margin-top: -18px !important;
    }
}

@media (max-width: 480px) {
    .productGalleryMain {
        height: 250px;
    }

    .productGalleryThumbs .thumb-img {
        width: 60px;
        height: 60px;
    }
}

/* Override any conflicting styles */
.productGalleryMain * {
    box-sizing: border-box;
}

/* Ensure proper z-index stacking */
.productGalleryMain .swiper-slide {
    z-index: 1;
}

.productGalleryMain .swiper-slide-active {
    z-index: 2;
}

.productGalleryMain .swiper-button-next,
.productGalleryMain .swiper-button-prev {
    z-index: 10;
}

/* استایل‌های بخش سرچ موبایل - با fade-in effect */
.search-input-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

    .search-input-container.active {
        display: flex;
        opacity: 1;
    }

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.4s ease-out;
}

.search-input-container.active .search-input-wrapper {
    transform: scale(1);
    opacity: 1;
    animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.95) translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.search_39 {
    position: relative;
    margin: 0;
}

.search_form_39 {
    padding: 20px;
    border-radius: 15px;
}

    .search_form_39 .form-control {
        border: none;
        background-color: #f8f9fa;
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 25px;
        box-shadow: none;
        transition: all 0.3s ease;
    }

        .search_form_39 .form-control:focus {
            background-color: #f8f9fa;
            border: 2px solid var(--color-primary);
            box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.2);
            transform: scale(1.02);
        }

.search-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--color-primary);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
}

.search-input-container.active .search-close-btn {
    opacity: 1;
    transform: scale(1);
    animation: fadeInButton 0.5s ease-out 0.2s both;
}

@keyframes fadeInButton {
    0% {
        opacity: 0;
        transform: scale(0.6) rotate(-90deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.search-close-btn:hover {
    background: var(--color-secondary);
    transform: scale(1.1) rotate(90deg);
}

.m-headsearch {
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--rgba-primary-9);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .m-headsearch:hover {
        background-color: var(--color-primary);
        transform: scale(1.1);
    }

        .m-headsearch:hover svg path {
            stroke: white;
        }

/* Search Results با fade effect */
.resault {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-height: 60vh;
    overflow-y: auto;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease-in-out;
    z-index: 10;
}

    .resault.hiddenel {
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
    }

.resault-partial {
    padding: 20px;
    opacity: 0;
    animation: fadeInContent 0.4s ease-out 0.1s both;
}

@keyframes fadeInContent {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide search container on desktop */
@media (min-width: 1200px) {
    .search-input-container {
        display: none !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-input-container {
        padding-top: 60px;
    }

    .search-input-wrapper {
        margin: 0 10px;
        max-width: calc(100% - 20px);
    }

    .search_form_39 {
        padding: 15px;
    }

    .search-close-btn {
        top: -45px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 16px;
        left: auto;
    }
}

/* Backdrop blur effect */
.search-input-container {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

    /* پولیش کردن انیمیشن‌های اضافی */
    .search-input-container.active {
        animation: backdropFadeIn 0.4s ease-out;
    }

@keyframes backdropFadeIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }

    100% {
        opacity: 1;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}