/**
 * EvovE Box - Otimizações Mobile
 * Melhorias de responsividade para celulares modernos
 * Sem alterar cores ou formatos grandes - apenas reposicionamento e redimensionamento
 */

/* ============================================================================
   BREAKPOINTS PARA CELULARES MODERNOS
   ============================================================================ */
/* 
 * Celulares pequenos: 320px - 374px (iPhone SE, Galaxy S8)
 * Celulares médios: 375px - 424px (iPhone 12/13/14, Galaxy S20)
 * Celulares grandes: 425px - 767px (iPhone 14 Pro Max, Galaxy S21 Ultra)
 * Tablets: 768px+
 */

/* ============================================================================
   VIEWPORT E BASE
   ============================================================================ */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    word-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   CONTAINERS E ESPAÇAMENTOS
   ============================================================================ */

/* Ajustar padding de containers em mobile */
.container,
.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 374px) {
    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (min-width: 375px) and (max-width: 424px) {
    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 425px) and (max-width: 767px) {
    .container,
    .container-fluid {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* ============================================================================
   NAVBAR MOBILE
   ============================================================================ */

/* Ajustar navbar em mobile */
@media (max-width: 767.98px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
        padding: 0.5rem 0;
    }
    
    .navbar-toggler {
        padding: 0.375rem 0.5rem;
        font-size: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 0.5rem;
    }
    
    /* Dropdown em mobile */
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        border: none;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.02);
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.625rem 1.5rem;
        font-size: 0.9375rem;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    .navbar-brand {
        font-size: 1.125rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 0.9375rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.625rem 0.875rem;
        font-size: 0.9375rem;
    }
}

/* ============================================================================
   TIPOGRAFIA RESPONSIVA
   ============================================================================ */

/* Ajustar tamanhos de fonte para mobile */
@media (max-width: 767.98px) {
    h1 {
        font-size: 1.875rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
    
    h4 {
        font-size: 1.125rem;
        line-height: 1.4;
    }
    
    h5 {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    h6 {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
    
    p {
        font-size: 0.9375rem;
        line-height: 1.6;
    }
    
    .lead {
        font-size: 1.125rem;
        line-height: 1.6;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    h1 {
        font-size: 1.625rem;
    }
    
    h2 {
        font-size: 1.375rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
    
    p {
        font-size: 0.875rem;
    }
}

/* ============================================================================
   BOTÕES E LINKS
   ============================================================================ */

/* Ajustar botões para mobile */
@media (max-width: 767.98px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
        min-height: 44px; /* Tamanho mínimo para toque */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-lg {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 36px;
    }
    
    /* Garantir que links sejam clicáveis */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        min-height: 40px;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
        min-height: 44px;
    }
}

/* ============================================================================
   CARDS E COMPONENTES
   ============================================================================ */

/* Ajustar cards para mobile */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
    
    .card-text {
        font-size: 0.9375rem;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
}

/* ============================================================================
   GRID E LAYOUT
   ============================================================================ */

/* Ajustar grid para mobile */
@media (max-width: 767.98px) {
    .row {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }
    
    .row > * {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Forçar colunas em mobile - garantir que cards fiquem empilhados */
    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-lg-4,
    .col-lg-3,
    .col-lg-6,
    .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
    
    /* Ajustar colunas específicas */
    .col-lg-6 {
        margin-bottom: 1.5rem;
    }
    
    /* Garantir que imagens em colunas não quebrem */
    .col-lg-6 img,
    .col-md-6 img {
        width: 100%;
        height: auto;
        max-width: 100%;
    }
}

/* ============================================================================
   IMAGENS E MÍDIA
   ============================================================================ */

/* Ajustar imagens para mobile */
@media (max-width: 767.98px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .img-fluid {
        width: 100%;
        height: auto;
    }
    
    /* Evitar overflow horizontal */
    video,
    iframe,
    embed,
    object {
        max-width: 100%;
        height: auto;
    }
}

/* ============================================================================
   FORMULÁRIOS
   ============================================================================ */

/* Ajustar formulários para mobile */
@media (max-width: 767.98px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Evitar zoom no iOS */
        padding: 0.75rem 1rem;
        min-height: 44px; /* Tamanho mínimo para toque */
        border-radius: 0.5rem;
    }
    
    .form-label {
        font-size: 0.9375rem;
        margin-bottom: 0.5rem;
    }
    
    .form-text {
        font-size: 0.875rem;
    }
    
    /* Agrupar campos relacionados */
    .form-group {
        margin-bottom: 1.25rem;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    .form-control,
    .form-select {
        font-size: 16px;
        padding: 0.625rem 0.875rem;
        min-height: 40px;
    }
}

/* ============================================================================
   TABELAS
   ============================================================================ */

/* Ajustar tabelas para mobile */
@media (max-width: 767.98px) {
    .table-responsive {
        border-radius: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
}

/* ============================================================================
   MODAIS
   ============================================================================ */

/* Ajustar modais para mobile */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.75rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* ============================================================================
   HERO SECTIONS
   ============================================================================ */

/* Ajustar hero sections para mobile */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 3rem 0 2rem;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 1.875rem;
        margin-bottom: 1rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-section .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    .hero-section {
        padding: 2rem 0 1.5rem;
    }
    
    .hero-section h1 {
        font-size: 1.625rem;
    }
}

/* ============================================================================
   SEÇÕES E ESPAÇAMENTOS
   ============================================================================ */

/* Ajustar espaçamentos de seções para mobile */
@media (max-width: 767.98px) {
    section {
        padding: 2.5rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.375rem;
    }
}

/* ============================================================================
   UTILITÁRIOS MOBILE
   ============================================================================ */

/* Classes utilitárias para mobile */
@media (max-width: 767.98px) {
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-text-left {
        text-align: left !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-no-padding {
        padding: 0 !important;
    }
    
    .mobile-no-margin {
        margin: 0 !important;
    }
    
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-block {
        display: block !important;
    }
    
    .mobile-flex {
        display: flex !important;
    }
}

/* ============================================================================
   ACESSIBILIDADE E TOUCH
   ============================================================================ */

/* Melhorar área de toque */
@media (max-width: 767.98px) {
    button,
    a,
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    .btn,
    .nav-link,
    .dropdown-item {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
}

/* Evitar zoom em inputs no iOS */
@media (max-width: 767.98px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ============================================================================
   PERFORMANCE MOBILE
   ============================================================================ */

/* Otimizar animações em mobile */
@media (max-width: 767.98px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    /* Reduzir animações em mobile para melhor performance */
    @media (prefers-reduced-motion: no-preference) {
        .fade-in,
        .slide-in {
            animation-duration: 0.3s;
        }
    }
}

/* ============================================================================
   ORIENTAÇÃO
   ============================================================================ */

/* Ajustes para orientação landscape em mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    section {
        padding: 2rem 0;
    }
}

/* ============================================================================
   CORREÇÕES ESPECÍFICAS
   ============================================================================ */

/* Garantir que elementos não quebrem o layout */
@media (max-width: 767.98px) {
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Evitar overflow horizontal */
    body {
        overflow-x: hidden;
    }
    
    /* Ajustar elementos fixos */
    .fixed-top,
    .fixed-bottom {
        position: relative;
    }
    
    @media (min-width: 768px) {
        .fixed-top,
        .fixed-bottom {
            position: fixed;
        }
    }
}

/* Ajustar elementos flutuantes */
@media (max-width: 767.98px) {
    .float-left,
    .float-right {
        float: none !important;
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* ============================================================================
   ESPAÇAMENTOS ADICIONAIS
   ============================================================================ */

/* Ajustar margens e paddings em mobile */
@media (max-width: 767.98px) {
    .mb-5,
    .my-5 {
        margin-bottom: 2.5rem !important;
    }
    
    .mt-5,
    .my-5 {
        margin-top: 2.5rem !important;
    }
    
    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .px-5 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

/* Celulares muito pequenos */
@media (max-width: 374px) {
    .mb-5,
    .my-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5,
    .my-5 {
        margin-top: 2rem !important;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

