/* Mobile Touch Interaction Fixes */

/* Ensure all interactive elements are touchable */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: default;
}

/* Fix touch interactions for buttons and links */
a, button, .btn, [role="button"], input[type="button"], input[type="submit"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    -webkit-touch-callout: default;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Ensure form elements are touchable */
input, textarea, select {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: default;
    pointer-events: auto !important;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Fix carousel touch interactions */
.owl-carousel, .owl-carousel .owl-item {
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
}

.owl-carousel .owl-nav button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-width: 44px;
    min-height: 44px;
}

.owl-carousel .owl-dots .owl-dot {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-width: 44px;
    min-height: 44px;
}

/* Fix navigation menu touch interactions */
.navbar-nav .nav-link {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.navbar-toggler {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-width: 44px;
    min-height: 44px;
}

/* Fix dropdown menu touch interactions */
.dropdown-toggle, .dropdown-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-height: 44px;
}

/* Fix card and interactive content touch */
.card, .card-body, .card-header, .card-footer {
    touch-action: manipulation;
    pointer-events: auto !important;
}

/* Fix modal touch interactions */
.modal, .modal-dialog, .modal-content {
    touch-action: manipulation;
    pointer-events: auto !important;
}

.modal-header .btn-close {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-width: 44px;
    min-height: 44px;
}

/* Fix accordion touch interactions */
.accordion-button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-height: 44px;
}

/* Fix tab navigation touch */
.nav-tabs .nav-link, .nav-pills .nav-link {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-height: 44px;
}

/* Fix pagination touch */
.pagination .page-link {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-width: 44px;
    min-height: 44px;
}

/* Fix breadcrumb touch */
.breadcrumb-item a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-height: 44px;
}

/* Fix social media buttons touch */
.social-icons a, .btn-social {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
    min-width: 44px;
    min-height: 44px;
}

/* Fix WhatsApp floating button touch */
.whatsapp-float {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(37, 211, 102, 0.3);
    pointer-events: auto !important;
    min-width: 55px;
    min-height: 55px;
}

/* Fix scroll behavior on mobile */
body {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* Fix touch scrolling for containers */
.container, .container-fluid, .row, .col, [class*="col-"] {
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

/* Ensure minimum touch target sizes on mobile */
@media (max-width: 768px) {
    a, button, .btn, [role="button"], input[type="button"], input[type="submit"] {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 16px;
        min-height: 48px;
    }
    
    .dropdown-item {
        padding: 12px 16px;
        min-height: 48px;
    }
    
    /* Fix form controls on mobile */
    input, textarea, select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Fix carousel navigation on mobile */
    .owl-carousel .owl-nav button {
        min-width: 48px;
        min-height: 48px;
        font-size: 18px;
    }
    
    .owl-carousel .owl-dots .owl-dot {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Fix modal close button on mobile */
    .modal-header .btn-close {
        min-width: 48px;
        min-height: 48px;
    }
}

/* Fix for elements that might have pointer-events: none */
.tp-static-layers,
.owl-carousel .owl-stage,
.mfp-arrow,
.mfp-close,
[data-scroll-container] {
    pointer-events: auto !important;
}

/* Ensure interactive elements inside containers are touchable */
.tp-static-layers *,
.owl-carousel *,
.mfp-container *,
[data-scroll-container] * {
    pointer-events: auto !important;
}

/* Fix for Revolution Slider touch interactions */
.tp-revslider-mainul,
.tp-revslider-mainul li,
.tp-caption,
.tp-static-layers {
    touch-action: manipulation;
    pointer-events: auto !important;
}

/* Fix for Magnific Popup touch interactions */
.mfp-wrap,
.mfp-container,
.mfp-content {
    touch-action: manipulation;
    pointer-events: auto !important;
}

/* Fix for Locomotive Scroll touch interactions */
[data-scroll-container],
[data-scroll-section] {
    touch-action: manipulation;
    pointer-events: auto !important;
}

/* Additional mobile-specific fixes */
@media (max-width: 768px) {
    /* Prevent text selection on mobile for better UX */
    .navbar-brand,
    .navbar-nav,
    .btn,
    .card-title,
    .card-text {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection for content areas */
    p, .card-text, .content, .description {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Fix viewport issues */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Improve touch responsiveness */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-touch-callout: default;
    }
}

/* Debug mode - uncomment to see touch targets */
/*
@media (max-width: 768px) {
    a, button, .btn, [role="button"], input[type="button"], input[type="submit"] {
        border: 2px solid red !important;
    }
}
*/