/* =================================
   CORREÇÕES PARA MENU MOBILE E CARDS
   ================================= */

/* Menu Mobile Melhorado */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, 
            rgba(12, 21, 39, 0.97) 0%, 
            rgba(23, 34, 57, 0.97) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: all 0.3s ease;
        z-index: 999;
        display: none;
        opacity: 0;
        transform: translateY(-20px);
        padding: 2rem;
    }

    .nav-menu.active {
        display: flex !important;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-link {
        color: var(--white);
        text-decoration: none;
        font-size: 1.3rem;
        font-weight: 500;
        padding: 1rem 2rem;
        border-radius: 12px;
        transition: all 0.3s ease;
        text-align: center;
        min-width: 200px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
    }

    .nav-link:hover {
        background: rgba(59, 130, 246, 0.15);
        border-color: rgba(59, 130, 246, 0.3);
        color: #22d3ee;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
    }

    .cta-button {
        background: linear-gradient(135deg, 
            var(--gradient-blue-start) 0%, 
            var(--gradient-blue-mid) 25%, 
            var(--gradient-green-mid) 60%, 
            var(--gradient-green-end) 100%) !important;
        color: var(--white) !important;
        font-weight: 600;
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
        border: none !important;
    }

    .cta-button:hover {
        transform: translateY(-3px) scale(1.05) !important;
        box-shadow: 0 12px 30px rgba(59, 130, 246, 0.5) !important;
    }

    /* Hamburger melhorado */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        gap: 4px;
        z-index: 1001;
        background: none;
        border: none;
        padding: 10px;
        transition: all 0.3s ease;
    }

    .hamburger span {
        width: 25px;
        height: 3px;
        background: var(--white);
        transition: all 0.3s ease;
        border-radius: 2px;
        display: block;
    }

    .hamburger.active {
        transform: rotate(0deg);
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
        background: #22d3ee;
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
        background: #22d3ee;
    }
}

/* =================================
   CARDS ALINHADOS EM 4 COLUNAS
   ================================= */

/* Desktop - 4 cards na mesma linha */
@media (min-width: 1200px) {
    .services-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr) !important; /* Forçar 4 colunas */
        gap: 2rem;
        margin-bottom: 4rem;
        padding: 0 1rem;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }

    .service-card {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(20px);
        padding: 2rem 1.5rem; /* Padding menor para caber 4 */
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        position: relative;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        min-height: 420px;
        max-width: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
    }
}

/* Laptop médio - 1024px a 1199px */
@media (min-width: 1024px) and (max-width: 1199px) {
    .services-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr) !important; /* 4 colunas mais compactas */
        gap: 1.5rem;
        margin-bottom: 4rem;
        padding: 0 0.5rem;
    }

    .service-card {
        padding: 1.8rem 1.3rem; /* Padding reduzido */
        min-height: 400px;
        font-size: 0.9rem; /* Texto um pouco menor */
    }

    .service-card h3 {
        font-size: 1.2rem;
    }

    .service-description {
        font-size: 0.9rem;
    }

    .feature-item {
        font-size: 0.85rem;
    }
}

/* Tablet - 769px a 1023px */
@media (min-width: 769px) and (max-width: 1023px) {
    .services-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important; /* 2 colunas no tablet */
        gap: 2rem;
        margin-bottom: 4rem;
    }

    .service-card {
        padding: 2rem 1.8rem;
        min-height: 380px;
    }
}

/* Mobile - 768px e abaixo */
@media (max-width: 768px) {
    .services-grid {
        display: grid;
        grid-template-columns: 1fr !important; /* 1 coluna no mobile */
        gap: 1.5rem;
        padding: 0;
        margin-bottom: 3rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
        min-height: 320px;
        margin: 0 auto;
        max-width: 500px;
        width: 100%;
    }

    .service-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .service-card h3 {
        text-align: center;
        font-size: 1.2rem;
    }

    .service-description {
        text-align: center;
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .feature-item {
        justify-content: center;
        text-align: center;
        font-size: 0.85rem;
    }
}

/* =================================
   MELHORIAS GERAIS PARA RESPONSIVIDADE
   ================================= */

/* Container adaptativo */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }
}

/* Smooth transitions */
.nav-menu, .nav-link, .hamburger, .hamburger span {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevenir overflow horizontal em todos os breakpoints */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Otimizações de performance para mobile */
@media (max-width: 768px) {
    .service-card,
    .nav-menu {
        will-change: transform, opacity;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* =================================
   AJUSTES ESPECÍFICOS POR BREAKPOINT
   ================================= */

/* Extra Large Desktop - 1400px+ */
@media (min-width: 1400px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3rem;
        max-width: 1600px;
    }

    .service-card {
        padding: 2.5rem 2rem;
        min-height: 450px;
    }
}

/* Large Desktop - 1200px a 1399px */
@media (min-width: 1200px) and (max-width: 1399px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }

    .service-card {
        padding: 2rem 1.5rem;
        min-height: 420px;
    }
}

/* Garantir que os cards sempre fiquem alinhados */
.service-card {
    box-sizing: border-box;
    height: auto;
    align-self: stretch; /* Garante que todos tenham a mesma altura */
}

/* Melhorar a distribuição dos cards */
.services-grid > .service-card:nth-child(4n+1) {
    grid-column-start: auto; /* Reset para garantir alinhamento */
}

/* =================================
   FOOTER MOBILE COMPACTO
   ================================= */

@media (max-width: 768px) {
    /* Override para footer mais compacto */
    .footer-content {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1.2rem !important;
        text-align: center;
    }

    /* Brand section centralizada */
    .footer-brand {
        grid-column: 1 / -1;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 0.5rem;
    }

    /* Seções lado a lado */
    .footer-section:nth-child(2) {
        grid-column: 1;
    }

    .footer-section:nth-child(3) {
        grid-column: 2;
    }

    /* Otimizar contatos para mobile */
    .footer-contact .contact-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .footer-contact .contact-item i {
        width: 20px;
        text-align: center;
        flex-shrink: 0;
    }

    .footer-contact .contact-info {
        flex: 1;
        text-align: left;
    }

    /* Links de navegação mais compactos */
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .footer-links a {
        padding: 0.2rem 0;
        font-size: 0.8rem;
    }
}

/* Para telas muito pequenas */
@media (max-width: 320px) {
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        grid-column: 1;
    }
}
