/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #f3f4f6;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --white: #ffffff;
    --success: #10b981;

    /* Tipografia */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Espaçamentos */
    --container-width: 1200px;
    --section-padding: 5rem 1.5rem;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ========================================
   CONTAINER & SECTION
   ======================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-padding);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-light);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* ========================================
   HEADER & NAVBAR
   ======================================== */
.header {
    position: sticky;
    top: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    display: none;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}
.nav-link-current { color: var(--primary); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-icon.instagram {
    color: #E4405F;
}
.btn-icon.instagram span { font-size: .68rem; font-weight: 700; }

.btn-icon:hover {
    background: var(--secondary);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-primary-small,
.btn-secondary-small {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-small {
    background: var(--primary);
    color: var(--white);
}

.btn-secondary-small {
    background: var(--secondary);
    color: var(--text);
}

/* ========================================
   HERO
   ======================================== */
.hero { padding: 4.5rem 1.5rem; background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); }

.hero-content { align-items: center; display: grid; gap: 4rem; grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr); margin: 0 auto; max-width: var(--container-width); }
.hero-text { text-align: left; }

.hero-logo { margin: 0 0 2rem; }

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 0 1.2rem;
}

.hero-credentials { color: var(--primary-dark); font-size: .9rem; font-weight: 600; margin-bottom: 2.2rem; }

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.hero-image { box-shadow: var(--shadow-lg); margin: 0; overflow: hidden; border-radius: 20px; }
.hero-image img { aspect-ratio: 3 / 2; height: 100%; object-fit: cover; width: 100%; }

/* ========================================
   SOBRE
   ======================================== */
.sobre-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.sobre-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sobre-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-light);
}

.cro-info {
    font-size: 1rem;
    color: var(--text);
    padding: 1rem;
    background: var(--secondary);
    border-radius: 8px;
}

.sobre-image img {
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}
.credential-list { border-top: 1px solid var(--border); display: grid; gap: .8rem; list-style: none; padding-top: 1.3rem; }
.credential-list li { color: var(--text-light); font-size: .98rem; line-height: 1.55; padding-left: 1.25rem; position: relative; }
.credential-list li::before { color: var(--primary); content: "•"; font-weight: 700; left: 0; position: absolute; }

/* ========================================
   CONSULTÓRIO
   ======================================== */
.consultorio { background: #f8fbff; }
.consultorio-gallery { display: grid; gap: 1rem; grid-template-columns: 1.35fr .65fr .65fr; grid-template-rows: repeat(2, 210px); }
.consultorio-gallery figure { align-items: center; background: var(--white); border-radius: 14px; display: flex; justify-content: center; margin: 0; overflow: hidden; }.consultorio-gallery .gallery-featured { grid-row: 1 / -1; }.consultorio-gallery figure:last-child { grid-column: 2 / -1; }.consultorio-gallery img { height: 100%; object-fit: contain; object-position: center; transition: transform .3s ease; width: 100%; }.consultorio-gallery figure:hover img { transform: scale(1.02); }

/* ========================================
   ESTUDOS
   ======================================== */
.studies-hero { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); padding: 7rem 1.5rem; }.studies-hero .container { max-width: 900px; }.studies-eyebrow { color: var(--primary); font-size: .78rem; font-weight: 700; letter-spacing: .1em; margin-bottom: 1rem; text-transform: uppercase; }.studies-hero h1, .studies-intro h2 { color: var(--text); font-size: clamp(2.4rem, 5vw, 4.5rem); letter-spacing: -.055em; line-height: 1.03; margin-bottom: 1.5rem; }.studies-hero > .container > p:last-child { color: var(--text-light); font-size: 1.2rem; line-height: 1.7; max-width: 720px; }.studies-intro-content { align-items: start; display: grid; gap: 5rem; grid-template-columns: 1fr 1fr; }.studies-intro h2 { font-size: clamp(2rem, 3vw, 3.2rem); margin: 0; }.studies-intro-content > p { color: var(--text-light); font-size: 1.08rem; line-height: 1.75; margin: 0; }.studies-list { background: var(--secondary); }.study-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); }.study-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; min-height: 310px; padding: 1.8rem; transition: transform .2s ease, box-shadow .2s ease; }.study-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }.study-meta { color: var(--primary); font-size: .72rem; font-weight: 700; letter-spacing: .08em; margin-bottom: 1rem; text-transform: uppercase; }.study-card h3 { font-size: 1.35rem; line-height: 1.22; margin-bottom: .8rem; }.study-card > p:not(.study-meta) { color: var(--text-light); font-size: .95rem; line-height: 1.55; }.study-card a { color: var(--primary); font-size: .9rem; font-weight: 700; margin-top: auto; padding-top: 1.4rem; }.study-card a span { font-size: 1.2rem; }.study-card-featured { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }.study-card-featured .study-meta, .study-card-featured a { color: #bfdbfe; }.study-card-featured > p:not(.study-meta) { color: #dbeafe; }.visually-hidden { height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* ========================================
   SERVIÇOS
   ======================================== */
.servicos {
    background: var(--secondary);
}

.servicos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.servico-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.servico-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.servico-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    border-radius: 12px;
    color: var(--primary);
}

