/* --- FAQ Button Base --- */
.faq-button {
    position: fixed;
    bottom: 50px;
    right: 32px;
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 16px #0001;
    padding: 8px;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), box-shadow 0.2s;
    box-sizing: border-box;
    z-index: 104;
}

.faq-button.animated {
    opacity: 1;
    transform: scale(1);
}

.faq-button img {
    width: 44px;
    height: 44px;
    display: block;
    pointer-events: none;
}

.faq-button:hover {
    background: var(--secondary-color, #f4ebdc);
    box-shadow: 0 6px 12px rgba(0,0,0,0.22);
    transform: translateY(-3px) scale(1.08);
}

/* --- FAQ Modal --- */
.faq-modal {
    display: none;
    position: fixed;
    z-index: 400;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.7);
    box-sizing: border-box;
}

.faq-modal-content {
    background: var(--white, #fff);
    margin: 60px auto;
    padding: 30px;
    border-radius: 3px;
    width: 80%; 
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
    color: var(--primary-color, #593621);
    position: relative;
}

.faq-modal-content h2 {
    color: var(--primary-color, #593621);
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color, #593621);
    font-size: 2rem;
}

/* --- Close Button --- */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary-color, #593621);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-modal:hover {
    background: var(--secondary-color, #f4ebdc);
}

/* --- FAQ Items Container --- */
#faq-items-container {
    width: 100%;
}

.loading-message {
    text-align: center;
    color: var(--primary-color, #593621);
    font-style: italic;
    padding: 20px;
}

/* --- FAQ Item Styles --- */
.faq-item {
    border-bottom: 1px solid #e0d4c3;
    margin-bottom: 15px;
    overflow: hidden;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* --- FAQ Question Button --- */
.faq-question {
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color, #593621);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    border-radius: 3px;
    position: relative;
}

.faq-question:hover {
    background: var(--secondary-color, #f4ebdc);
}

.faq-question.active {
    background: var(--secondary-color, #f4ebdc);
}

/* --- FAQ Arrow (usar setas existentes) --- */
.faq-question svg,
.faq-question .arrow,
.faq-question::before,
.faq-question i,
.faq-question .fas {
    transition: transform 0.3s ease;
}

.faq-question.active svg,
.faq-question.active .arrow,
.faq-question.active::before,
.faq-question.active i,
.faq-question.active .fas {
    transform: rotate(180deg);
}

/* --- FAQ Answer --- */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease, opacity 0.3s ease;
    background: #fafafa;
    border-radius: 0 0 3px 3px;
    padding: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.faq-answer.active {
    max-height: 1000px;
    padding: 20px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: slideInFade 0.6s ease forwards;
}

/* Remover espaçamento no início da resposta (indentação HTML) */
.faq-answer::first-line {
    text-indent: 0;
    white-space: normal;
}

.faq-answer p {
    margin: 0;
    line-height: 1.6;
    color: var(--primary-color, #593621);
    opacity: 0;
    transform: translateY(15px);
    animation: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.faq-answer.active p {
    animation: textAppear 0.8s ease 0.2s forwards;
}

/* Preservar espaços em branco no conteúdo das FAQs */
.faq-answer {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Animações CSS */
@keyframes slideInFade {
    0% {
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
        padding-top: 0;
        padding-bottom: 0;
    }
    50% {
        opacity: 0.5;
        transform: translateY(-5px);
    }
    100% {
        max-height: 300px;
        opacity: 1;
        transform: translateY(0);
        padding: 20px;
    }
}

@keyframes textAppear {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    50% {
        opacity: 0.7;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading shimmer effect */
.faq-answer.loading {
    display: block !important;
    max-height: 60px !important;
    padding: 20px !important;
    opacity: 1;
    position: relative;
    background: #f8f8f8;
}

.faq-answer.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 16px;
    background: linear-gradient(90deg, 
        #e0d4c3 25%, 
        #f0e8dc 50%, 
        #e0d4c3 75%
    );
    background-size: 200% 100%;
    border-radius: 3px;
    animation: shimmer 1.5s ease-in-out infinite;
    transform: translateY(-50%);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Hover effect na pergunta ativa */
.faq-question.active {
    background: var(--secondary-color, #f4ebdc);
    transform: translateX(3px);
    transition: all 0.3s ease;
}

/* Fallback para qualquer div dentro de faq-item */
.faq-item > div:not(.faq-question) {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease, opacity 0.3s ease;
    background: #fafafa;
    border-radius: 0 0 3px 3px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.faq-item > div:not(.faq-question).active {
    max-height: 300px !important;
    padding: 20px !important;
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    animation: slideInFade 0.6s ease forwards;
}

.faq-item > div:not(.faq-question).active p {
    animation: textAppear 0.8s ease 0.2s forwards;
}

/* Animação da seta */
.faq-question svg,
.faq-question .arrow,
.faq-question::before,
.faq-question .fas,
.faq-question i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-question.active svg,
.faq-question.active .arrow,
.faq-question.active::before,
.faq-question.active .fas,
.faq-question.active i {
    transform: rotate(180deg);
}

/* Efeito pulse na pergunta quando ativa */
.faq-question.active {
    background: var(--secondary-color, #f4ebdc);
    transform: translateX(3px);
    transition: all 0.3s ease;
    box-shadow: inset 3px 0 0 var(--primary-color, #593621);
}
@media (min-width: 768px) and (max-width: 1023px){
    .faq-button { 
        width: 35px; 
        height: 35px; 
        right: 20px; 
        bottom: 24px;
    }
    .faq-button img {
        width: 27px;
        height: 27px;
    }
    .faq-modal-content { 
        width: 90%; 
        padding: 20px; 
        margin: 40px auto;
    }
    .faq-modal-content h2 { 
        font-size: 1.7rem; 
    }
    .faq-question {
        font-size: 1rem;
        padding: 15px;
    }
    .faq-answer.active {
        padding: 15px !important;
    }
    .faq-item > div:not(.faq-question).active {
        padding: 15px !important;
    }
    
    /* Animações mais rápidas em mobile */
    .faq-answer.active {
        animation-duration: 0.4s;
    }
    .faq-answer.active p {
        animation-duration: 0.6s;
        animation-delay: 0.1s;
    }
}
/* Mobile Responsive */
@media (max-width: 768px) {
    .faq-button {
        width: 45px;
        height: 45px;
        right: 20px;
        bottom: 24px;
        box-sizing: border-box;
        padding: 6px;
    }
    .faq-button img {
        width: 32px;
        height: 32px;
    }
    .faq-modal-content { 
        width: 90%; 
        padding: 20px; 
        margin: 40px auto;
    }
    .faq-modal-content h2 { 
        font-size: 1.7rem; 
    }
    .faq-question {
        font-size: 1rem;
        padding: 15px;
    }
    .faq-answer.active {
        padding: 15px !important;
    }
    .faq-item > div:not(.faq-question).active {
        padding: 15px !important;
    }
    
    /* Animações mais rápidas em mobile */
    .faq-answer.active {
        animation-duration: 0.4s;
    }
    .faq-answer.active p {
        animation-duration: 0.6s;
        animation-delay: 0.1s;
    }
}

@media (max-width: 576px) {
    .faq-button {
        width: 40px;
        height: 40px;
        bottom: 15px;
        box-sizing: border-box;
        padding: 5px;
    }
    .faq-button img { 
        width: 28px; 
        height: 28px; 
    }
    .faq-modal-content { 
        width: 97%; 
        padding: 15px; 
        margin: 20px auto; 
    }
    .faq-modal-content h2 { 
        font-size: 1.5rem; 
    }
    .faq-question {
        font-size: 0.95rem;
        padding: 12px;
    }
    .faq-answer.active {
        padding: 12px !important;
        max-height: 400px !important;
    }
    .faq-item > div:not(.faq-question).active {
        padding: 12px !important;
        max-height: 400px !important;
    }
    .close-modal {
        top: 10px;
        right: 15px;
    }
    
    /* Animações ainda mais rápidas em mobile pequeno */
    .faq-answer.active {
        animation-duration: 0.3s;
    }
    .faq-answer.active p {
        animation-duration: 0.5s;
        animation-delay: 0.05s;
    }
}