/**
 * Mobile Product Page Fixes
 * Fixes for coming soon issue on mobile product pages
 */

/* Ensure product links are clickable on mobile */
.mobile-device-fixed .product-card a,
.mobile-device-fixed .woocommerce-loop-product__link,
.mobile-device-fixed .product-item a {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    touch-action: manipulation;
}

/* Fix for mobile product cards */
.mobile-device-fixed .product-card {
    position: relative;
    overflow: hidden;
}

.mobile-device-fixed .product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.mobile-device-fixed .product-card a {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
}

/* Ensure mobile footer doesn't interfere with product links */
.mobile-device-fixed .mobile-footer {
    z-index: 100;
}

.mobile-device-fixed .mobile-footer li {
    position: relative;
    z-index: 101;
}

/* Fix for touch devices */
@media (max-width: 768px) {
    .mobile-device-fixed .product-card {
        min-height: 200px;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-device-fixed .product-card a {
        flex: 1;
        display: flex;
        flex-direction: column;
        text-decoration: none;
        color: inherit;
    }
    
    .mobile-device-fixed .product-card img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* Ensure product titles are clickable */
    .mobile-device-fixed .product-card h2,
    .mobile-device-fixed .product-card h3 {
        margin: 0;
        padding: 10px;
        flex: 1;
    }
    
    /* Fix for WooCommerce product loops */
    .mobile-device-fixed .woocommerce-loop-product__link {
        display: block;
        position: relative;
        z-index: 10;
    }
    
    /* Ensure price is clickable */
    .mobile-device-fixed .price {
        position: relative;
        z-index: 10;
    }
}

/* Debug styles for troubleshooting */
.mobile-device-fixed.debug-mode .product-card {
    border: 2px solid #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.mobile-device-fixed.debug-mode .product-card a {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
}

/* Fix for coming soon content detection */
.mobile-device-fixed .coming-soon-detected {
    display: none !important;
}

/* Hide any coming soon content on mobile */
@media (max-width: 768px) {
    .coming-soon-content,
    .woocommerce-coming-soon,
    .coming-soon-page,
    .coming-soon-message,
    .coming-soon-banner {
        display: none !important;
    }
    
    /* Ensure product content is visible */
    .woocommerce-products-header,
    .woocommerce-loop-product__link,
    .product-card,
    .woocommerce div.product {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Ensure proper touch targets on mobile */
@media (max-width: 768px) {
    .mobile-device-fixed .product-card a,
    .mobile-device-fixed .woocommerce-loop-product__link {
        min-height: 44px;
        min-width: 44px;
        padding: 10px;
    }
}

/* Fix for sticky elements interfering with product links */
.mobile-device-fixed .sticky {
    z-index: 50;
}

.mobile-device-fixed .product-card {
    z-index: 60;
}

.mobile-device-fixed body {
    overflow-x: hidden;
}

/* Fix for mobile menu interference */
.mobile-device-fixed .mobile-menu-open .product-card {
    z-index: 1;
}

.mobile-device-fixed .mobile-menu-open .product-card a {
    pointer-events: none;
}
