/* Widget Acordeón Repeater */
.elementor-widget-acordeon-repeater {
    margin-bottom: 2rem;
    font-family: inherit;
}

.acordeon-repeater-titulo {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 0.5rem;
}

.acordeon-repeater-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Grid Layout */
.acordeon-repeater-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.acordeon-repeater-grid .acordeon-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
    border: none;
    transition: all 0.3s ease;
}

.acordeon-repeater-grid .acordeon-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.acordeon-repeater-grid .acordeon-header {
    border-radius: 8px 8px 0 0;
}

.acordeon-repeater-grid .acordeon-content {
    border-radius: 0 0 8px 8px;
}

/* Asegurar que el grid funcione correctamente */
.elementor-widget-acordeon-repeater .acordeon-repeater-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

/* Forzar el display grid */
.acordeon-repeater-grid {
    display: grid !important;
}

/* Estilos específicos para diferentes contextos */
.elementor-widget .acordeon-repeater-grid,
.elementor-widget-acordeon-repeater .acordeon-repeater-grid,
div.acordeon-repeater-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

/* Override para cualquier conflicto */
*[class*="acordeon-repeater-grid"] {
    display: grid !important;
}

.acordeon-item {
    border-bottom: 1px solid #e0e0e0;
}

.acordeon-item:last-child {
    border-bottom: none;
}

.acordeon-header {
    background-color: #f8f9fa !important;
    padding: 1rem 1.5rem !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
    border: none !important;
    width: 100% !important;
    text-align: left !important;
    gap: 1rem !important;
    min-height: 60px !important;
    box-sizing: border-box !important;
}

.acordeon-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.acordeon-icono:hover {
    color: inherit !important;
}

.acordeon-icono i {
    font-size: 1.2rem;
    color: inherit;
}

.acordeon-icono-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.acordeon-header:hover {
    background-color: #e9ecef !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* MANTENER COLOR ORIGINAL CUANDO ESTÁ ABIERTO */
.acordeon-header.active {
    background-color: #f8f9fa !important;
    color: inherit !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.acordeon-header.active:hover {
    background-color: #e9ecef !important;
}

.acordeon-titulo {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: inherit;
    flex: 1;
    line-height: 1.4;
}

.acordeon-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* ICONO APUNTA HACIA ABAJO CUANDO CERRADO (estado por defecto) */
.acordeon-icon {
    transform: rotate(90deg) !important;
}

/* ICONO APUNTA HACIA ARRIBA CUANDO ABIERTO */
.acordeon-header.active .acordeon-icon {
    transform: rotate(-90deg) !important;

}

/* ESTILOS CRÍTICOS DEL ACORDEÓN - MÁXIMA PRIORIDAD */
.acordeon-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease !important;
    background-color: white !important;
    border-top: 1px solid #e0e0e0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.acordeon-content.active {
    max-height: 1000px !important;
    overflow: visible !important;
}

/* Forzar estilos específicos para el widget */
.elementor-widget-acordeon-repeater .acordeon-content {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.3s ease !important;
    background-color: white !important;
    border-top: 1px solid #e0e0e0 !important;
}

.elementor-widget-acordeon-repeater .acordeon-content.active {
    max-height: 1000px !important;
    overflow: visible !important;
}

.acordeon-body {
    padding: 1.5rem;
    line-height: 1.6;
    color: #555;
    font-size: 0.95rem;
}

.acordeon-body h1,
.acordeon-body h2,
.acordeon-body h3,
.acordeon-body h4,
.acordeon-body h5,
.acordeon-body h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.acordeon-body ul,
.acordeon-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.acordeon-body p {
    margin-bottom: 1rem;
}

.acordeon-body p:last-child {
    margin-bottom: 0;
}

.no-contenido {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
}

.no-contenido p {
    margin: 0;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .acordeon-repeater-titulo {
        font-size: 1.5rem;
    }
    
    .acordeon-header {
        padding: 0.75rem 1rem;
        min-height: 50px;
    }
    
    .acordeon-titulo {
        font-size: 1rem;
    }
    
    .acordeon-body {
        padding: 1rem;
    }
    
    .acordeon-icono {
        width: 20px;
        height: 20px;
    }
    
    .acordeon-icono i {
        font-size: 1rem;
    }
    
    /* Grid responsive */
    .acordeon-repeater-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .acordeon-repeater-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .acordeon-header {
        padding: 0.5rem 0.75rem;
        min-height: 45px;
    }
    
    .acordeon-titulo {
        font-size: 0.9rem;
    }
    
    .acordeon-body {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Estilos para Elementor */
.elementor-widget-acordeon-repeater .acordeon-header {
    background-color: var(--acordeon-color, #f8f9fa);
    color: var(--acordeon-text-color, #333);
}

.elementor-widget-acordeon-repeater .acordeon-header:hover {
    background-color: var(--acordeon-hover-color, #e9ecef);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* MANTENER COLOR ORIGINAL CUANDO ABIERTO */
.elementor-widget-acordeon-repeater .acordeon-header.active {
    background-color: var(--acordeon-color, #f8f9fa) !important;
    color: var(--acordeon-text-color, #333) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.elementor-widget-acordeon-repeater .acordeon-header.active:hover {
    background-color: var(--acordeon-hover-color, #e9ecef) !important;
}

/* Mejoras adicionales */
.elementor-widget-acordeon-repeater {
    --acordeon-border-radius: 8px;
    --acordeon-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --acordeon-transition: all 0.3s ease;
    --grid-gap: 20px;
}

.elementor-widget-acordeon-repeater .acordeon-repeater-grid {
    --grid-gap: 20px;
    gap: var(--grid-gap);
}

.elementor-widget-acordeon-repeater .acordeon-repeater-container {
    border-radius: var(--acordeon-border-radius);
    box-shadow: var(--acordeon-shadow);
    transition: var(--acordeon-transition);
}

.elementor-widget-acordeon-repeater .acordeon-header {
    transition: var(--acordeon-transition);
}

.elementor-widget-acordeon-repeater .acordeon-content {
    transition: var(--acordeon-transition);
}