.servico-categoria {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.servico-titulo {
    font-size: 1.5rem;
    font-weight: 700;
}

.servico-descricao {
    color: var(--text-light);
    line-height: 1.6;
}

/* ========================================
   AGENDE
   ======================================== */
.agende-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.agende-info {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow);
}
.agende-button { margin-top: 1rem; }

.contact-item {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.contact-link {
    color: var(--primary);
    font-weight: 600;
    transition: color 0.2s;
}

.contact-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.horario {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
}

.trafft-container {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.trafft-container h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.trafft-placeholder {
    margin-top: 1.5rem;
}

/* ========================================
   CONTATO
   ======================================== */
.contato {
    background: var(--secondary);
}

.contato-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contato-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contato-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.contatos-lista {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mapa-placeholder {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.mapa-placeholder p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--text);
    color: var(--white);
    padding: 3rem 1.5rem 2rem;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-logo img {
    border-radius: 50%;
}

.footer-cro {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.footer-text {
    color: #9ca3af;
    font-size: 0.875rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-link {
    color: #9ca3af;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--white);
}

/* ========================================
   COOKIE BAR
   ======================================== */
.cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.cookie-bar[style*="display: none"] {
    display: none !important;
}

.cookie-content {
    max-width: var(--container-width);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-text {
    flex: 1;
}

.cookie-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
}

.cookie-text a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-actions button {
        flex: 1;
    }
}

/* ========================================
   WHATSAPP FLUTUANTE
   ======================================== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: transform 0.2s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}
.whatsapp-float span { font-size: 1.2rem; font-weight: 700; }

/* ========================================
   RESPONSIVO
   ======================================== */
@media (max-width: 768px) {
    /* Navbar mobile */
    .nav-menu {
        position: fixed;
        top: 73px;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--white);
        display: flex;
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 73px);
        overflow-y: auto;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
        transition: all 0.3s ease-in-out;
        pointer-events: none;
    }

    .nav-menu.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: all !important;
    z-index: 2000 !important; /* ensure it's above other fixed elements */
    }

    .nav-menu li {
        padding: 0.75rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-link {
        display: block;
        padding: 0.5rem 0;
        font-size: 1.1rem;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
    z-index: 2100; /* ensure button is above nav/menu and other fixed elements */
    pointer-events: auto;
    }

    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        background: var(--text);
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(10px, 10px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .nav-actions .btn-primary {
        display: none;
    }

    /* Hero */
    .hero { padding: 3.5rem 1.5rem; }
    .hero-content { display: flex; flex-direction: column; gap: 2.5rem; }
    .hero-text { text-align: center; }
    .hero-logo { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-image { order: -1; width: 100%; }
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-credentials { margin-bottom: 1.8rem; }

    /* Sobre */
    .sobre-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sobre-image {
        order: -1;
    }

    .consultorio-gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 260px 160px 160px; }.consultorio-gallery .gallery-featured { grid-column: 1 / -1; grid-row: auto; }.consultorio-gallery figure:last-child { grid-column: auto; }

    .studies-hero { padding: 5rem 1.5rem; }.studies-hero h1 { font-size: 2.55rem; }.studies-intro-content { display: block; }.studies-intro-content > p { margin-top: 1.5rem; }.study-grid { grid-template-columns: 1fr; }.study-card { min-height: 0; }

    /* Serviços */
    .servicos-grid {
        grid-template-columns: 1fr;
    }

    /* Contato */
    .contato-content {
        grid-template-columns: 1fr;
    }

    /* Cookie bar */
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    /* WhatsApp */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 1rem;
        right: 1rem;
    }

    .whatsapp-float svg {
        width: 24px;
        height: 24px;
    }
}

/* When menu is open, prevent body scroll and make sure menu stays on top */
body.menu-open {
    overflow: hidden;
}

/* Extra safety: ensure nav-menu shows when active even if other styles interfere */
@media (max-width: 768px) {
    .nav-menu {
        display: flex !important;
    }
}
