/* 📱 Otimização Mobile - Michelle Holtz */
/* Estilos específicos para dispositivos móveis e telas pequenas */

/* ========================================
   VARIÁVEIS MOBILE
======================================== */
:root {
    --mobile-padding: 1rem;
    --mobile-margin: 0.5rem;
    --mobile-font-size: 0.9rem;
    --mobile-line-height: 1.4;
    --mobile-button-height: 44px; /* Tamanho mínimo recomendado para touch */
    --mobile-tap-target: 44px;
    --mobile-header-height: 60px;
    --mobile-menu-width: 280px;
}

/* ========================================
   RESET E BASE MOBILE
======================================== */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
    
    html {
        font-size: 14px; /* Base menor para mobile */
    }
    
    body {
        font-size: var(--mobile-font-size);
        line-height: var(--mobile-line-height);
        overflow-x: hidden;
    }
}

/* ========================================
   HEADER E NAVEGAÇÃO MOBILE
======================================== */
@media (max-width: 768px) {
    .header {
        height: var(--mobile-header-height);
        padding: 0 var(--mobile-padding);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--bege-claro);
    }
    
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .logo {
        font-size: 1.2rem;
        font-weight: 600;
    }
    
    .logo img {
        max-height: 35px;
        width: auto;
    }
}

/* ========================================
   MENU MOBILE - HAMBURGER
======================================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: var(--mobile-tap-target);
        height: var(--mobile-tap-target);
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        transition: all 0.3s ease;
        position: relative;
        z-index: 1001;
    }
    
    .mobile-menu-toggle:hover {
        background: var(--bege-claro);
    }
    
    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }
    
    /* Ícone Hamburger */
    .hamburger-icon {
        width: 24px;
        height: 18px;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .hamburger-line {
        width: 100%;
        height: 2px;
        background: var(--azul-petroleo);
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    
    /* Animação do Hamburger para X */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Menu Mobile Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(5px);
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Menu Mobile */
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: var(--mobile-menu-width);
        max-width: 85vw;
        height: 100%;
        background: white;
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu.active {
        right: 0;
    }
    
    .mobile-menu-header {
        padding: var(--mobile-padding);
        border-bottom: 1px solid var(--bege-claro);
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: var(--mobile-header-height);
    }
    
    .mobile-menu-close {
        width: var(--mobile-tap-target);
        height: var(--mobile-tap-target);
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--azul-petroleo);
        cursor: pointer;
        border-radius: 50%;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-close:hover {
        background: var(--bege-claro);
        transform: rotate(90deg);
    }
    
    .mobile-menu-nav {
        padding: var(--mobile-padding) 0;
    }
    
    .mobile-menu-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .mobile-menu-nav li {
        border-bottom: 1px solid var(--bege-claro);
    }
    
    .mobile-menu-nav li:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-nav a {
        display: flex;
        align-items: center;
        padding: 1rem var(--mobile-padding);
        color: var(--azul-petroleo);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
        min-height: var(--mobile-tap-target);
    }
    
    .mobile-menu-nav a:hover,
    .mobile-menu-nav a:active {
        background: var(--bege-claro);
        color: var(--laranja-queimado);
        padding-left: 1.5rem;
    }
    
    .mobile-menu-nav .icon {
        width: 20px;
        height: 20px;
        margin-right: 12px;
        flex-shrink: 0;
    }
    
    /* CTA no Menu Mobile */
    .mobile-menu-cta {
        padding: var(--mobile-padding);
        border-top: 1px solid var(--bege-claro);
        margin-top: auto;
    }
    
    .mobile-menu-cta .btn {
        width: 100%;
        justify-content: center;
        min-height: var(--mobile-tap-target);
    }
}

/* ========================================
   NAVEGAÇÃO DESKTOP (OCULTAR NO MOBILE)
======================================== */
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }
}

