/* Mobile Fix for Product Display */
@media (max-width: 767px) {

    /* Fix for product tab area */
    .product-tab-area .section-capture {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .product-tab-area ul.nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .product-tab-area ul.nav-tabs li {
        margin: 0;
    }

    .product-tab-area ul.nav-tabs li a {
        padding: 8px 15px;
        font-size: 14px;
        white-space: nowrap;
    }

    /* Fix for collection slider */
    .collection-wrap .collection-slider.swiper {
        margin: 0;
        padding: 0 10px;
    }

    .collection-wrap .collection-slider.swiper .swiper-wrapper {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    .collection-wrap .collection-slider.swiper .swiper-slide {
        width: calc(50% - 7.5px) !important;
        margin: 0 !important;
    }

    .collection-wrap .collection-slider.swiper .swiper-slide .single-product-wrap {
        margin: 0 !important;
        width: 100%;
    }

    /* Fix for product images */
    .single-product-wrap .product-image {
        width: 100%;
        margin: 0;
    }

    .single-product-wrap .product-image a.pro-img {
        display: block;
        width: 100%;
        height: auto;
    }

    .single-product-wrap .product-image a.pro-img img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* Fix for product content */
    .single-product-wrap .product-content {
        width: 100%;
        margin: 0;
        padding: 10px 0;
    }

    .single-product-wrap .product-content .product-title h6 {
        font-size: 14px;
        line-height: 1.3;
    }

    .single-product-wrap .product-content .price-box {
        margin: 8px 0;
    }

    .single-product-wrap .product-content .price-box span {
        font-size: 14px;
    }

    /* Fix for product actions */
    .single-product-wrap .product-action {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 10px;
    }

    .single-product-wrap .product-action a {
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .single-product-wrap .product-action a span.product-icon {
        font-size: 14px;
    }

    /* Fix for swiper navigation */
    .collection-wrap .swiper-buttons {
        display: none !important;
    }

    /* Fix for container */
    .container-fluid {
        padding: 0 15px;
    }

    /* Fix for section padding */
    .section-ptb {
        padding: 30px 0;
    }

    /* Ensure proper spacing */
    .product-tab-area {
        padding: 20px 0;
    }

    /* Fix for tab content */
    .tab-content .tab-pane {
        padding: 20px 0;
    }

    /* Fix for collection category */
    .collection-category {
        margin: 0;
    }

    /* Fix for swiper container */
    .swiper {
        overflow: visible;
    }

    /* Fix for product description */
    .single-product-wrap .product-content .product-description {
        display: none;
    }

    /* Fix for product rating */
    .single-product-wrap .product-content .product-ratting {
        display: none;
    }

    /* Fix for trending area */
    .trending-area .single-product-wrap {
        display: block !important;
    }

    .trending-area .single-product-wrap .product-image {
        width: 100% !important;
        margin: 0 !important;
    }

    .trending-area .single-product-wrap .product-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px 0 !important;
        text-align: center !important;
    }

    /* Fix for section title */
    .section-title h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    /* Fix for brand area */
    .brand-area {
        padding: 20px 0;
    }

    .brand-area .brand-img {
        text-align: center;
        padding: 10px;
    }

    .brand-area .brand-img img {
        max-width: 80px;
        height: auto;
    }

    /* Fix for newsletter area */
    .newsletter-area {
        padding: 30px 0;
    }

    .newsletter-area .news-letter-area {
        padding: 30px 20px;
    }

    /* Fix for footer */
    .footer-area {
        padding: 30px 0 20px;
    }

    /* Fix for bottom menu */
    .bottom-menu {
        z-index: 1000;
    }

    /* Fix for cart drawer */
    .cart-drawer {
        z-index: 1001;
    }

    /* Fix for mobile menu */
    .mobile-menu {
        z-index: 1002;
    }

    /* Improve touch targets */
    .single-product-wrap .product-action a {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improve button touch areas */
    .btn-style,
    .btn-style2,
    .btn-style3,
    .btn-style4 {
        min-height: 44px;
        padding: 12px 20px;
    }

    /* Improve link touch areas */
    .product-tab-area ul.nav-tabs li a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .collection-wrap .collection-slider.swiper .swiper-slide {
        width: 100% !important;
    }

    .product-tab-area ul.nav-tabs li a {
        padding: 6px 12px;
        font-size: 13px;
    }

    .single-product-wrap .product-content .product-title h6 {
        font-size: 13px;
    }

    .single-product-wrap .product-content .price-box span {
        font-size: 13px;
    }

    .product-tab-area ul.nav-tabs {
        flex-direction: column;
        width: 100%;
    }

    .product-tab-area ul.nav-tabs li {
        width: 100%;
    }

    .product-tab-area ul.nav-tabs li a {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 767px) {

    /* Reduce animations for better performance */
    .single-product-wrap .product-image a.pro-img img {
        transition: transform 0.2s ease;
    }

    .single-product-wrap .product-image .product-action {
        transition: opacity 0.2s ease;
    }

    /* Optimize images */
    .single-product-wrap .product-image a.pro-img img {
        will-change: transform;
    }

    /* Reduce box shadows for better performance */
    .single-product-wrap {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    /* Optimize scrolling */
    .collection-wrap .collection-slider.swiper {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile-specific Swiper optimizations */
@media (max-width: 767px) {
    .collection-wrap .collection-slider.swiper.mobile-optimized {
        overflow: visible;
    }

    .collection-wrap .collection-slider.swiper.mobile-optimized .swiper-wrapper {
        transform: none !important;
    }

    .collection-wrap .collection-slider.swiper.mobile-optimized .swiper-slide {
        transform: none !important;
    }

    /* Force grid layout for mobile */
    .collection-wrap .collection-slider.swiper.mobile-optimized {
        display: block;
    }

    .collection-wrap .collection-slider.swiper.mobile-optimized .swiper-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0;
    }

    .collection-wrap .collection-slider.swiper.mobile-optimized .swiper-slide {
        width: 100% !important;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    .collection-wrap .collection-slider.swiper.mobile-optimized .swiper-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Fix for RTL layout in mobile */
@media (max-width: 767px) {
    .single-product-wrap .product-image .product-action {
        right: auto;
        left: 10px;
    }

    .single-product-wrap .product-image .product-label {
        left: auto;
        right: 10px;
    }

    .single-product-wrap .product-content .price-box .old-price {
        margin-right: 0;
        margin-left: 8px;
    }

    .single-product-wrap .product-content .product-action a {
        margin: 0 2px;
    }
}

/* Loading states for mobile */
@media (max-width: 767px) {
    .single-product-wrap .product-image img {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .single-product-wrap .product-image img.loaded {
        opacity: 1;
    }

    /* Skeleton loading */
    .single-product-wrap.loading .product-image {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }

    @keyframes loading {
        0% {
            background-position: 200% 0;
        }

        100% {
            background-position: -200% 0;
        }
    }
}