/* ============================================================
   Responsivo — celular, tablet e telas grandes
   Carregado depois dos outros CSS. Não muda cores nem o visual
   do computador (acima de 1100px): só ajusta espaços, colunas,
   menu e tamanhos nas telas menores.
   ============================================================ */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video, iframe, svg { max-width: 100%; }

/* botão do menu (só aparece em tela menor) */
.menu-toggle {
    display: none;
    align-items: center; justify-content: center;
    width: 44px; height: 44px; flex-shrink: 0;
    background: #fff; color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 10px;
    font-size: 1.2rem; cursor: pointer;
}
.menu-toggle:hover { border-color: var(--primary-cyan); color: var(--primary-cyan); }
/* três barras desenhadas em CSS (não dependem de ícone); viram "X" quando o menu abre */
.menu-bars, .menu-bars::before, .menu-bars::after {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: currentColor; transition: transform .25s ease, top .25s ease, background-color .2s ease;
}
.menu-bars { position: relative; }
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars::after { top: 0; transform: rotate(-45deg); }
.main-nav a { white-space: nowrap; }

/* ---------- notebook pequeno: aperta o menu para caber tudo ---------- */
@media (min-width: 1101px) and (max-width: 1280px) {
    .main-nav { gap: 14px; }
    .main-nav a { font-size: .88rem; }
    .nav-projects-link { padding: 6px 10px; }
    .whatsapp-header-btn { padding: 8px 12px; font-size: .85rem; }
}

/* ---------- notebook e abaixo (até 1280px): hero e simulador nunca passam da tela ---------- */
@media (max-width: 1280px) {
    .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    .hero-left, .hero-simulator-card { min-width: 0; }
    .hero-cta-buttons { flex-wrap: wrap; }
    .hero-stats { flex-wrap: wrap; gap: 20px 30px; }
    .hero-simulator-card .sim-res-row span,
    .hero-simulator-card .sim-header h3,
    .hero-simulator-card .full-width-btn { white-space: normal; }
    .simulador-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    .simulador-layout > * { min-width: 0; }
}

/* ---------- tablet e abaixo (até 1100px) ---------- */
@media (max-width: 1100px) {
    :root { --pad-x: 5vw; }

    /* margens laterais menores */
    body { padding-left: var(--pad-x) !important; padding-right: var(--pad-x) !important; }
    .hero-section, .dark-mode-section, .cta-final-section, .site-footer {
        padding-left: var(--pad-x) !important; padding-right: var(--pad-x) !important;
    }
    .hero-section .container, .cta-final-section .container, .site-footer .container {
        padding-left: 0; padding-right: 0;
    }
    .section-container { padding-top: clamp(48px, 8vw, 80px); padding-bottom: clamp(48px, 8vw, 80px); }
    .hero-section { padding-top: clamp(40px, 7vw, 70px); padding-bottom: clamp(40px, 7vw, 70px); }
    .cta-final-section { padding-top: clamp(52px, 8vw, 85px); padding-bottom: clamp(52px, 8vw, 85px); }
    .section-header { margin-bottom: clamp(28px, 5vw, 50px); }
    .section-header h2, .cta-final-section h2 { font-size: clamp(1.6rem, 4.6vw, 2.3rem); }
    .badge-pill { max-width: 100%; line-height: 1.4; }

    /* cabeçalho com menu em botão */
    .site-header { padding-left: 20px !important; padding-right: 20px !important; }
    .header-container { padding-left: 0; padding-right: 0; gap: 12px; flex-wrap: nowrap; }
    .logo-link { min-width: 0; }
    .header-actions { margin-left: auto; }
    .menu-toggle { display: inline-flex; }
    .main-nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: #fff;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 14px 28px rgba(15, 23, 42, .10);
        padding: 6px 20px 18px;
        max-height: calc(100vh - 76px); overflow-y: auto;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 14px 4px; font-size: 1rem; border-bottom: 1px solid var(--border-color); }
    .main-nav a.nav-projects-link { margin-top: 14px; border-bottom: 0; text-align: center; padding: 12px 14px; }

    /* grades com 2 ou 3 colunas */
    .benefits-grid, .solutions-grid, .solutions-grid-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .benefits-grid > *, .solutions-grid > *, .solutions-grid-bottom > *, .steps-grid > * { min-width: 0; }
}

