@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;900&display=swap');

:root {
    --purple-primary: #8A19D6;
    --purple-dark: #6900B8;
    --purple-light: #FDF9FF;
    --text-main: #6E6875;
    --text-muted: #A098A8;
    --background-color: #FFF7FD;
    --background-sidebar: #F6EAF9;
    --background-main-content: #FCF0FF;
    --border-color: #EFEAF4;
    --poppins-font: "Poppins", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--background-color); min-height: 100vh; font-family: var(--poppins-font); display: flex; flex-direction: column; }

/* UTILITÁRIOS */
.poppins-regular { font-weight: 400; }
.poppins-medium { font-weight: 500; }
.poppins-semibold { font-weight: 600; }
.poppins-bold { font-weight: 700; }
.poppins-black { font-weight: 900; }
.text-purple-primary { color: var(--purple-primary); }

/* HEADER */
.logo-link { text-decoration: none; }
.topbar { width: 100%; display: flex; justify-content: space-between; align-items: center; background-color: var(--background-main-content); padding: 24px 40px; height: 70px; border-bottom: 1px solid var(--border-color); }
.topbar-left { display: flex; align-items: center; gap: 40px; }
.topbar-title { color: var(--purple-dark); font-size: 24px; }
.topbar-tabs { display: flex; gap: 24px; }
.tab-item { text-decoration: none; font-size: 14px; color: var(--text-muted); position: relative; padding: 4px 0; transition: color 0.2s; }
.tab-item:hover { color: var(--text-main); }
.tab-item.active { color: var(--purple-primary); }
.tab-item.active::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 3px; background-color: var(--purple-primary); border-radius: 2px; }
.topbar-right { display: flex; align-items: center; gap: 24px; }
.btn-confirm-donation { background-color: var(--purple-primary); color: #FFFFFF; border: none; padding: 10px 24px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: background-color 0.2s; }
.btn-confirm-donation:hover { background-color: var(--purple-dark); }

/* CONTAINER PRINCIPAL */
.contact-container { flex-grow: 1; padding: 40px; max-width: 1100px; margin: 0 auto; width: 100%; }

/* CABEÇALHO DA PÁGINA */
.contact-header { text-align: center; margin-bottom: 48px; }
.institute-badge { display: inline-block; background-color: var(--purple-light); color: var(--purple-dark); font-size: 12px; padding: 6px 16px; border-radius: 20px; margin-bottom: 16px; border: 1px solid #EFE0F7; letter-spacing: 0.3px; }
.contact-header h1 { font-size: 32px; color: #1A1323; margin-bottom: 12px; }
.contact-header p { font-size: 15px; color: var(--text-main); max-width: 560px; margin: 0 auto; line-height: 1.6; }

/* CARDS DE CONTATO */
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 56px; }
.info-card { background: #FFFFFF; border: 1px solid var(--border-color); border-radius: 12px; padding: 28px; box-shadow: 0 4px 16px rgba(0,0,0,0.02); }
.info-icon { margin-bottom: 16px; }
.info-icon svg { width: 24px; height: 24px; display: block; }
.info-card h3 { font-size: 16px; color: var(--purple-dark); margin-bottom: 8px; }
.info-card p { font-size: 14px; color: var(--text-main); line-height: 1.6; }
.map-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--purple-primary); text-decoration: none; }
.map-link:hover { text-decoration: underline; }

/* REDES SOCIAIS */
.social-section { text-align: center; margin-bottom: 56px; }
.section-title { font-size: 20px; color: #1A1323; margin-bottom: 24px; }
.social-links { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }
.social-icon { width: 24px; height: 24px; display: block; }
.social-item { display: flex; align-items: center; gap: 8px; text-decoration: none; background-color: #FFFFFF; border: 1px solid var(--border-color); padding: 12px 24px; border-radius: 12px; transition: box-shadow 0.2s, transform 0.2s; }
.social-item:hover { box-shadow: 0 4px 12px rgba(138, 25, 214, 0.08); transform: translateY(-2px); }
.social-item span { font-size: 14px; color: var(--purple-dark); }

/* MAPA */
.map-section { text-align: center; margin-bottom: 48px; }
.map-embed { border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(105, 0, 184, 0.06); margin-bottom: 12px; }
.map-note { font-size: 13px; color: var(--text-muted); }

/* RODAPÉ */
.main-footer { background-color: #EBE2F0; padding: 32px 40px; display: flex; justify-content: space-between; align-items: center; color: var(--text-main); margin-top: auto; }
.footer-left h4 { font-size: 16px; margin-bottom: 8px; color: var(--purple-primary); }
.footer-left p { font-size: 12px; }

/* FAB */
.fab-button { position: fixed; bottom: 32px; right: 32px; width: 56px; height: 56px; border-radius: 50%; background-color: var(--purple-primary); border: none; box-shadow: 0 4px 12px rgba(138, 25, 214, 0.4); display: flex; justify-content: center; align-items: center; cursor: pointer; transition: transform 0.2s ease, opacity 0.3s; z-index: 100; opacity: 0; pointer-events: none; }
.fab-button.visible { opacity: 1; pointer-events: auto; }
.fab-button:hover { transform: scale(1.05); background-color: var(--purple-dark); }
.arrow-top { width: 30px; height: 30px; display: block; }

/* ==================== MODAL PIX - CSS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 19, 35, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* TRAVAR O SCROLL DO BODY QUANDO MODAL ABERTO */
body.modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px); /* evita salto de layout (opcional) */
}

/* MODAL CONTAINER - SCROLL INTERNO */
.modal-container {
    background-color: #FFFFFF;
    border-radius: 20px;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;          /* altura máxima */
    overflow-y: auto;          /* scroll vertical interno */
    position: relative;
    box-shadow: 0 24px 64px rgba(105, 0, 184, 0.25);
    transform: translateY(20px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Remove as propriedades problemáticas */
    padding-right: 0;
    scrollbar-gutter: auto;
}

/* ESTILIZAÇÃO DA BARRA DE ROLAGEM (DENTRO DO MODAL) */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: #EFEAF4;
    border-radius: 10px;
    margin-block: 8px;        /* espaço no topo/fundo */
}

.modal-container::-webkit-scrollbar-thumb {
    background: #8A19D6;
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: #6900B8;
}

/* ==================== SEÇÃO PONTO DE COLETA NO MODAL ==================== */
.modal-collection-point {
    margin: 0 32px 20px;
    padding: 20px;
    background-color: #FDF9FF;
    border: 1px solid #EFEAF4;
    border-radius: 12px;
    text-align: center;
}

.modal-close {
    position: sticky;
    top: 16px;
    left: 100%;
    transform: translateX(-16px);
    margin-bottom: -56px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #F6EAF9;
    color: #6900B8; /* garante que o SVG herde essa cor */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.modal-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

.modal-close:hover {
    background-color: #EFE4F4;
    transform: translateX(-16px) rotate(90deg); 
}

.modal-header {
    text-align: center;
    padding: 40px 32px 8px;
}

.modal-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8A19D6, #6900B8);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-icon-circle svg {
    width: 28px;
    height: 28px;
    display: block;
}

.modal-header h2 {
    font-size: 24px;
    color: #1A1323;
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 14px;
    color: #6E6875;
    max-width: 420px;
    margin: 0 auto;
}

.modal-body {
    display: flex;
    gap: 32px;
    padding: 24px 32px;
}

.modal-qr-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.qr-wrapper {
    position: relative;
    background-color: #FFF7FD;
    border: 3px solid #EFEAF4;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.92);
    color: #6900B8;
    font-size: 18px;
    padding: 6px 14px;
    border-radius: 6px;
    letter-spacing: 2px;
    pointer-events: none;
}

.qr-wrapper img {
    width: 180px;
    height: 180px;
    display: block;
}

.qr-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #F6EAF9;
    color: #6900B8;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
}

.qr-badge-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex-shrink: 0;
}