/* ========================================
   CONTEÚDO PRINCIPAL MOBILE
======================================== */
@media (max-width: 768px) {
    .main-content {
        margin-top: var(--mobile-header-height);
        padding: var(--mobile-padding);
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .hero-section {
        padding: 2rem 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .hero-image {
        margin-top: 1.5rem;
    }
    
    .hero-image img {
        max-width: 100%;
        height: auto;
        border-radius: 12px;
    }
}

/* ========================================
   FORMULÁRIOS MOBILE
======================================== */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        min-height: var(--mobile-tap-target);
        padding: 12px 16px;
        font-size: 1rem;
        border: 2px solid var(--bege-claro);
        border-radius: 8px;
        transition: all 0.3s ease;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: var(--azul-petroleo);
        outline: none;
        box-shadow: 0 0 0 3px rgba(var(--azul-petroleo-rgb), 0.1);
    }
    
    .form-group textarea {
        min-height: 120px;
        resize: vertical;
    }
    
    .btn {
        min-height: var(--mobile-tap-target);
        padding: 12px 24px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .btn-primary {
        background: var(--azul-petroleo);
        color: white;
    }
    
    .btn-primary:hover {
        background: var(--laranja-queimado);
    }
    
    .btn-outline {
        background: transparent;
        color: var(--azul-petroleo);
        border: 2px solid var(--azul-petroleo);
    }
    
    .btn-outline:hover {
        background: var(--azul-petroleo);
        color: white;
    }
}

/* ========================================
   GRIDS E LAYOUTS MOBILE
======================================== */
@media (max-width: 768px) {
    .services-grid,
    .benefits-grid,
    .challenges-grid,
    .contact-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .service-card,
    .benefit-item,
    .challenge-item,
    .contact-form,
    .contact-info {
        width: 100%;
        padding: 1.5rem;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        border: 1px solid var(--bege-claro);
    }
    
    .service-card h3,
    .benefit-item h3,
    .challenge-item h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
        color: var(--azul-petroleo);
    }
    
    .service-card p,
    .benefit-item p,
    .challenge-item p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .service-card ul {
        padding-left: 1rem;
    }
    
    .service-card li {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
}

/* ========================================
   SEÇÕES CTA MOBILE
======================================== */
@media (max-width: 768px) {
    .cta-section {
        text-align: center;
        padding: 2rem 1rem;
        background: linear-gradient(135deg, var(--bege-claro) 0%, rgba(255, 255, 255, 0.8) 100%);
        border-radius: 12px;
        margin: 2rem 0;
    }
    
    .cta-section h3 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
        color: var(--azul-petroleo);
    }
    
    .cta-section p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        color: #666;
    }
    
    .cta-section .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* ========================================
   STEPS E PROCESSOS MOBILE
======================================== */
@media (max-width: 768px) {
    .steps {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .step {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        border-left: 4px solid var(--laranja-queimado);
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        background: var(--azul-petroleo);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 1.1rem;
        flex-shrink: 0;
    }
    
    .step h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: var(--azul-petroleo);
    }
    
    .step p {
        font-size: 0.9rem;
        line-height: 1.4;
        color: #666;
    }
}

/* ========================================
   PÁGINA 404 MOBILE
======================================== */
@media (max-width: 768px) {
    .error-404-page {
        padding: 2rem 1rem;
        text-align: center;
        min-height: calc(100vh - var(--mobile-header-height));
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .error-content {
        max-width: 100%;
    }
    
    .error-content h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
        color: var(--azul-petroleo);
    }
    
    .error-code {
        font-size: 3rem;
        font-weight: bold;
        color: var(--laranja-queimado);
        margin-bottom: 1rem;
    }
    
    .error-message {
        font-size: 1rem;
        margin-bottom: 2rem;
        color: #666;
    }
    
    .suggestions {
        text-align: left;
        margin-bottom: 2rem;
    }
    
    .suggestions h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        color: var(--azul-petroleo);
    }
    
    .suggestions ul {
        list-style: none;
        padding: 0;
    }
    
    .suggestions li {
        margin-bottom: 0.5rem;
    }
    
    .suggestions a {
        color: var(--azul-petroleo);
        text-decoration: none;
        font-weight: 500;
        padding: 0.5rem 0;
        display: block;
        border-bottom: 1px solid var(--bege-claro);
    }
    
    .suggestions a:hover {
        color: var(--laranja-queimado);
    }
    
    .cta-section .btn {
        margin: 0.5rem;
        min-width: 140px;
    }
}

