1<#if entries?has_content>
2 <div class="faq-container">
3 <style>
4 .faq-container { margin-top: 20px !important; margin-bottom: 60px !important; max-width:800px; margin:0 auto; font-family:Arial,sans-serif; }
5 .faq-container .faq-question.open { color: var(--brand-color-1, #1F57A3) !important; }
6 .faq-container .faq-item { max-width: 900px; margin: 16px auto; padding: 14px; padding-bottom: 10px; border: 1px solid #DDE1E6; overflow:hidden; box-shadow:0 2px 4px rgba(0,0,0,0.1); }
7 .faq-container .faq-question { background: none; cursor:pointer; border:none;
8 width:100%; text-align:left; font-size:20px; font-weight:400; padding-left: 0; font-family: SohoGothicPro-Regular;
9 position:relative; line-height: 24px; color: #21272A; }
10 .faq-container .faq-question::after { content: url(/documents/d/global/ico-chevron-down); position:absolute; right:0px; top:50%;
11 transform: translateY(-50%) scale(0.6); }
12 .faq-container .faq-question.active::after { transform:translateY(-50%) scale(0.6) rotate(180deg); }
13 .faq-container .faq-answer { max-height:0; margin-top:10px; padding: 0 20px; overflow:hidden; background:#fff; }
14
15 .faq-container .faq-answer.active { max-height:500px; margin-top: 10px; padding-left: 0px; border-top: 1px solid #D0E0E480; }
16 .faq-container .faq-answer-content { line-height:1.6; font-family: SohoGothicPro-Regular; font-size: 16px; font-weight: 400; line-height: 24px;
17 text-align: left; color: #2D2D2B; padding-top: 12px }
18 </style>
19 <#list entries as entry>
20 <#assign renderer = entry.getAssetRenderer() />
21 <#assign fields = renderer
22 .getDDMFormValuesReader()
23 .getDDMFormValues()
24 .getDDMFormFieldValues()
25 />
26 <#assign question = "" />
27 <#assign answer = "" />
28 <#list fields as field>
29 <#assign name = field.getDDMFormField().getLabel().getString(locale) />
30 <#assign value = field.getValue().getString(locale) />
31
32 <#if name == "Pregunta">
33 <#assign question = field.getValue().getString(locale) />
34 <#elseif name == "Respuesta">
35 <#assign answer = field.getValue().getString(locale) />
36 </#if>
37 </#list>
38 <div class="faq-item">
39 <button
40 type="button"
41 class="faq-question"
42 onclick="toggleFAQ(${entry_index})"
43 >
44 ${question}
45 </button>
46
47 <div id="faq-answer-${entry_index}" class="faq-answer">
48 <div class="faq-answer-content">
49 ${answer}
50 </div>
51 </div>
52 </div>
53 </#list>
54 </div>
55
56 <script>
57 function toggleFAQ(index) {
58 const q = document.querySelectorAll('.faq-question')[index];
59 const a = document.getElementById('faq-answer-' + index);
60 q.classList.toggle('open');
61 q.classList.toggle('active');
62 a.classList.toggle('active');
63 }
64 </script>
65</#if>