✦ Verified product
DENIM PANTS LIGHT
EUR 74.95
Crudo
Verified independent store
→
/* Scoped styles (prefijados para evitar conflictos) */ .my-toggle-wrapper { display: flex; flex-direction: column; gap: 1rem; } .my-toggle-btn { cursor: pointer; background-color:
transparent; border: none; font-family: 'Af Mono', monospace; font-weight: bold; color: #000; margin: 0; font-size: 2rem; text-align: left; text-decoration: underline; text-transform: uppercase; padding: 0; } .my-toggle-content { overflow: hidden; max-height: 0; transition: max-height 320ms ease; margin-top: 0.5rem; font-family: 'Af Mono', monospace; font-size: 1.2rem; line-height: 1.5; } /* Clase que indica abierto (JS ajusta inline max-height para animación) */ .my-toggle-open { /* max-height se controla vía JS para un valor exacto */ } .my-size-guide-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin-top: 0.5rem; } .my-size-guide-table th, .my-size-guide-table td { border: 1px solid #000; padding: 8px; text-align: center; } .my-size-guide-table th { background-color: #f9f9f9; font-weight: bold; } MATERIALS & INFO Raw Denim: 100% cotton (source: Spain)Brand Patch: Cow leather SIZE GUIDE SIZE WAIST (cm) INSEAM (cm) FRONT RISE (cm) S 38 71 30 M 40 72 31 L 42 73 32 (function () { // Espera al DOM (si el HTML se inyecta después, intenta ejecutar igual) function initToggles(root) { root = root || document; var buttons = root.querySelectorAll('.my-toggle-btn'); buttons.forEach(function(btn) { // prevenir duplicar listeners if (btn.dataset.toggleInit === '1') return; btn.dataset.toggleInit = '1'; var id = btn.getAttribute('aria-controls'); var panel = document.getElementById(id); if (!panel) return; // Aseguramos estilos iniciales panel.style.maxHeight = '0px'; panel.setAttribute('aria-hidden', 'true'); btn.setAttribute('aria-expanded', 'false'); btn.addEventListener('click', function () { var isOpen = btn.getAttribute('aria-expanded') === 'true'; if (isOpen) { // cerrar panel.style.maxHeight = panel.scrollHeight + 'px'; // fijamos current para animar // Forzar reflow para que la transición funcione al cambiar a 0 void panel.offsetHeight; panel.style.maxHeight = '0px'; panel.classList.remove('my-toggle-open'); panel.setAttribute('aria-hidden', 'true'); btn.setAttribute('aria-expanded', 'false'); } else { // abrir: calculamos altura real y la ponemos en max-height panel.style.maxHeight = panel.scrollHeight + 'px'; panel.classList.add('my-toggle-open'); panel.setAttribute('aria-hidden', 'false'); btn.setAttribute('aria-expanded', 'true'); // opcional: tras la transición limpiamos max-height para permitir contenido dinámico panel.addEventListener('transitionend', function te() { if (panel.classList.contains('my-toggle-open')) { panel.style.maxHeight = 'none'; } panel.removeEventListener('transitionend', te); }); } }); }); } // Ejecutar ahora initToggles(document); // Si tu theme inyecta/destruye contenido dinámicamente (AJAX), escucha mutaciones: var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { if (m.addedNodes && m.addedNodes.length) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { // si hay nuevos toggles if (node.querySelector && node.querySelector('.my-toggle-btn')) { initToggles(node); } } }); } }); }); observer.observe(document.body, { childList: true, subtree: true }); })();