.modal-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-info-section h3 {
    font-size: 16px;
    color: #1A1323;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

.copy-box {
    background-color: #FCF0FF;
    border: 1px solid #EFEAF4;
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.copy-label-row {
    margin-bottom: 6px;
}

.copy-label {
    font-size: 11px;
    color: #A098A8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-value-row {
    margin-bottom: 12px;
}

.copy-value {
    font-size: 18px;
    color: #1A1323;
    word-break: break-all;
}

.btn-copy-pix {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #8A19D6;
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-copy-pix:hover {
    background-color: #6900B8;
}

.btn-copy-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.copy-feedback {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    color: #16A34A;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.copy-feedback.show {
    opacity: 1;
}

.institution-info {
    font-size: 12px;
    color: #A098A8;
    line-height: 1.6;
    padding-top: 8px;
    border-top: 1px solid #EFEAF4;
}

.institution-info strong {
    color: #6E6875;
}

.security-seal {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #16A34A;
    background-color: #F0FDF4;
    padding: 10px 14px;
    border-radius: 8px;
}

.security-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

.modal-footer {
    padding: 16px 32px 28px;
    text-align: center;
    border-top: 1px solid #EFEAF4;
}

.modal-footer p {
    font-size: 12px;
    color: #A098A8;
}

/* ==================== BOTÃO DOAR ITENS NO MODAL ==================== */
.modal-donate-items {
    margin: 0 32px 28px;
    text-align: center;
}

.divider-modal {
    height: 1px;
    background-color: #EFEAF4;
    margin: 0 0 20px 0;
}

.donate-items-text {
    font-size: 14px;
    color: #4D4354;
    margin-bottom: 16px;
}

.btn-donate-items {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #FFFFFF;
    color: #6900B8;
    border: 2px solid #6900B8;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-donate-items:hover {
    background-color: #F6EAF9;
    border-color: #8A19D6;
    color: #8A19D6;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(138, 25, 214, 0.15);
}

.btn-donate-icon {
    width: 18px;
    height: 18px;
    display: block;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 640px) {
    .modal-body {
        flex-direction: column;
        align-items: center;
        padding: 16px 24px;
        gap: 24px;
    }

    .modal-header {
        padding: 32px 20px 8px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-container {
        max-width: 95%;
        border-radius: 16px;
    }

    .copy-value {
        font-size: 15px;
    }

    .qr-wrapper img {
        width: 140px;
        height: 140px;
    }
}

.collection-icon {
    margin-bottom: 12px;
}

.collection-icon svg {
    width: 24px;
    height: 24px;
    display: block;
    margin: 0 auto;
}

.collection-text {
    font-size: 14px;
    color: #4D4354;
    margin-bottom: 8px;
    line-height: 1.5;
}

.collection-address {
    font-size: 16px;
    color: #1A1323;
    background-color: #FFFFFF;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #D0C2D7;
}

/* ========== BARRA INFERIOR (oculta em desktop) ========== */
.mobile-bottom-nav {
    display: none;
}

/* ========== RESPONSIVO (mobile) ========== */
@media (max-width: 768px) {
    /* Esconde as tabs e botão Doar do header no topo */
    .topbar-tabs,
    .btn-confirm-donation {
        display: none;
    }

    .topbar {
        padding: 16px 20px;
        height: auto;
    }

    .topbar-left {
        flex-direction: row;
        align-items: center;
    }

    .topbar-title {
        font-size: 20px;
    }

    /* Exibe a barra inferior fixa */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
        padding: 10px 0;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        height: 70px;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 13px;
        font-weight: 500;
        background: none;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
        padding: 6px 12px;
        border-radius: 12px;
        min-width: 72px;
    }

    /* Estado ativo: fundo roxo escuro e texto branco */
    .mobile-nav-item.active {
        background-color: var(--purple-dark);
        color: #FFFFFF;
        font-weight: 600;
    }

    .mobile-doar-btn.doar-active {
        background-color: var(--purple-dark);
        color: #FFFFFF;
    }
    .mobile-doar-btn.doar-active .nav-label {
        color: #FFFFFF;
    }

    .nav-icon {
        width: 28px;
        height: 28px;
        display: block;
    }

    .nav-label {
        font-size: 13px;
        font-weight: 500;
        line-height: 1;
    }

    /* Espaço para a barra fixa */
    body {
        padding-bottom: 70px;
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    .contact-container {
        padding: 24px 20px;
        padding-bottom: 24px;
    }

    .main-footer {
        padding: 24px 20px;
    }

    /* Reposiciona o FAB */
    .fab-button {
        bottom: 90px;
        bottom: calc(90px + env(safe-area-inset-bottom));
        right: 24px;
    }

    /* Ajustes de layout da página */
    .contact-header h1 {
        font-size: 26px;
    }

    .contact-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .map-embed iframe {
        height: 280px;
    }

    .main-footer {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}