/* ========================================
   BANNER DE COOKIES MOBILE
======================================== */
@media (max-width: 768px) {
    .consent-banner {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        z-index: 1001;
    }
    
    .consent-banner .banner-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .consent-banner .banner-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .consent-banner .banner-actions {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }
    
    .consent-banner .btn {
        width: 100%;
        min-height: var(--mobile-tap-target);
        font-size: 0.9rem;
    }
}

/* ========================================
   ANIMAÇÕES MOBILE
======================================== */
@media (max-width: 768px) {
    @keyframes slideInFromRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }
    
    @keyframes slideOutToRight {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(100%);
            opacity: 0;
        }
    }
    
    @keyframes fadeInUp {
        from {
            transform: translateY(30px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .mobile-menu.active {
        animation: slideInFromRight 0.3s ease;
    }
    
    .page-content > * {
        animation: fadeInUp 0.6s ease;
    }
}

/* ========================================
   TELAS MUITO PEQUENAS (< 375px)
======================================== */
@media (max-width: 374px) {
    :root {
        --mobile-padding: 0.8rem;
        --mobile-margin: 0.4rem;
        --mobile-font-size: 0.85rem;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .mobile-menu {
        width: 100%;
        max-width: 100%;
    }
    
    .service-card,
    .benefit-item,
    .challenge-item {
        padding: 1rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* ========================================
   LANDSCAPE MOBILE
======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 1rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.6rem;
    }
    
    .mobile-menu {
        width: 320px;
    }
}

/* ========================================
   ACESSIBILIDADE MOBILE
======================================== */
@media (max-width: 768px) {
    /* Aumentar área de toque para usuários com dificuldades motoras */
    .btn,
    .mobile-menu-toggle,
    .mobile-menu-nav a {
        min-height: 48px; /* WCAG recomenda 44px mínimo */
    }
    
    /* Melhor contraste para leitura */
    .mobile-menu-nav a {
        font-weight: 600;
    }
    
    /* Feedback visual melhorado */
    .btn:focus,
    .mobile-menu-toggle:focus,
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: 3px solid var(--laranja-queimado);
        outline-offset: 2px;
    }
}

/* ========================================
   PERFORMANCE MOBILE
======================================== */
@media (max-width: 768px) {
    /* Reduzir animações para dispositivos com pouca bateria */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* Otimizar imagens para mobile */
    img {
        max-width: 100%;
        height: auto;
        loading: lazy;
    }
    
    /* Melhorar performance de scroll */
    .mobile-menu {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* ========================================
   DARK MODE MOBILE (OPCIONAL)
======================================== */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .mobile-menu {
        background: #1a1a1a;
        color: white;
    }
    
    .mobile-menu-nav a {
        color: white;
    }
    
    .mobile-menu-nav a:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .hamburger-line {
        background: white;
    }
}

/* ========================================
   UTILITÁRIOS MOBILE
======================================== */
@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .text-center-mobile {
        text-align: center;
    }
    
    .full-width-mobile {
        width: 100%;
    }
    
    .no-padding-mobile {
        padding: 0 !important;
    }
    
    .no-margin-mobile {
        margin: 0 !important;
    }
}

/* ========================================
   CORREÇÕES ESPECÍFICAS PARA ÍCONES
======================================== */
@media (max-width: 768px) {
    /* Garantir que todos os ícones estejam alinhados */
    .icon,
    .mobile-menu-nav .icon,
    .hamburger-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        vertical-align: middle;
    }
    
    /* Corrigir ícones SVG */
    .icon svg,
    .mobile-menu-nav .icon svg {
        width: 100%;
        height: 100%;
        fill: currentColor;
    }
    
    /* Corrigir ícones de fonte */
    .icon i,
    .mobile-menu-nav .icon i {
        font-size: inherit;
        line-height: 1;
    }
    
    /* Garantir que ícones não quebrem o layout */
    .mobile-menu-nav a {
        align-items: center;
        display: flex;
    }
    
    .mobile-menu-nav .icon {
        flex-shrink: 0;
        margin-right: 12px;
    }
}