/* ---------- tablet em pé (até 968px) ---------- */
@media (max-width: 968px) {
    .hero-grid, .simulador-layout, .about-grid { grid-template-columns: minmax(0, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-col { min-width: 0; }
    .footer-col p { overflow-wrap: anywhere; }
    /* terceiro cartão sozinho ocupa a linha toda */
    .solutions-grid > :last-child:nth-child(odd),
    .solutions-grid-bottom > :last-child:nth-child(odd),
    .benefits-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    .steps-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }

    .about-img-box { height: 320px; margin-bottom: 44px; }
    .about-badge-float { left: 14px; right: 14px; bottom: -30px; max-width: none; }
}

/* ---------- celular (até 640px) ---------- */
@media (max-width: 640px) {
    :root { --pad-x: 16px; }
    .site-header { padding-left: 14px !important; padding-right: 14px !important; }
    .main-nav { padding-left: 14px; padding-right: 14px; }

    .benefits-grid, .solutions-grid, .solutions-grid-bottom, .steps-grid, .footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .solutions-grid > :last-child:nth-child(odd),
    .solutions-grid-bottom > :last-child:nth-child(odd),
    .benefits-grid > :last-child:nth-child(odd),
    .steps-grid > :last-child:nth-child(odd) { grid-column: auto; }

    .hero-left h1 { font-size: clamp(1.7rem, 7.4vw, 2.2rem); overflow-wrap: break-word; }
    .hero-left p { font-size: 1rem; }
    .hero-cta-buttons { flex-direction: column; gap: 12px; }
    .hero-cta-buttons .btn { width: 100%; text-align: center; white-space: normal; }
    .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .hero-stats h2 { font-size: 1.25rem; }
    .hero-stats p { font-size: .75rem; }
    .hero-simulator-card { padding: 22px 18px; border-radius: 16px; }

    .section-header h2, .cta-final-section h2 { font-size: clamp(1.45rem, 6.4vw, 1.9rem); }
    .benefit-card, .solution-card-mini { padding: 22px; }
    .sol-content { padding: 20px; }
    .sim-right-form { padding: 24px 18px; border-radius: 16px; }
    .range-box { padding: 20px 16px; }
    .range-box label strong { font-size: 1.1rem; }
    .form-row-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .form-group input, .form-group select, .form-group textarea { font-size: 16px; } /* evita zoom automático no iPhone */
    .about-img-box { height: 260px; }
    .faq-question { padding: 16px 16px; }
    .faq-answer { padding-left: 16px; padding-right: 16px; }
    .faq-item.active .faq-answer { max-height: 640px; }
    .cta-final-section p { font-size: 1rem; }

    .whatsapp-float { width: 54px; height: 54px; font-size: 1.7rem; }
    .lightbox-close { width: 44px; height: 44px; }
    .filter-btn { min-height: 40px; }
}

/* ---------- celular pequeno (até 560px): botão do WhatsApp vira ícone ---------- */
@media (max-width: 560px) {
    .whatsapp-header-btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; font-size: 1.35rem; gap: 0; }
    .whatsapp-header-btn .wa-text { display: none; }
    .logo-divider, .logo-tagline { display: none; }
}

@media (max-width: 480px) {
    .sim-grid-results { grid-template-columns: minmax(0, 1fr); }
    .hero-simulator-card .sim-res-row { flex-wrap: wrap; }
    .logo-main { font-size: 1.4rem; }
    .logo-sub { font-size: .85rem; }
    .about-badge-float { position: relative; left: auto; right: auto; bottom: auto; margin: -24px 12px 0; }
    .about-img-box { margin-bottom: 0; }
}

@media (max-width: 360px) {
    .hero-stats h2 { font-size: 1.1rem; }
    .hero-stats p { font-size: .7rem; }
    .section-header h2, .cta-final-section h2 { font-size: 1.4rem; }
    .btn-cyan, .btn-ghost { padding: 12px 16px; }
}

/* ---------- galeria de fotos: celular deitado (tela baixa) ---------- */
.lightbox { overscroll-behavior: contain; }
@media (max-height: 500px) {
    .lightbox { padding: 10px; }
    .lightbox-content { max-height: calc(100vh - 20px); }
    .lightbox-content img { max-height: 58vh; }
    .lightbox-content h3 { margin: 8px 0 2px; font-size: 1rem; }
    .lightbox-content p { display: none; }
    .lightbox-counter { margin-top: 6px; }
}

/* ---------- painel administrativo (só organização, sem mudar cores) ---------- */
.admin-dashboard { padding-top: 32px; padding-bottom: 56px; }
.admin-header-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.stat-card { display: flex; align-items: center; gap: 14px; }
.admin-section-card { margin-bottom: 28px; max-width: 100%; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; min-width: 480px; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border-color); }
.thumb-preview { display: block; width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.auth-container { display: flex; justify-content: center; padding: 48px 0; }
.auth-card { width: 100%; max-width: 420px; }
.add-project-form input[type="file"] { max-width: 100%; }
@media (max-width: 640px) {
    .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .auth-container { padding: 28px 0; }
}
