/* TOUCH OPTIMIZATION */
/* Mobile-First Touch Events */

/* Touch-friendly buttons - Only for mobile */
@media (max-width: 768px) {
    .touch-optimized {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    /* Services megamenu - exclude from touch-optimized */
    .tp-main-menu li.has-dropdown:not(.touch-optimized) {
        /* Services megamenu should not have touch-optimized constraints */
        min-width: auto;
        min-height: auto;
    }
    
    /* Services megamenu links */
    .tp-main-menu li.has-dropdown:not(.touch-optimized) > a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 12px 16px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Touch gestures - Only for mobile */
@media (max-width: 768px) {
    .touch-gesture {
        touch-action: pan-x pan-y;
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile menu optimization - Only for mobile */
@media (max-width: 768px) {
    .tp-main-menu li a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 12px 16px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* Touch-friendly dropdowns - Only for mobile */
@media (max-width: 768px) {
    .tp-submenu {
        touch-action: manipulation;
    }

    .tp-submenu li a {
        min-height: 40px;
        padding: 10px 16px;
        touch-action: manipulation;
    }
}

/* Mobile header optimization - Only for mobile */
@media (max-width: 768px) {
    .tp-header-area {
        touch-action: manipulation;
    }

    .tp-header-right .tp-btn-group {
        touch-action: manipulation;
    }

    .tp-btn-circle,
    .tp-btn-primary,
    .tp-btn-2 {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Touch-friendly forms - Only for mobile */
@media (max-width: 768px) {
    input, textarea, select {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-appearance: none;
        border-radius: 8px;
    }
}

/* Touch scrolling optimization - Only for mobile */
@media (max-width: 768px) {
    .touch-scroll {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
}

/* Mobile viewport optimization */
@media (max-width: 768px) {
    /* Touch-friendly spacing */
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Touch-friendly navigation */
    .tp-main-menu {
        touch-action: manipulation;
    }
    
    /* Touch-friendly buttons */
    .tp-btn-group {
        gap: 10px;
    }
    
    .tp-btn-circle {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Touch-friendly megamenu */
    .tp-megamenu-wrapper {
        touch-action: manipulation;
    }
    
    .tp-megamenu-list {
        touch-action: manipulation;
    }
    
    .tp-megamenu-list ul li a {
        min-height: 40px;
        padding: 12px 16px;
        touch-action: manipulation;
    }
}

/* High DPI touch optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .touch-optimized {
        border-width: 0.5px;
    }
}

/* Touch feedback */
.touch-feedback:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Touch gesture indicators */
.touch-indicator {
    position: relative;
}

.touch-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.6;
}

/* Performance optimization for touch */
.touch-optimized {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Touch-friendly hover states */
@media (hover: none) and (pointer: coarse) {
    .tp-main-menu li:hover .tp-submenu {
        display: block;
    }
    
    .tp-btn-circle:hover,
    .tp-btn-primary:hover {
        transform: none;
    }
}
