/**
 * Mobile Fix CSS - Correções específicas para dispositivos móveis
 * Resolve problemas de zoom, cortes e layout em mobile
 */

/* Prevenir zoom automático em inputs */
input,
select,
textarea {
    font-size: 16px !important;
}

/* Garantir que nada cause overflow horizontal */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

* {
    max-width: 100%;
}

/* Correção do Header para não cortar */
.header-main {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0;
    right: 0;
    position: sticky;
}

.header-container {
    width: 100%;
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
}

/* Correção Bottom Nav para não dar zoom */
.pwa-bottom-nav {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0;
    right: 0;
}

.pwa-nav-item {
    font-size: 16px !important;
}

.pwa-nav-label {
    font-size: 10px !important;
}

/* Container principal */
.container {
    width: 100%;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
}

/* Correção de imagens e mídia */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Cards responsivos */
.category-card,
.card,
.quick-action-card,
.job-card {
    width: 100%;
    max-width: 100%;
}

/* Carousel responsivo */
.carousel-custom {
    width: 100%;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: 300px;
    object-fit: cover;
}

/* Mobile específico */
@media (max-width: 425px) {
    html {
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    body {
        font-size: 16px;
    }
    
    .header-main {
        height: 64px;
        min-height: 64px;
        padding: 8px 12px;
    }
    
    .header-logo {
        height: 36px;
        width: auto;
    }
    
    .header-login-btn {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* Grid de categorias */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        padding: 0;
    }
    
    .category-card {
        padding: 16px 12px;
    }
    
    .category-icon {
        font-size: 32px;
    }
    
    .category-title {
        font-size: 13px;
    }
    
    /* Bottom Nav */
    .pwa-bottom-nav {
        height: 64px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    body.has-bottom-nav {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .header-main {
        height: 60px;
        min-height: 60px;
        padding: 6px 8px;
    }
    
    .header-logo {
        height: 32px;
    }
    
    .header-login-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .header-login-btn span {
        display: none;
    }
    
    .header-login-btn i {
        margin-right: 0;
    }
    
    .categories-grid {
        gap: 8px;
    }
    
    .category-card {
        padding: 12px 8px;
    }
    
    .category-icon {
        font-size: 28px;
    }
    
    .category-title {
        font-size: 12px;
    }
}

@media (max-width: 320px) {
    .header-main {
        height: 56px;
        min-height: 56px;
        padding: 4px 8px;
    }
    
    .header-logo {
        height: 28px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Landscape mobile */
@media (orientation: landscape) and (max-height: 500px) {
    .header-main {
        height: 56px;
        min-height: 56px;
    }
    
    .pwa-bottom-nav {
        height: 56px;
    }
    
    body.has-bottom-nav {
        padding-bottom: 56px;
    }
    
    .carousel-slide img {
        max-height: 200px;
    }
}

/* Prevenir qualquer scroll horizontal */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    * {
        max-width: 100vw !important;
    }
    
    .container,
    .header-container,
    .footer-container {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
}
