/* Estilos para el componente de tabs personalizado */

.custom-tabs-container {
    display: flex;
    min-height: 400px;
    border-radius: 0;
    overflow: hidden;
}

/* Columna izquierda - Navegación de tabs */
.custom-tabs-nav {
    flex: 0 0 49%;
    background-color: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    max-height: 554px; /* Altura máxima para forzar el wrap a dos columnas */
    align-content: flex-start;
    gap: 2%;
    background: #fff !important;
}

.custom-tab-button {
    background-color: #ECE3D1 !important;
    border: none;
    padding: 20px !important;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    text-transform: none !important;
    font-weight: normal;
    color: #000 !important;
    border-left: 4px solid transparent;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    width: 50%; /* Cada botón ocupa exactamente el 50% del ancho */
    height: 60px; /* Altura fija para cada botón */
    box-sizing: border-box;
    border-radius: 0 !important;
    margin-bottom:15px;
}

.custom-tab-button:hover {
    background-color: #546056 !important;
    color: #fff !important;
}

.custom-tab-button:hover .custom-tab-arrow {
    color: #fff !important;
}

.custom-tab-button.active {
    background-color: #546056 !important; /* Color de fondo para tab activa */
    color: #fff !important; /* Color de texto para tab activa */
    border-left-color: #546056;
    font-weight: normal;
}

.custom-tab-button.active::after {
    content: '';
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 100%;
    background-color: #546056; /* Cambiar color del borde */
}

.custom-tab-arrow {
    font-size: 18px;
    font-weight: 300;
    font-style: normal;
    color: #000; /* Color por defecto de la flecha */
    transition: all 0.3s ease;
    transform: rotate(0deg); /* Flecha apuntando a la derecha por defecto */
}

.custom-tab-button.active .custom-tab-arrow {
    color: #fff !important;
    transform: rotate(90deg); /* Flecha apuntando hacia abajo cuando está activa */
}

.custom-tab-button:hover .custom-tab-arrow {
    color: #fff !important;
}

/* Columna derecha - Contenido */
.custom-tabs-content {
    flex: 1;
    background-color: #ffffff;
    padding: 0 20px 20px 60px !important;
    position: relative;
    border-left: none;
}

.custom-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.custom-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Estilos del contenido */
.custom-tab-content h3 {
    color: #007cba;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 0;
}

.custom-tab-content p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
    font-size: 15px;
}

.custom-tab-content a {
    color: var(--e-global-color-accent) !important;
    text-decoration: underline !important;
}

.custom-tab-content p:last-child {
    margin-bottom: 0;
}

.custom-tab-content strong {
    color: #333;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-tabs-container {
        flex-direction: column;
    }
    
    .custom-tabs-nav {
        flex: none;
        width: 100%;
        flex-direction: column;
        flex-wrap: nowrap;
        max-height: none; /* Quitar límite de altura en móvil */
    }
    
    .custom-tab-button {
        width: 100%; /* En móvil cada botón ocupa todo el ancho */
        height: auto; /* Altura automática en móvil */
        min-height: 50px;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-right: 1px solid #e0e0e0;
        margin-top: 17px;
    }
    
    .custom-tab-button.active {
        border-bottom-color: #546056;
        border-left: none;
    }
    
    .custom-tab-button.active::after {
        display: none;
    }
    
    /* En móvil, ocultar el contenedor de contenido original */
    .custom-tabs-content {
        display: none;
    }
    
    /* Contenido móvil que aparece después de cada tab */
    .custom-tab-content-mobile {
        background-color: #ffffff;
        padding: 25px 20px;
        border-top: 1px solid #e0e0e0;
        display: none;
        animation: fadeInMobile 0.3s ease-in-out;
    }
    
    .custom-tab-content-mobile.active {
        display: block;
    }
    
    .custom-tab-content-mobile h3 {
        font-size: 20px;
    }
    
    .custom-tab-content-mobile p {
        font-size: 14px;
    }
}

@keyframes fadeInMobile {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
        padding-top: 25px;
        padding-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .custom-tab-button {
        width: 100%; /* Asegurar ancho completo en móviles pequeños */
        padding: 15px 20px;
        font-size: 14px;
    }
    
    .custom-tabs-content {
        padding: 20px 15px !important;
    }
}

/* Reglas adicionales para asegurar los colores con mayor especificidad */
.elementor-widget-custom_tabs .custom-tab-button {
    background-color: #ECE3D1 !important;
    color: #000 !important;
}

.elementor-widget-custom_tabs .custom-tab-button.active {
    background-color: #546056 !important;
    color: #fff !important;
}

.elementor-widget-custom_tabs .custom-tab-button:hover {
    background-color: #546056 !important;
    color: #fff !important;
}

.elementor-widget-custom_tabs .custom-tab-button {
    margin-bottom: 15px;
}